BE-4: Upgrade Next.js 12 to 14#19
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- Upgrade next from 12.1.0 to ^14.2.0 (resolved to 14.2.35) - Upgrade react and react-dom from 17.0.2 to ^18.2.0 - Upgrade eslint-config-next from 12.1.4 to ^14.2.0 - Remove .babelrc to enable SWC compiler (Next.js 14 default) - Remove @babel/core and @babel/preset-react dependencies - Add legacyBehavior prop to Link components with non-text children (Product, HeroBanner, FooterBanner, Cart, success page) - pages/ directory routing preserved (no App Router migration) - getServerSideProps, getStaticPaths, getStaticProps unchanged - Build and lint pass successfully Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Upgrades the Next.js framework from v12.1.0 to v14.2.x (resolved to 14.2.35), along with all required companion upgrades. The
pages/directory routing is fully preserved — no App Router migration.Package changes:
next: 12.1.0 → ^14.2.0react/react-dom: 17.0.2 → ^18.2.0 (required by Next.js 14)eslint-config-next: 12.1.4 → ^14.2.0@babel/coreand@babel/preset-react(no longer needed)Code changes:
.babelrcto enable SWC compiler (Next.js 14 default). The config only contained@babel/preset-react, which SWC handles natively.legacyBehaviorprop to 5<Link>components that wrap non-text children (<button>,<div>), since Next.js 13+ changed Link to automatically render an<a>tag.Unchanged:
pages/directory routing,getServerSideProps,getStaticPaths,getStaticProps— all still fully supportednext.config.js— no changes needed (swcMinifyis default in 14)next/imagemigration needed (app uses plain<img>tags)Build and lint pass. All lint warnings are pre-existing (img alt text, useEffect deps).
Review & Testing Checklist for Human
next-sanity-imageworks at runtime — this package declarespeerDependencies: next@^11 || ^12, so--legacy-peer-depswas required during install. Confirm Sanity image rendering still works on product pages and banners.npm run devand verify: homepage loads with products, product detail pages render, cart interactions work, and the success page renders correctly. React 18's automatic batching and stricter StrictMode (double-firing effects in dev) could surface subtle issues.legacyBehaviorpreserves the expected behavior.Notes
altprops on<img>, missing useEffect deps) were intentionally not addressed — they are unrelated to this upgrade.yarn.lockwas not updated since the project usesnpm/package-lock.json.Link to Devin session: https://app.devin.ai/sessions/62188216545d4df1881756c5941a963e
Requested by: @Colhodm