htmlwidget delayed loading

Hi there,

Is it possible to load htmlwidgets in a delayed manner?

For DT and highcharter to load correctly it seems that one is required to provide the initial UI with DT::dataTableOutput() or highcharter::highcharterOutput() for the relevant .js htmlwidget files to load.

It would be beneficial for users to keep the initial page size of a Shiny app low and defer the loading of, for example, highcharter assets until the relevant UI containing the highchart is loaded.

Does anyone have experience with deferring the loading of htmlwidget based libraries?