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

[core] Init the next branch #41552

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@

<!-- #default-branch-switch -->

3. Synchronize your local `master` branch with the upstream one:
3. Synchronize your local `next` branch with the upstream one:

```bash
git checkout master
git pull upstream master
git checkout next
git pull upstream next
```

4. Install the dependencies with pnpm (yarn or npm aren't supported):
Expand Down Expand Up @@ -146,7 +146,7 @@

<!-- #default-branch-switch -->

- The branch is targeted at `master` for ongoing development. All tests are passing. Code that lands in `master` must be compatible with the latest stable release. It may contain additional features but no breaking changes. We should be able to release a new minor version from the tip of `master` at any time.
- The branch is targeted at `next` for ongoing development. All tests are passing. Code that lands in `next` must be compatible with the latest alpha/beta release. It may contain additional features but no breaking changes. We should be able to release a new minor version from the tip of `next` at any time.

Check warning on line 149 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'We'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'We'.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 149, "column": 225}}}, "severity": "WARNING"}
- If a feature is being added:
- If the result was already achievable with the core library, you've explained why this feature needs to be added to the core.
- If this is a common use case, you've added an example to the documentation.
Expand Down
4 changes: 2 additions & 2 deletions docs/data/material/getting-started/templates/blog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react, markdown-to-jsx.
3. Import and use the `Blog` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/blog/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/blog/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @emotion/styled, @emotion/react.
3. Import and use the `Checkout` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/checkout/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/checkout/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react, @mui/x-charts.
3. Import and use the `Dashboard` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/dashboard/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/dashboard/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `LandingPage` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/landing-page/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/landing-page/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `Pricing` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/pricing/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/pricing/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `SignInSide` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/sign-in-side/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/sign-in-side/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `SignIn` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/sign-in/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/sign-in/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `SignUp` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/sign-up/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/sign-up/.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @emotion/styled, @emotion/react.
3. Import and use the `StickyFooter` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/sticky-footer/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/sticky-footer/.
2 changes: 1 addition & 1 deletion docs/data/material/guides/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The [Data Grid and Data Grid Pro](/x/react-data-grid/) components have their own

<!-- #default-branch-switch -->

