Repository navigation
Conversation
…hemes
All three apps pin forcedTheme="dark" and nothing in them calls
useTheme, so ThemeProvider's only output was the inline <script> it
injects to set the class before paint — which React 19.2 / Next 16 now
flags on every client render of Providers ("Encountered a script tag
while rendering React component"; next-themes #385/#387/#397, no
release since 0.4.6). Set the dark class and color-scheme on <html>
directly, pass theme="dark" to the shared Toaster (its useTheme
fallback would otherwise follow the OS), and drop the dependency from
the three apps. @superset/ui keeps next-themes for sonner.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe admin, marketing, and web apps remove ChangesDark mode migration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change statically enforces dark mode and removes the affected theme-provider dependency across three apps; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
|
This PR has had no activity for 53 days and will close in 7 days unless there is new activity. If this contribution is still important or relevant, please leave a comment to keep it open. If it closes, you are welcome to reopen it or ask a maintainer to reopen it. Thank you for contributing! |
Why
Next 16.2 / React 19.2 dev console error on every page of web/admin/marketing:
Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client.— raised fromProviders→ThemeProvider.next-themes injects an inline
<script>to apply the theme before paint; React 19.2 now flags that whenever the provider renders on the client. Upstream bugs pacocoursey/next-themes#385 #387 #397 are open with no release since 0.4.6, so there is nothing to bump to.What
All three apps pin
forcedTheme="dark"and nothing in them callsuseTheme, so the provider was dead weight whose only output was the offending script.<html className="dark" style={{ colorScheme: "dark" }}>in web + admin (marketing already had the class; gains color-scheme parity),suppressHydrationWarningdropped where it only existed for next-themes' client-side attribute mutation.<Toaster theme="dark" />in web + admin — the shared@superset/uiToaster'suseTheme()fallback issystem, which would otherwise follow the OS on a forced-dark app.next-themesremoved from the three apps'package.json(@superset/uikeeps it for sonner).Verified
tsc --noEmitclean in apps/web, apps/admin, apps/marketing;scripts/lint.shclean.Summary by cubic
Forces dark mode statically across
apps/web,apps/admin, andapps/marketing, removingnext-themesto eliminate the React 19.2/Next 16.2 console error from the provider’s inline script. Old:ThemeProviderwithforcedTheme="dark"; new:<html className="dark" style={{ colorScheme: 'dark' }}>andtheme="dark"on the sharedToaster, with no UI changes besides consistent dark toasts and no hydration warnings.<html className="dark" style={{ colorScheme: "dark" }}>in web/admin; marketing keepsdarkand addscolorScheme: "dark". RemovedsuppressHydrationWarningwhere it only servednext-themes.ThemeProviderand relatedTHEME_STORAGE_KEYusage; passedtheme="dark"to@superset/uiToasterin web/admin.next-themesfrom apppackage.json;@superset/uiretains it for sonner.useThemeusage in these apps and that only@superset/uidepends onnext-themes. No migrations required.Written for commit dadc6b0. Summary will update on new commits.
Summary by CodeRabbit
Style
Refactor