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. #196

Closed theengineear closed 3 weeks ago

theengineear commented 3 weeks ago

This is now baseline as of 2023 so we ought to be able to use it. We use symbols to prevent internal abstractions from being leaked into code authored by integrators — for that, we just need an opaque token. But, because weak maps previously needed to be keyed with an object, we just created a dummy object as our key.

Now, we can take the more modern approach of keying with a symbol.

Closes #192.

theengineear commented 3 weeks ago

@klebba — This one is pretty minor. Just wanted to keep you in the loop. Let me know if you have any questions on it!