next.js
7307d625 - Ignore serverComponentChanges in pages (#66312)

Commit
1 year ago
Ignore serverComponentChanges in pages (#66312) ## Description I discovered a bug related to the coexistence of the app router and pages router in our application. When a page is being served by the pages router, any changes to server components (in this case, `globals.css` imported from `app/layout.tsx`) cause the entire page to reload, significantly lowering productivity. I believe this is not the intended behavior since server component changes should have no impact on pages served by the pages router. ## Investigation I traced the changes and found that: - At the point of this PR (https://github.com/vercel/next.js/pull/41464), the process seems to be handling this correctly. - Later, in this PR (https://github.com/vercel/next.js/pull/45268), it started causing reloads, seemingly intended for the app router but inadvertently affecting the pages router as well. Given that separate `hot-reloader-client.ts` files are now being used for the app router and pages router, it is now possible to correctly branch the hot-reloading process. I have tested this change locally and it is working fine.
Author
Parents
Loading