-
Notifications
You must be signed in to change notification settings - Fork 440
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
fix: improve color scheme store perf #8059
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Dec 16, 2024 10:18 PM (UTC) ❌ Failed Tests (2) -- expand for details
|
⚡️ Editor Performance ReportUpdated Mon, 16 Dec 2024 22:21:12 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
9d075f4
to
f5cd7df
Compare
cd523c2
to
558cd7a
Compare
/** @internal */ | ||
export const LOCAL_STORAGE_KEY = 'sanityStudio:ui:colorScheme' | ||
|
||
let snapshot: StudioThemeColorSchemeKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React Compiler doesn't like writing to ESM bindings like this one, during render.
That's fine, we can move it into a separate file like this and the compiler no longer complains, as it's out of scope :)
558cd7a
to
04c87f4
Compare
Description
This refactor is mostly about making the React Compiler support optimizing the
ColorSchemeProvider
component, so it can be excluded from Million Lint reports and not show up as false positives (as it re-renders only when the color scheme is changed manually, which is rare).What to review
Does it make sense?
Testing
Tested manually, unsure if our E2E suite checks color scheme switching 🤔
Notes for release
N/A perf improvement too small to be worth calling out