If I have a multiple page the extensions like Plotly used on one page is also loaded on the other pages. This slows down the launch of the other pages, it does not add positively to the user experience and it means I have to spend more money on servers.
Please make it possible not to load unused extensions.
I would like to document the solution in #4281
Example
panel serve home.py dashboard.py --index home --autoreload
Open the developer tools and navigate to the network tab
Hard refresh the page by holding the Ctrl key and clicking the Refresh button
Sort the table by Time desc
Verify that plotly-2.10.1-min.js is loaded even though its not needed on the home page.
# home.py
import panel as pn
pn.extension(sizing_mode="stretch_width")
SECTION = """
Panel works really well with the visualization tools you already know and love like [Altair/ Vega](https://panel.holoviz.org/reference/panes/Vega.html), [Bokeh](https://panel.holoviz.org/reference/panes/Bokeh.html), [Datashader](https://datashader.org/), [Deck.gl/ pydeck](https://panel.holoviz.org/reference/panes/DeckGL.html), [Echarts/ pyecharts](https://panel.holoviz.org/reference/panes/ECharts.html), [Folium](https://panel.holoviz.org/reference/panes/Folium.html), [HoloViews](https://holoviews.org/), [hvPlot](https://hvplot.holoviz.org), [plotnine](https://panel.holoviz.org/reference/panes/Matplotlib.html), [Matplotlib](https://panel.holoviz.org/reference/panes/Matplotlib.html), [Plotly](https://panel.holoviz.org/reference/panes/Plotly.html), [PyVista/ VTK](https://panel.holoviz.org/reference/panes/VTK.html), [Seaborn](https://panel.holoviz.org/gallery/styles/SeabornStyle.html) and more. Panel also works with the [ipywidgets](https://panel.holoviz.org/reference/panes/IPyWidget.html) ecosystem.
"""
IMAGE = pn.pane.GIF("https://user-images.githubusercontent.com/42288570/211983400-3315ad0a-866a-4916-8809-6fc38eca34d9.gif", alt_text="Pythons DataViz works with Panel", link_url="https://panel.holoviz.org/reference/index.html#panes", height=400)
component = pn.Column(
SECTION, IMAGE
)
NAVIGATION = """
## Navigation
[home](home)
[dashboard](dashboard)
"""
pn.template.FastListTemplate(
site="Panel", site_url="https:\\panel.holoviz.org",
title="Home", main=[component], sidebar=[NAVIGATION],
main_max_width="900px",
).servable()
If I have a multiple page the extensions like Plotly used on one page is also loaded on the other pages. This slows down the launch of the other pages, it does not add positively to the user experience and it means I have to spend more money on servers.
Please make it possible not to load unused extensions.
I would like to document the solution in #4281
Example
Verify that
plotly-2.10.1-min.js
is loaded even though its not needed on the home page.