Re: The JavaScript context of a custom element

Aren't ES6 modules is a good-enough solution for this issue? They make
global collision rare and likely to be what the author really needed.

jjb


On Mon, May 20, 2013 at 1:00 PM, Aaron Boodman <aa@google.com> wrote:

> Hello public-webapps,
>
> I have been following along with web components, and am really excited
> about the potential.
>
> However, I just realized that unlike the DOM and CSS, there is no real
> isolation for JavaScript in a custom element. In particular, the global
> scope is shared.
>
> This seems really unfortunate to me, and limits the ability of element
> authors to create robustly reusable components.
>
> I would like to suggest that custom elements have the ability to ask for a
> separate global scope for their JavaScript. This would be analogous to what
> happens today when you have multiple script-connected frames on the same
> origin.
>
> Has there been any thought along these lines in the past?
>
> Thanks,
>
> - a
>

Received on Monday, 20 May 2013 20:27:18 UTC