webcomponents.org
webcomponents.org copied to clipboard
NPM demos are broken
Ping. Is there any status on this @samuelli ?
Looks like unpkg.org is open to serving .html with the correct mime type so that we can load demos directly in iframes. See https://github.com/unpkg/unpkg/issues/94#issuecomment-388930851
@justinfagnani: that seems helpful! There's still a few remaining issues which I'm not sure how to tackle:
- presumably demos are also written with bare module specifiers and need to be transformed at some point
- we'd still need to properly resolve dependencies for a given package and serve the correct unpkg link.
@justinfagnani Small correction: unpkg.org is actually a spam site. Always be sure to use unpkg.com instead :) Carry on!
Also, just FYI we are now serving HTML on unpkg.com. We will be adding the ability to do redirects very soon so it works more like a real server.
@mjackson awesome stuff, thanks for the quick turnaround!
One last bit might be needed though - do you propagate the ?module param from .html files into their <script type="module"> tags? We'd need that to really get demos working.
Hmm, I hadn't thought about that. That sounds like a really cool idea :) We should definitely do that!
What is the current recommendation to get demo's working for NPM elements? Either temporarily or permanently?
@jsilvermist so far people try to generate builds to serve them off github pages as this seems to be currently unresolved.
We're currently hoping for https://github.com/unpkg/unpkg.com/issues/113 to get fixed and we should be able to serve demos from unpkg.