Allow importing from arbitrary npm packages for better demos
NullVoxPopuli opened this issue · 3 comments
I had wanted to use Limber for showcasing https://github.com/NullVoxPopuli/ember-statechart-component/, because the story here is really slick with template imports -- but xstate (and ember-statechart-component) are not included in the Limber build.
It'd be great if you could import from 'x'
and have x
added to your page at runtime, kinda like what https://runkit.com/ does for node packages
How this might look (but with gjs live
instead of just gjs
)
example:
this should be able to work: import { toBlob } from 'html-to-image'
Also, importing components from from the app should be doable as well
In case browsers don't support script[type=module] properly, or import maps: https://github.com/guybedford/es-module-shims
For re-writing imports in scripts without jscodeshift or silly regex: https://github.com/guybedford/es-module-lexer
Example of dynamic updating of the import-map: https://github.com/huozhi/devjar/blob/main/lib/module.js
Allowing service worker composition: https://mswjs.io/docs/recipes/merging-service-workers/