Commit 40536c2
committed
Upgrade to Next.js@15 and React@19
This upgrades Next.js by running `npx @next/codemod@canary upgrade latest`,
which also runs `npx codemod@latest react/19/migration-recipe`.
Additional manual changes I had to do:
1. Disable Turbopack in dev mode.
It wasn't clear to me how to use raw-loader to load .ftl files, so I postponed
that for later.
2. Turned `getExperimentationId` into an async function.
I did this because it calls `headers()`, which is async now. All its invocations
where in async functions anyway.
3. Server components should now pass the accept language to get l10n
In most environments, getL10n() and getL10nBundles() can be synchronous
functions, and just read the language preferences directly. However, on the
server-side, reading the headers is now asynchronous. Thus, I've modified the
l10n generation functions to require the accept language argument if no sync
function can be provided that returns it. Not great, but better than forcing the
same functions in e.g. client components to be async.
An alternative would have been to simply make the getL10n() and getL10nBundles()
functions asynchronous for the server, but I imagine that would be even more
confusing than just making an optional argument required.
4. Dynamically import react-dom/server(.edge)
In `/src/emails/renderEmail`, we _want_ to render HTML to a string, rather than
generating a server component that the server serves, but Next.js throws an
error if we do that directly. Hence, I had to replace that with a dynamic import
as a workaround, turning `renderEmail` into an async function.
Additionally, I got errors in the tests when not importing it from
.edge.
5. Move `serverExternalPackages` out of `experimental`1 parent 2cd4a59 commit 40536c2
File tree
78 files changed
+1828
-1054
lines changed- src
- app
- (proper_react)
- (redesign)
- (authenticated)
- admin
- emails
- removals
- user
- (dashboard)
- dashboard
- [[...slug]]
- fix
- data-broker-profiles
- automatic-remove
- manual-remove
- removal-under-maintenance
- start-free-scan
- view-data-brokers
- welcome-to-plus
- high-risk-data-breaches
- [type]
- leaked-passwords/[type]
- security-recommendations/[type]
- settings
- [[...slug]]
- welcome/[[...slug]]
- (public)
- breach-details/[breachName]
- breaches
- how-it-works
- limitations-apply
- unsubscribe-email/monthly-report-free
- api
- auth/[...nextauth]
- mock
- hibp/range/search/[hashPrefix]
- onerep/profiles/[profileId]
- activate
- deactivate
- optout
- scans
- [scanId]
- utils
- v1
- admin
- feature-flags/[flagId]
- users/[fxaUid]
- user
- email
- remove-email
- resend-email
- scan-result/[onerepScanResultId]/resolution
- welcome-scan/create
- components/client
- csat_survey
- toolbar
- functions
- l10n
- server
- hooks
- db/tables
- emails
- scripts/cronjobs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
78 files changed
+1828
-1054
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
185 | 181 | | |
186 | 182 | | |
187 | 183 | | |
| |||
0 commit comments