webcomponents.org icon indicating copy to clipboard operation
webcomponents.org copied to clipboard

NPM demos are broken

Open samuelli opened this issue 7 years ago • 10 comments

samuelli avatar Mar 27 '18 23:03 samuelli

Ping. Is there any status on this @samuelli ?

arthurevans avatar Apr 27 '18 20:04 arthurevans

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 avatar May 14 '18 19:05 justinfagnani

@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.

samuelli avatar May 15 '18 04:05 samuelli

@justinfagnani Small correction: unpkg.org is actually a spam site. Always be sure to use unpkg.com instead :) Carry on!

mjackson avatar May 16 '18 04:05 mjackson

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 avatar May 17 '18 22:05 mjackson

@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.

justinfagnani avatar May 18 '18 00:05 justinfagnani

Hmm, I hadn't thought about that. That sounds like a really cool idea :) We should definitely do that!

mjackson avatar May 18 '18 00:05 mjackson

What is the current recommendation to get demo's working for NPM elements? Either temporarily or permanently?

jsilvermist avatar Jun 21 '18 17:06 jsilvermist

@jsilvermist so far people try to generate builds to serve them off github pages as this seems to be currently unresolved.

ergo avatar Jul 12 '18 17:07 ergo

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.

samuelli avatar Jul 12 '18 17:07 samuelli