webcomponents / webcomponentsjs

A suite of polyfills supporting the HTML Web Components specs
http://webcomponents.org/polyfills/
Other
3.87k stars 490 forks source link

Firefox nightly needs webcomponentsjs/webcomponents-hi-sd.js #817

Closed sdwlig closed 6 years ago

sdwlig commented 7 years ago

Firefox nightly apparently now satisfies Custom Elements v1, so the loader gets a 404 looking for: webcomponentsjs/webcomponents-hi-sd.js

justinfagnani commented 7 years ago

We need to verify it's a working implementation, but... awesome news!

justinfagnani commented 7 years ago

I'm seeing that window.customElement is undefined. Did you turn on a flag?

sdwlig commented 7 years ago

I just found that I did turn it on in an earlier debugging session. I'm not sure that it is working well enough, and have turned it off again for now. Not sure whether webcomponentsjs can verify if it is all there or not. In any case, generating a 404 is probably not the best response in this situation. I copied webcomponents-hi-sd-ce.js to webcomponents-hi-sd.js, but this didn't seem to actually work. Either Firefox nightly doesn't have a working custom elements implementation or the polyfill doesn't work with it enabled. Our now-ported-to-Polymer 2.0 code works great in Chrome but is broken again in Firefox / Firefox nightly. Earlier in our port, I found that I had a sequence assumption, now fixed.

bennypowers commented 6 years ago

Nightly now ships with dom.webcomponents.customelements.enabled which is causing breakage along these lines. disabling that flag, my element demo loads.

web-padawan commented 6 years ago

See also #874(comment), this is prototyped in b5af6a7

dfreedm commented 6 years ago

After some testing, Firefox Nightly is less than ready to go for native Custom Elements. Upgrades seem to be in a funky order due to https://bugzilla.mozilla.org/show_bug.cgi?id=1326028. Elements that were parsed in the main page may upgrade before elements created dynamically, instead of a strict document ordering as required in the spec.

That said, I'll still merge the PR, but please be aware that your apps may not work correctly until they push Custom Elements to stable.

bennypowers commented 6 years ago

FYI The bug @azakus linked to is resolved and customElements have landed in 59 stable. I was able to run a simple app composed from LitElements by enabling the customElements, shadowDom, and moduleScripts flags in plain old Firefox 59, with just the HTML imports polyfill for a few simple polymer2 elements. I wasn't able to get ShadyCSS working though, so polymer1/2-era elements that use @apply did not render properly.

Try it yourself: https://mws.bennypowers.com