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] Fix scroll restoration in the docs #34037

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Aug 22, 2022

Fix #33196 (comment) using vercel/next.js#37893 (comment)

Before: http://mui.com/
After: https://deploy-preview-34037--material-ui.netlify.app/


I have also made a change so that MUI X and MUI Toolpad can do:

diff --git a/docs/next.config.js b/docs/next.config.js
index 3467a20a..e99f6bb1 100644
--- a/docs/next.config.js
+++ b/docs/next.config.js
@@ -1,4 +1,5 @@
 const path = require('path');
+const nextConfig = require('@mui/monorepo/docs/next.config');
 const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
 // const withTM = require('next-transpile-modules')(['@mui/monorepo']);
 const pkg = require('../package.json');
@@ -27,15 +28,9 @@ if (reactStrictMode) {
 const isDeployment = process.env.NETLIFY === 'true';

 module.exports = {
-  eslint: {
-    ignoreDuringBuilds: true,
-  },
+  ...nextConfig.baseline,
   // Avoid conflicts with the other Next.js apps hosted under https://mui.com/
   assetPrefix: isDeployment ? '/x' : undefined,
-  typescript: {
-    // Motivated by https://github.com/zeit/next.js/issues/7687
-    ignoreBuildErrors: true,
-  },
   env: {
     COMMIT_REF: process.env.COMMIT_REF,
     CONTEXT: process.env.CONTEXT,
@@ -108,7 +103,6 @@ module.exports = {
       },
     };
   },
-  trailingSlash: true,
   // Next.js provides a `defaultPathMap` argument, we could simplify the logic.
   // However, we don't in order to prevent any regression in the `findPages()` method.
   exportPathMap: () => {

They should get this bug fix for free, not have to apply it again.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work core Infrastructure work going on behind the scenes regression A bug, but worse labels Aug 22, 2022
@oliviertassinari oliviertassinari requested review from mnajdova and a team August 22, 2022 15:19
createTheme as createLegacyModeTheme,
unstable_createMuiStrictModeTheme as createStrictModeTheme,
createTheme,
Copy link
Member Author

Choose a reason for hiding this comment

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

The same module is exported under these two names since v5.

@@ -89,7 +89,7 @@ export default function ThemeChip() {
<ThemeProvider theme={theme}>
<Stack direction="row" spacing={2}>
<Chip label="React" color="primary" onDelete={() => {}} />
<Chip label="Javascript" onDelete={() => {}} />
<Chip label="JavaScript" onDelete={() => {}} />
Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2022-08-22 at 17 21 00

Typo, on the homepage, above the fold

@mui-bot
Copy link

mui-bot commented Aug 22, 2022

No bundle size changes

Generated by 🚫 dangerJS against 153b2d1


module.exports = {
...baseline,
baseline, // Exported so the other projects can use this configuration directly.
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

Not very familiar with these portions of the architecture, but it look good to me

@oliviertassinari oliviertassinari merged commit 1c9b514 into mui:master Aug 23, 2022
@oliviertassinari oliviertassinari deleted the docs-fix-scroll-restoration branch August 23, 2022 10:03
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Aug 28, 2022
@oliviertassinari oliviertassinari changed the title [core] Fix scroll restoration [core] Fix scroll restoration in the docs Aug 28, 2022
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work core Infrastructure work going on behind the scenes docs Improvements or additions to the documentation regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants