You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a quick lighthouse audit on Jupyter Book, and discovered that a large chunk of our Javascript loading is coming from loading the JS bundles needed for Jupyter widgets (there are some other improvements we can make too, will open other issues for that):
This is something we could load in a more restrictive way. Here are a few ideas from anticipated easiest-to-hardest:
Load this JS bundle only if:
The page is an ipynb file
The page is known to have notebook content (e.g., also covering MyST Markdown Notebooks)
The page is known to have widget content on it (maybe as part of the CellOutputBundle parsing logic?)
Value / benefit
This could save a lot of unnecessary JS loading, and speed up page load times.
Implementation details
I think these are the two libraries we could target:
A single page app would be a pretty substantial change. I've never seen a Sphinx site served as a single page app. Though you could probably do it with something like turbolinks. Maybe something to explore after we've picked off the lower hanging fruit.
@chrisjsewell agree that sounds like the right mechanism to use. Id be fine pinning our minimum sphinx 3 version to take advantage is this. You see any problems with that?
Description / Summary
I did a quick lighthouse audit on Jupyter Book, and discovered that a large chunk of our Javascript loading is coming from loading the JS bundles needed for Jupyter widgets (there are some other improvements we can make too, will open other issues for that):
This is something we could load in a more restrictive way. Here are a few ideas from anticipated easiest-to-hardest:
Load this JS bundle only if:
ipynb
fileValue / benefit
This could save a lot of unnecessary JS loading, and speed up page load times.
Implementation details
I think these are the two libraries we could target:
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="https://unpkg.com/@jupyter-widgets/html-manager@^0.20.0/dist/embed-amd.js"></script>
somewhere around here:
MyST-NB/myst_nb/__init__.py
Lines 284 to 301 in 2cc1260
Tasks to complete
No response
The text was updated successfully, but these errors were encountered: