griffel
griffel copied to clipboard
core: `DEFINITION_LOOKUP_TABLE` causes issues when multiple versions of @griffel/core are present
DEFINITION_LOOKUP_TABLE is a singleton used by mergeClasses() to merge classes sequences deterministically. The problem comes when there are multiple versions of @griffel/core that use different by reference DEFINITION_LOOKUP_TABLE constants.
It's more or less the same problem that React has with .createContext() calls (see https://github.com/facebook/react/issues/13346).
Repro on Stackblitz: https://stackblitz.com/edit/node-zerdgf?file=index.js
Reported by partners (multiple versions of griffel in a bundle). The current idea is to have the DLT on window.
Reported by partners (multiple versions of griffel in a bundle). The current idea is to have the DLT on
window.
If using window to avoid singleton problem, wouldn't there be some issues when using SSR?
Reported by partners (multiple versions of griffel in a bundle). The current idea is to have the DLT on
window.If using
windowto avoid singleton problem, wouldn't there be some issues when using SSR?
In SSR we will use global or will find another approach. We don't plan to regress in SSR support.