Migrate app from Webpack SPA to Next.js pages router#1
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
react/react-domas framework peers.Description
package.jsonwith Next equivalents (dev: next dev,build: next build,start: next start -p 4173) and addnextwhile removing Webpack/Babel/loader andreact-router-domdependencies and related scripts.pages/index.tsx,pages/projects.tsx,pages/about.tsx,pages/404.tsxand createpages/_app.tsxto import global CSS and wrap all pages with the existingErrorBoundaryand sharedLayout.src/components/Layout.tsxto usenext/linkand render children instead of React RouterNavLink/Outlet, and remove SPA bootstrap/entry files andwebpack.config.cjsandpublic/index.htmlwhich are no longer required.tsconfig.json) to include Next-required globs and plugin settings and addnext-env.d.ts, and updatesrc/App.test.tsxtests to render pages via the newLayoutcomposition instead of relying on the SPA router bootstrap.Testing
npm installto installnextfailed due to an environment registry policy returning403 Forbidden, preventing installation of Next and its types so full validation could not complete (install failed).npm run test:run(Vitest) which initially failed on alias resolution and was adjusted, but ultimately fails to resolvenext/linkin tests becausenextis not installed, so unit tests did not pass.npm run typecheckwhich reported missingnextmodule/type errors fornext/linkandnext/appbecausenextis not installed, so typecheck did not pass.http://127.0.0.1:4173but no Next server was available (request returnedERR_EMPTY_RESPONSE), so end-to-end verification could not be completed.Codex Task