I'm trying to add a pn.pane.WebComponent to Panel here https://github.com/holoviz/panel/issues/1120
I can see that often the user or developer of a component needs to import the js dependencies as modules as below
<script type="module" src="https://unpkg.com/[email protected]/lib/wired-slider.js?module"></script>
Please note that module is in two places. It won't work without it. You will get errors in the browser console.
Extend pn.config.js_files or add pn.config.js_module_files functionality to support this use case.
I don't understand you request.
If you do
pn.extension(js_files = {"wired_slider": "https://unpkg.com/[email protected]/lib/wired-slider.js?module"}
It should already work
Ok I understand now the type "module" is important
Ok I understand know the type "module" is important
Without it you won't be able to import it from the component and it would be just a global pile of JS and not an isolated module.
@mattpap the modification should be at bokeh level in Ressource class?
the modification should be at bokeh level in Ressource class?
We will definitively add support for modules to bokeh, but that will likely happen on top of PR https://github.com/bokeh/bokeh/pull/9614 and it would be useful to positively resolve issue https://github.com/bokeh/bokeh/issues/9731 by then. Though in the meantime panel could add intermediate support on its own. However, it's still preferred to bundle modules together, because of issues with interoperability between dependencies using different module systems, degradation of performance with many modules (especially without HTTP/2 being used) and support for legacy browsers which don't allow modules at all.
Thanks.
My understanding of this stuff is limited though. I鈥檓 just trying to get it to Work.
the modification should be at bokeh level in Ressource class?
We will definitively add support for modules to bokeh, but that will likely happen on top of PR bokeh/bokeh#9614 and it would be useful to positively resolve issue bokeh/bokeh#9731 by then. Though in the meantime panel could add intermediate support on its own. However, it's still preferred to bundle modules together, because of issues with interoperability between dependencies using different module systems, degradation of performance with many modules (especially without HTTP/2 being used) and support for legacy browsers which don't allow modules at all.
Hi @mattpap . I have also read those things but never experienced them. But I guess its because my use cases are relatively simple.
But I think there are two extreme uses case to support and then all the cases in between.
The above is something I believe ... not know for sure.