-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
feat: migrate React.dev to the App Router #7437
feat: migrate React.dev to the App Router #7437
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size changes📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! One Page Changed SizeThe following page changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. |
@@ -1,18 +1,24 @@ | |||
'use client'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a server component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error page must be a client component https://nextjs.org/docs/app/api-reference/file-conventions/error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sick thanks!
Noticed a significant UX regression. Previously the sidebar would animate and preserve scroll position on click: Screen.Recording.2025-02-01.at.18.57.07.movNow it doesn't: Screen.Recording.2025-02-01.at.18.57.37.movThe lack of animation is maybe tolerable but the jumping is not tolerable — it immediately makes the site feel unpolished. We specifically took care for it not to jump in the previous implementation. IMO this has to either be a fast-follow fix or a revert until App Router can handle this (if App Router doesn't let us preserve scroll position easily there). I assume this has to be fixable? Is this what the parallel route refactor will do? |
Links to specific example tabs are broken. For example: https://react-gu30t1oio-fbopensource.vercel.app/reference/react/useState#passing-the-initial-state-directly This works on the old site. On the new site, https://react.dev/reference/react/useState#passing-the-next-state-directly still displays the first tab. |
After navigating to a fragment link and then to another page, the Back button gets completely borked: back.mov |
I suggest reverting at least until the navigation bugs are fixed since they interfere with people using the site. |
Also, have we done a webpagetest comparison for the index page and for a few docs pages? Is this neutral or an improvement? Seems like it would be bad to land without verifying that it hasn't regressed on perf. |
(Sorry to be annoying btw! Really appreciate your work there. I think this is close but just needs a bit of polish so that it doesn’t regress the functionality.) |
No problem at all, there was some transformed code that I was not sure where they exactly applied. @rickhanlonii lets revert it and I can dig deeper. @gaearon if you have some other specific scenarios I can verify, please let me know 🙏 |
I was mostly just stress-testing navigation (all kinds — via sidebar, via footer links, normal links, fragment and example and TOC links) and jumping back and forth using Back/Forward. |
What
This PR converts all of the react.dev codebase to use the App Router.
Why
I wanted to prepare it for dogfooding future features of React and Next.js.
In this PR
Not in this PR
Todo