You can [find the source](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/locale/index.ts) in the GitHub repository.
You can [find the source](https://github.com/mui/material-ui/blob/next/packages/mui-material/src/locale/index.ts) in the GitHub repository.

To create your own translation, or to customize the English text, copy this file to your project, make any changes needed and import the locale from there.

Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/guides/typescript/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- #default-branch-switch -->

Material UI requires a minimum version of TypeScript 3.5. Have a look at the [Create React App with TypeScript](https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-ts) example.
Material UI requires a minimum version of TypeScript 3.5. Have a look at the [Create React App with TypeScript](https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-ts) example.

For types to work, it's recommended that you have at least the following options enabled in your `tsconfig.json`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ If, however, you would like to use styled-components, you can configure your app

<!-- #default-branch-switch -->

- [Create React App with styled-components](https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-styled-components)
- [Create React App with styled-components and TypeScript](https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-styled-components-ts)
- [Create React App with styled-components](https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-styled-components)
- [Create React App with styled-components and TypeScript](https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-styled-components-ts)

Following this approach reduces the bundle size, and removes the need to configure the CSS injection order.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ If you're using yarn, you can configure it using a package resolution:
```diff title="package.json"
{
"dependencies": {
- "@mui/styled-engine": "latest"
+ "@mui/styled-engine": "npm:@mui/styled-engine-sc@latest"
- "@mui/styled-engine": "next"
+ "@mui/styled-engine": "npm:@mui/styled-engine-sc@next"
},
+ "resolutions": {
+ "@mui/styled-engine": "npm:@mui/styled-engine-sc@latest"
+ "@mui/styled-engine": "npm:@mui/styled-engine-sc@next"
+ },
}
```
Expand Down Expand Up @@ -102,8 +102,8 @@ We provide boilerplate examples of Create React App with Material UI and styled

<!-- #default-branch-switch -->

- [Material UI + CRA + styled-components (JavaScript)](https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-styled-components)
- [Material UI + CRA + styled-components (TypeScript)](https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-styled-components-ts)
- [Material UI + CRA + styled-components (JavaScript)](https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-styled-components)
- [Material UI + CRA + styled-components (TypeScript)](https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-styled-components-ts)

:::warning
`@emotion/react`, `@emotion/styled`, and `styled-components` are optional peer dependencies of `@mui/material`, so you need to install them yourself.
Expand Down
4 changes: 0 additions & 4 deletions docs/data/styles/advanced/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,12 @@ It's a must-do for static pages, but it needs to be put in balance with not doin
There is [an official Gatsby plugin](https://github.com/hupe1980/gatsby-plugin-material-ui) that enables server-side rendering for `@mui/styles`.
Refer to the plugin's page for setup and usage instructions.

<!-- #default-branch-switch -->

Refer to [this example Gatsby project](https://github.com/mui/material-ui/tree/v4.x/examples/gatsby) for an usage example.

### Next.js Pages Router

You need to have a custom `pages/_document.js`, then copy [this logic](https://github.com/mui/material-ui/blob/v4.x/examples/nextjs/pages/_document.js#L52-L59) to inject the server-side rendered styles into the `<head>` element.

<!-- #default-branch-switch -->

Refer to [this example project](https://github.com/mui/material-ui/tree/v4.x/examples/nextjs) for an up-to-date usage example.

## Class names
Expand Down
2 changes: 1 addition & 1 deletion docs/data/system/getting-started/usage/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Runtime performance takes a hit.

<!-- #default-branch-switch -->

Visit the [benchmark folder](https://github.com/mui/material-ui/tree/master/benchmark/browser) for a reproduction of the metrics above.
Visit the [benchmark folder](https://github.com/mui/material-ui/tree/next/benchmark/browser) for a reproduction of the metrics above.

We believe that for most use cases it's fast enough, but there are simple workarounds when performance becomes critical.
For instance, when rendering a list with many items, you can use a CSS child selector to have a single "style injection" point (using d. for the wrapper and a. for each item).
Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default withDocsInfra({
// docs-infra
LIB_VERSION: pkg.version,
SOURCE_CODE_REPO: 'https://github.com/mui/material-ui',
SOURCE_GITHUB_BRANCH: 'master', // #default-branch-switch
SOURCE_GITHUB_BRANCH: 'next', // #default-branch-switch
GITHUB_TEMPLATE_DOCS_FEEDBACK: '4.docs-feedback.yml',
BUILD_ONLY_ENGLISH_LOCALE: String(buildOnlyEnglishLocale),
// MUI Core related
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:clean": "rimraf .next && pnpm build",
"build-sw": "node ./scripts/buildServiceWorker.js",
"dev": "next dev",
"deploy": "git push -f material-ui-docs master:latest",
"deploy": "git push -f material-ui-docs next:next",
"icons": "rimraf --glob public/static/icons/* && node ./scripts/buildIcons.js",
"start": "next start",
"create-playground": "cpy --cwd=scripts playground.template.tsx ../../pages/playground --rename=index.tsx",
Expand Down
32 changes: 16 additions & 16 deletions docs/src/modules/components/MaterialUIExampleCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,78 +13,78 @@ const examples = [
name: 'Next.js App Router',
label: 'View JS example',
tsLabel: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs',
tsLink: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-ts',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-nextjs',
tsLink: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-nextjs-ts',
src: '/static/images/examples/next.svg',
},
{
name: 'Vite.js',
label: 'View JS example',
tsLabel: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-vite',
tsLink: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-vite-ts',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-vite',
tsLink: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-vite-ts',
src: '/static/images/examples/vite.svg',
},
{
name: 'Next.js Pages Router',
label: 'View JS example',
tsLabel: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-pages-router',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-nextjs-pages-router',
tsLink:
'https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-pages-router-ts',
'https://github.com/mui/material-ui/tree/next/examples/material-ui-nextjs-pages-router-ts',
src: '/static/images/examples/next.svg',
},
{
name: 'Remix',
label: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-remix-ts',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-remix-ts',
src: '/static/images/examples/remix.svg',
},
{
name: 'Tailwind CSS + CRA',
label: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-tailwind-ts',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-tailwind-ts',
src: '/static/images/examples/tailwindcss.svg',
},
{
name: 'Create React App',
label: 'View JS example',
tsLabel: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-cra',
tsLink: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-ts',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-cra',
tsLink: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-ts',
src: '/static/images/examples/cra.svg',
},
{
name: 'styled-components',
label: 'View JS example',
tsLabel: 'View TS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-styled-components',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-styled-components',
tsLink:
'https://github.com/mui/material-ui/tree/master/examples/material-ui-cra-styled-components-ts',
'https://github.com/mui/material-ui/tree/next/examples/material-ui-cra-styled-components-ts',
src: '/static/images/examples/styled.png',
},
{
name: 'Preact',
label: 'View JS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-preact',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-preact',
src: '/static/images/examples/preact.svg',
},
{
name: 'CDN',
label: 'View JS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-via-cdn',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-via-cdn',
src: <CloudRoundedIcon />,
},
{
name: 'Express.js (server-rendered)',
label: 'View JS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-express-ssr',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-express-ssr',
src: '/static/images/examples/express.png',
},
{
name: 'Gatsby',
label: 'View JS example',
link: 'https://github.com/mui/material-ui/tree/master/examples/material-ui-gatsby',
link: 'https://github.com/mui/material-ui/tree/next/examples/material-ui-gatsby',
src: '/static/images/examples/gatsby.svg',
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/src/modules/sandbox/CodeSandbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('CodeSandbox', () => {
'https://github.com/mui/material-ui/blob/v5.7.0/docs/data/material/components/buttons/BasicButtons.js',
dependencies: {
react: 'latest',
'@mui/material': 'latest',
'@mui/material': 'next',
'react-dom': 'latest',
'@emotion/react': 'latest',
'@emotion/styled': 'latest',
Expand Down Expand Up @@ -123,7 +123,7 @@ ReactDOM.createRoot(document.querySelector("#root")).render(
'https://github.com/mui/material-ui/blob/v5.7.0/docs/data/material/components/buttons/BasicButtons.tsx',
dependencies: {
react: 'latest',
'@mui/material': 'latest',
'@mui/material': 'next',
'react-dom': 'latest',
'@emotion/react': 'latest',
'@emotion/styled': 'latest',
Expand Down Expand Up @@ -230,7 +230,7 @@ ReactDOM.createRoot(document.querySelector("#root")!).render(
expect(result.dependencies).to.deep.equal({
'@emotion/react': 'latest',
'@emotion/styled': 'latest',
'@mui/material': 'latest',
'@mui/material': 'next',
'@types/react': 'latest',
'@types/react-dom': 'latest',
react: 'latest',
Expand Down
Loading
Loading