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

[material-ui] Add new Next.js integration package #39947

Merged
merged 39 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
59c2e07
Add next.js as a dependency
siriwatknp Nov 21, 2023
8a13561
add appRouter and pagesRouter
siriwatknp Nov 21, 2023
261032a
switch folder to nextjs13
siriwatknp Nov 22, 2023
c1d34cb
update appRouter
siriwatknp Nov 22, 2023
28a5345
move files to separate package
siriwatknp Nov 23, 2023
968c577
Revert "Add next.js as a dependency"
siriwatknp Nov 23, 2023
29ffa24
adopt in mui docs
siriwatknp Nov 23, 2023
ae6c266
mark emotion server and cache as optional
siriwatknp Nov 23, 2023
a7a43a3
add document
siriwatknp Nov 23, 2023
c089f60
update docs
siriwatknp Nov 23, 2023
113f142
fix build
siriwatknp Nov 23, 2023
672785a
run docs:i18n
siriwatknp Nov 23, 2023
1f22c56
update material ui nextjs alias
siriwatknp Nov 23, 2023
bf26d99
add material ui nextjs to codesandbox build
siriwatknp Nov 23, 2023
c8f4c39
fix markdown lint
siriwatknp Nov 23, 2023
30ce24e
rename folders to use nextjs version at the beginning
siriwatknp Nov 23, 2023
cb20154
update docs
siriwatknp Nov 24, 2023
1f26cd1
Merge branch 'master' of https://github.com/mui/material-ui into feat…
siriwatknp Nov 27, 2023
ce51139
add DocumentHeadTags
siriwatknp Nov 27, 2023
2fc39bb
update docs
siriwatknp Nov 28, 2023
4dfcc6a
Merge branch 'master' of https://github.com/mui/material-ui into feat…
siriwatknp Nov 28, 2023
5c39893
Merge branch 'master' of https://github.com/mui/material-ui into feat…
siriwatknp Nov 30, 2023
bcfb7d8
update yarn.lock
siriwatknp Nov 30, 2023
13db137
fix as suggested
siriwatknp Nov 30, 2023
233e4d5
redirect old page to the new one
siriwatknp Dec 1, 2023
25a370b
Merge branch 'master' of https://github.com/mui/material-ui into feat…
siriwatknp Dec 1, 2023
e2a479f
run docs:i18n
siriwatknp Dec 1, 2023
e67d68a
Apply suggestions from code review
siriwatknp Dec 4, 2023
374e5b4
Merge branch 'master' of https://github.com/mui/material-ui into feat…
siriwatknp Dec 4, 2023
2a110c7
reexport v14 using v13
siriwatknp Dec 4, 2023
2052bc2
add v14 comment
siriwatknp Dec 4, 2023
0ebe960
Apply suggestions from code review
siriwatknp Dec 6, 2023
f943604
quick writing edits
danilo-leal Dec 6, 2023
f4858d5
Merge branch 'master' into feat/nextjs-integration
siriwatknp Dec 7, 2023
d72e882
Merge branch 'master' of https://github.com/mui/material-ui into feat…
siriwatknp Dec 11, 2023
2c8e2a9
revert yarn.lock
siriwatknp Dec 11, 2023
3ebef69
fix material-nextjs package.json
siriwatknp Dec 11, 2023
dc1c3b6
replace tslint with tsc
siriwatknp Dec 11, 2023
b63e72a
try with node script
siriwatknp Dec 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
  • Loading branch information
siriwatknp and mnajdova authored Dec 4, 2023
commit e67d68a2ee743cc1e33f463a083f6ffbb9282bc9
3 changes: 1 addition & 2 deletions docs/data/material/guides/nextjs/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you are using a styling solution other than Emotion to customize Material UI
<AppRouterCacheProvider options={{ enableCssLayer: true }}>
```

The styles generated by Material UI will be wrapped in a CSS `@layer mui` rule, which will be overriden by anonymous layer styles—for example if you are customizing Material UI with CSS modules, Tailwind CSS, or even plain CSS without using `@layer`.
This option ensures that the styles generated by Material UI will be wrapped in a CSS `@layer mui` rule, which will be overridden by anonymous layer styles—for example, if you are customizing Material UI with CSS modules, Tailwind CSS, or even plain CSS without using `@layer`.

To learn more about the CSS layer, see the [MDN CSS layer documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer).

Expand Down Expand Up @@ -118,7 +118,6 @@ Then inside `pages/_app.tsx`, import the `AppCacheProvider` and render it as the
+ import { AppCacheProvider } from '@mui/material-nextjs/pagesRouterV13';

export default function MyApp(props) {
const { Component } = props;
return (
+ <AppCacheProvider {...props}>
<Head>
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.14.18",
"private": false,
"author": "MUI Team",
"description": "A tiny wrapper for Material UI integration with Next.js.",
"description": "Collection of utilities for integration between Material UI and Next.js.",
"keywords": [
"react",
"react-component",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
import type { EmotionCache, Options as OptionsOfCreateCache } from '@emotion/cache';

export type AppRouterCacheProviderProps = {
/** This is the options passed to createCache() from 'import createCache from "@emotion/cache"' */
/** These are the options passed to createCache() from 'import createCache from "@emotion/cache"' */
options?: Partial<OptionsOfCreateCache> & {
/**
* If `true`, the generated styles are wrapped within `@layer mui`.
* This is useful if you want to
* This is useful if you want to override the Material UI's generated styles with different styling solution, like Tailwind, plain CSS etc.
*/
enableCssLayer?: boolean;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ interface Plugin {

/**
* A utility to compose multiple `getInitialProps` functions.
* The example usage is the mui docs site that contains `styled-components` and `jss`.
*/
export function createGetInitialProps(plugins: Plugin[]) {
return async function getInitialProps(ctx: DocumentContext) {
Expand Down