cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

Use WeakMap #880

Open kof opened 6 years ago

kof commented 6 years ago

We are using in many cases some property directly on an object/function when we need to associate a value with that object. I think WeakMap support is good enough now that we can start using it and assume people will include a WeakMap polyfill for older browsers.

I think React is also using WeakMap.

Todo

HenriBeck commented 6 years ago

👍

HenriBeck commented 6 years ago

WeakMap can't be used inside plugin-syntax-rule-value-function because a WeakMap needs objects as keys.

kof commented 6 years ago

Function is an object, can be used as a key

HenriBeck commented 6 years ago

Ohh yeah, so the function would be the keys and the actual css prop name would be the value in the WeakMap

kof commented 5 years ago

@HenriBeck I think we can close this one, no?

HenriBeck commented 5 years ago

No, not yet, we haven't converted the function plugin to use it.