Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Probably need to discuss how to isolate the component's Javascript.

Web component's JavaScript exists in the global scope so it can overwrite and be overwritten by scripts external to the component.

This is actually a major issue in my opinion. You can isolate your code to some extent using an IIFE but if you want to include 3rd party libraries that quickly becomes very hard to do. 3rd party libraries will also often directly modify the window object making any isolation attempts ineffective.



Pretty sure ES6 addresses this by isolating all vendor libraries to the level of the module where they're imported. SystemJS[0] emulates this behavior with relatively few caveats.

[0] https://github.com/systemjs/systemjs/wiki/Module-Format-Supp...


The module tag is not es6, not even worked on by the same standards body. Futhermore, while there is consensus that a module tag would be nice, no one is actively working on it. So don't depend on it in this context.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: