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

perf: fallback to module level registry in browser #768

Merged
merged 4 commits into from Dec 22, 2021

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Dec 20, 2021

Fallback to module level local registry on client side, so we don't have to include a registry there.
StyleRegistry is only required for server render for safe concurrent rendering

Use typeof window (instead of process.browser) for determine envrionment which we can optimize later on bundler side.

Tested with next.js styled-jsx example

x-ref: vercel/next.js#32417
x-ref: vercel/next.js#30377

src/style.js Outdated Show resolved Hide resolved
src/style.js Outdated Show resolved Hide resolved
@huozhi huozhi merged commit 3366cfd into vercel:beta Dec 22, 2021
@huozhi huozhi deleted the fallback-client-registry branch December 22, 2021 12:58
@github-actions
Copy link

🎉 This PR is included in version 5.0.0-beta.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

huozhi added a commit that referenced this pull request Jan 20, 2022
* perf: fallback to module level registry in browser

* preeval registry at top level

* use typeof for conditions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants