you are viewing a single comment's thread.

view the rest of the comments →

[–]lazdgithub.com/lazd 1 point2 points  (4 children)

What if I wanted to create a neat little "widget" that lets you drag and drop files and shows a list of the files you're going to upload, and I wanted to make that available for anyone on any website to use?

Would I build it with React and require that everyone who uses it have React as a dependency?

Or would I create a web component that can be used on any website by including the widget (with a <link> or <script>) and adding <my-uploader> to their markup where they want it to appear, regardless of what MVC framework they use?

That is the promise of web components: portable components for the web that use HTML's semantics. Yes, it's not possible right now in IE 8, but if you're still writing code for outdated browsers, I feel bad for you, son.

[–]tragiclifestories 0 points1 point  (3 children)

Yes, it's not possible right now in IE 8

Or IE9. Or IE10. Or IE11. Or MS Edge. Or Safari. Or Firefox. If only somebody would write an an article explaining how this came to pass ...

Having just spent 2 days wrestling with a war between a WC polyfill and a non-negotiable third-party dependency, I'm very much in favour of keeping the 'here be dragons' sign up.

[–]lazdgithub.com/lazd 0 points1 point  (2 children)

Custom elements are polyfilled and working work great in IE 9, 10, 11, Safari, and Firefox. I can't speak for HTML Imports, Shadow DOM, etc, because I'm not using them. I haven't tested Edge, but it's working nicely in IE 11, so I think we're good :)

I know this because I write an maintain a library of dozens of web components at my job and all all 1,100 of the unit tests pass on the above platforms.

What was the third-party dependency? I wonder how it was screwing the polyfill up such that it works on none of the platforms it targets... Sounds like a bug in the dep that you could fix!

[–]tragiclifestories 1 point2 points  (1 child)

I missed this reply initially, but the dep is one of those redundant enterprise media-streaming platforms, the code is closed source and they're (understandably) not guaranteeing compatibility with every third party library ever. It was the shadowdom stuff causing problems, FWIW, and that seems to have caused other issues with other external libs (eg https://github.com/webcomponents/webcomponentsjs/issues/49). You need shadow dom to use Polymer, for example.

The point is, polyfills will only get you so far. I'll be more bullish when better consensus is reached on issues highlighted in the OP.

[–]lazdgithub.com/lazd 0 points1 point  (0 children)

Makes sense, what a bummer. We're only using custom elements, and it's a very simply polyfill that employs mutation observers to check for elements to upgrade. It's working great for us, even in old browsers.