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

Add InitColorSchemeScript for Next.js App Router #42247

Open
wants to merge 11 commits into
base: next
Choose a base branch
from

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented May 15, 2024

closes #38913


@siriwatknp siriwatknp changed the title [POC] add InitColorSchemeScript for Next.js App Router [POC] Add InitColorSchemeScript for Next.js App Router May 15, 2024
@siriwatknp siriwatknp added the proof of concept Studying and/or experimenting with a to be validated approach label May 15, 2024
@mui-bot
Copy link

mui-bot commented May 15, 2024

Netlify deploy preview

InitColorSchemeScript: parsed: +Infinity% , gzip: +Infinity%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 9582d24

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 27, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 10, 2024
@siriwatknp siriwatknp changed the title [POC] Add InitColorSchemeScript for Next.js App Router Add InitColorSchemeScript for Next.js App Router Jun 10, 2024
@siriwatknp siriwatknp marked this pull request as ready for review June 10, 2024 09:57
@siriwatknp siriwatknp added package: material-ui Specific to @mui/material enhancement This is not a bug, nor a new feature nextjs package: system Specific to @mui/system and removed proof of concept Studying and/or experimenting with a to be validated approach labels Jun 10, 2024
@zannager zannager requested a review from brijeshb42 June 10, 2024 11:38
Comment on lines +61 to +62
suppressHydrationWarning
nonce={typeof window === 'undefined' ? nonce : ''}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export { useColorScheme, getInitColorSchemeScript, CssVarsProvider, Experimental_CssVarsProvider };
export {
useColorScheme,
getInitColorSchemeScript,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we deprecate getInitColorSchemeScript? Or do we expect users to still use it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think it can be removed but I'd do it in a separate PR and add note to the migration doc in the same PR.

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's remember to deprecate/remove getInitColorSchemeScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature nextjs package: material-ui Specific to @mui/material package: system Specific to @mui/system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[system] Add nonce to CssVarsProvider and getInitColorSchemeScript() for CSP
3 participants