Netflix / x-element

A dead simple starting point for custom elements.
Apache License 2.0
29 stars 12 forks source link

Use non-registered symbols as weak map keys. #192

Closed theengineear closed 3 weeks ago

theengineear commented 4 weeks ago

The proposal to allow non-registered symbols (e.g., Symbol('foo')) as keys for weak maps was accepted for 2023. Seems sensible to pivot over to using something like Symbol('__result__') for the opaque references we pass back from our internal template engine.

Currently, x-element creates a new null object (Object.create(null)), which feels dated now that symbols can be used 👌

theengineear commented 4 days ago

See bug for FF — https://bugzilla.mozilla.org/show_bug.cgi?id=1710433