Is the classic nbextension loader able to load modules?

Hi there

I’m a RISE contributor and am currently assessing the move to reveal.js v4.3.0

although there is some activity towards offering rise under jlab, I would like to focus on the move from 3.9 to 4.3 independently, that is to say under the classic ui

however at this point I am a bit stuck because it appears - as far as I can tell - that reveal.js v4.3.0 ships as a ES module only
and so I would need to find some means - even a hacky one - to have RISE’s main.js loaded as a module itself – i.e. using <script type="module"> instead of <script type="text/javascript">

I could not even locate the code that is responsible for loading nbextensions, so any hint as to where to look for would be appreciated already :slight_smile:

@minrk @carreau if I may, I figured maybe any of you guys would have an insight on this matter ?

Unfortunately, I think you’ll find a lot of maintainers have moved on from the day-to-day maintenance of the jquery/bootstrap frontend. Future releases of that are now pretty much for reacting to security issues, as basically any change would be consider breaking to somebody. As such, even if there was a way to make the requirejs work with modules… I wouldn’t anticipate any “modernization” to that codebase even being review, and especially not its posture with respect to adopting new technologies.

In your particular case: it’s likely possible to use one of the bundler tools to generate an AMD bundle of either just reveal, or reveal and your code: this is how the widget cookiecutter handles it with webpack. But you will “lose” some of the side-effects of old-style window-level globals… and will almost certainly break any downstream extensions that relied on the previous behavior.

Thanks for the feedback

To be clear, I do not anticipate any lasting change; all I need for now is a means to hack the loader so I can assess the damage of moving to reveal-4.3; in the perspective of moving to reveal-4.3 in the context of jlab, but as a way to split the problem into 2 primariliy orthogonal directions (I mean: upgrade of reveal and move to jlab)