Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: DEFINITION_LOOKUP_TABLE causes issues when multiple versions of @griffel/core are present #159

Closed
layershifter opened this issue Jul 11, 2022 · 3 comments · Fixed by #290
Assignees
Labels
💅 enhancement New feature or request

Comments

@layershifter
Copy link
Member

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 facebook/react#13346).

Repro on Stackblitz: https://stackblitz.com/edit/node-zerdgf?file=index.js

@layershifter layershifter added the 💅 enhancement New feature or request label Jul 11, 2022
@layershifter layershifter self-assigned this Jul 12, 2022
@layershifter layershifter changed the title DEFINITION_LOOKUP_TABLE causes issues when multiple versions of @griffel/core are present core: DEFINITION_LOOKUP_TABLE causes issues when multiple versions of @griffel/core are present Jul 22, 2022
@miroslavstastny
Copy link
Member

Reported by partners (multiple versions of griffel in a bundle). The current idea is to have the DLT on window.

@changyoungoh
Copy link

changyoungoh commented Aug 17, 2022

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?

@layershifter
Copy link
Member Author

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?

In SSR we will use global or will find another approach. We don't plan to regress in SSR support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💅 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants