Skip to content

[internal] Fix scroll restoration in the docs#34037

Merged
oliviertassinari merged 2 commits intomui:masterfrom
oliviertassinari:docs-fix-scroll-restoration
Aug 23, 2022
Merged

[internal] Fix scroll restoration in the docs#34037
oliviertassinari merged 2 commits intomui:masterfrom
oliviertassinari:docs-fix-scroll-restoration

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 type: bug It doesn't behave as expected. internal Behind-the-scenes enhancement. Formerly called “core”. type: regression A bug, but worse, it used to behave as expected. labels Aug 22, 2022
@oliviertassinari oliviertassinari requested review from a team and mnajdova August 22, 2022 15:19
ThemeProvider as MuiThemeProvider,
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.

<Stack direction="row" spacing={2}>
<Chip label="React" color="primary" onDelete={() => {}} />
<Chip label="Javascript" onDelete={() => {}} />
<Chip label="JavaScript" onDelete={() => {}} />
Copy link
Member Author

@oliviertassinari oliviertassinari Aug 22, 2022

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

@oliviertassinari oliviertassinari force-pushed the docs-fix-scroll-restoration branch from 7a47cc5 to 153b2d1 Compare August 22, 2022 15:24

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
@oliviertassinari oliviertassinari removed the type: bug It doesn't behave as expected. label Apr 30, 2025
@oliviertassinari oliviertassinari changed the title [core] Fix scroll restoration in the docs [internal] Fix scroll restoration in the docs Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. internal Behind-the-scenes enhancement. Formerly called “core”. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants