Skip to content

Upgrade to React 19, Next 15.1 and enable React Compiler #6996

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

Merged
merged 18 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix errors
  • Loading branch information
rickhanlonii committed Jun 27, 2024
commit 1a544eaeb3cad6c0ef94e6ba080c003ac4c0a44c
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"date-fns": "^2.16.1",
"debounce": "^1.2.1",
"github-slugger": "^1.3.0",
"next": "^15.0.0-rc.0",
"next": "15.0.0-canary.46",
"next-remote-watch": "^1.0.0",
"parse-numeric-range": "^1.2.0",
"react": "^19.0.0-rc-8971381549-20240625",
Expand Down
9 changes: 6 additions & 3 deletions src/pages/[[...markdownPath]].js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ function useActiveSection() {

// Deserialize a client React tree from JSON.
function reviveNodeOnClient(key, val) {
if (typeof val === 'object' && val !== null && 'type' in val) {
if (Array.isArray(val) && val[0] == '$r') {
// Assume it's a React element.
let {type, key, props} = val;
let type = val[1];
let key = val[2];
let props = val[3];
if (type === 'wrapper') {
type = Fragment;
props = {children: props.children};
props = {children: [props.children]};
}
if (MDXComponents[type]) {
type = MDXComponents[type];
Expand All @@ -91,6 +93,7 @@ function reviveNodeOnClient(key, val) {
type: type,
key: key,
ref: null,
_store: {validated: 0},
props: props,
_owner: null,
};
Expand Down
3 changes: 2 additions & 1 deletion src/pages/errors/[errorCode].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ function reviveNodeOnClient(key: unknown, val: any) {
type = Fragment;
}
return {
$$typeof: Symbol.for('react.element'),
$$typeof: Symbol.for('react.transitional.element'),
type: type,
key: key,
ref: null,
props: props,
_store: {},
_owner: null,
};
} else {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/compileMDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {MDXComponents} from 'components/MDX/MDXComponents';

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~ IMPORTANT: BUMP THIS IF YOU CHANGE ANY CODE BELOW ~~~
const DISK_CACHE_BREAKER = 9;
const DISK_CACHE_BREAKER = 10;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

export default async function compileMDX(
Expand Down Expand Up @@ -144,7 +144,10 @@ export default async function compileMDX(

// Serialize a server React tree node to JSON.
function stringifyNodeOnServer(key: unknown, val: any) {
if (val != null && val.$$typeof === Symbol.for('react.element')) {
if (
val != null &&
val.$$typeof === Symbol.for('react.transitional.element')
) {
// Remove fake MDX props.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {mdxType, originalType, parentName, ...cleanProps} = val.props;
Expand Down
134 changes: 67 additions & 67 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,10 @@
unist-util-visit "^4.0.0"
vfile "^5.0.0"

"@next/env@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/env/-/env-15.0.0-rc.0.tgz#c772c9261dad10b1a1e72693c7dadfe2e35e6c5a"
integrity sha512-6W0ndQvHR9sXcqcKeR/inD2UTRCs9+VkSK3lfaGmEuZs7EjwwXMO2BPYjz9oBrtfPL3xuTjtXsHKSsalYQ5l1Q==
"@next/env@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/env/-/env-15.0.0-canary.46.tgz#ed64c5a62be505dffd88d89f2e8b33bde641e03b"
integrity sha512-ahFr4BNVF+ajZnZP9tesGWiMN8onxWyUMU4Fx+pHecp812TmUcRori8KgU6q5UEfGnB3GfLYExaRxN0oheQaLQ==

"@next/eslint-plugin-next@12.0.3":
version "12.0.3"
Expand All @@ -1021,50 +1021,50 @@
dependencies:
glob "7.1.7"

"@next/swc-darwin-arm64@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.0-rc.0.tgz#d083d397246b2becfa41c724f43c3a31d682b1fb"
integrity sha512-4OpTXvAWcSabXA5d688zdUwa3sfT9QrLnHMdpv4q2UDnnuqmOI0xLb6lrOxwpi+vHJNkneuNLqyc5HGBhkqL6A==

"@next/swc-darwin-x64@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.0-rc.0.tgz#f7066acd555b5db0037768dd311e0b201b4ebf08"
integrity sha512-/TD8M9DT244uhtFA8P/0DUbM7ftg2zio6yOo6ajV16vNjkcug9Kt9//Wa4SrJjWcsGZpViLctOlwn3/6JFAuAA==

"@next/swc-linux-arm64-gnu@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.0-rc.0.tgz#ecce3b9cfed770f372b6cf05170ff2c89e909642"
integrity sha512-3VTO32938AcqOlOI/U61/MIpeYrblP22VU1GrgmMQJozsAXEJgLCgf3wxZtn61/FG4Yc0tp7rPZE2t1fIGe0+w==

"@next/swc-linux-arm64-musl@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.0-rc.0.tgz#39d2e2687181e8c7fc88774cb106a99374b25dce"
integrity sha512-0kDnxM3AfrrHFJ/wTkjkv7cVHIaGwv+CzDg9lL2BoLEM4kMQhH20DTsBOMqpTpo1K2KCg67LuTGd3QOITT5uFQ==

"@next/swc-linux-x64-gnu@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.0-rc.0.tgz#853b80cd84487742fce2e81908a904e6f5125daf"
integrity sha512-fPMNahzqYFjm5h0ncJ5+F3NrShmWhpusM+zrQl01MMU0Ed5xsL4pJJDSuXV4wPkNUSjCP3XstTjxR5kBdO4juQ==

"@next/swc-linux-x64-musl@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.0-rc.0.tgz#3c0715879189593e0e9a5d30c2472cec26ac781a"
integrity sha512-7/FLgOqrrQAxOVQrxfr3bGgZ83pSCmc2S3TXBILnHw0S8qLxmFjhSjH5ogaDmjrES/PSYMaX1FsP5Af88hp7Gw==

"@next/swc-win32-arm64-msvc@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.0-rc.0.tgz#97be1f0fcf7319f3cad5046f2f153d585d25c312"
integrity sha512-5wcqoYHh7hbdghjH6Xs3i5/f0ov+i1Xw2E3O+BzZNESYVLgCM1q7KJu5gdGFoXA2gz5XaKF/VBcYHikLzyjgmA==

"@next/swc-win32-ia32-msvc@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-15.0.0-rc.0.tgz#3518e7da723ff92face4d40c18e299fc4a27156a"
integrity sha512-/hqOmYRTvtBPToE4Dbl9n+sLYU7DPd52R+TtjIrrEzTMgFo2/d7un3sD7GKmb2OwOj/ExyGv6Bd/JzytBVxXlw==

"@next/swc-win32-x64-msvc@15.0.0-rc.0":
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.0-rc.0.tgz#e6343051a5bf1e071a67553fa6f3726b64dcf54e"
integrity sha512-2Jly5nShvCUzzngP3RzdQ3JcuEcHcnIEvkvZDCXqFAK+bWks4+qOkEUO1QIAERQ99J5J9/1AN/8zFBme3Mm57A==
"@next/swc-darwin-arm64@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.0-canary.46.tgz#09540048cce4ea548c8b3ff5832d87d93a4d1ac0"
integrity sha512-42fIDLl5Sm9klKZm5TH8H3CEms/bJ8xy1S5g5EW37l4xVbwfOV5q27NbXFIUAkAqHoXaMgzC/Yck/Vk1Z7b7eQ==

"@next/swc-darwin-x64@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.0-canary.46.tgz#e5abac98904de576beaf67ed5ead2e04bb425edd"
integrity sha512-9c3dArYniDMTfq2TM4dg8rbJp3hFWHq1KAYPsbmcm9b1n9twJEd/LnNLLrpN4ITk+f8XXGRSWZ5FerhQkDtDig==

"@next/swc-linux-arm64-gnu@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.0-canary.46.tgz#7b5315e0fcb0de9cf8efa1cf0270dfd570b31ae1"
integrity sha512-zTBQLNLv4DJfHZWLN4fC7IaSH3OV1QYNeqix4XjrVVXJ/G1A0F49SaVvpUMOM/APOsPBKTOzukaAJ39q7PkJmQ==

"@next/swc-linux-arm64-musl@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.0-canary.46.tgz#ce26809835f1e36b5e156bef0dc3d4c925437d15"
integrity sha512-cPvHRaMDg3bt2uaPpGvc5xIUGsUg9NbS++ujMxwKVuo0VPBmMzyXjn+g/bro7yQR3YM8bYrQiPi0Cy2rPMXMmg==

"@next/swc-linux-x64-gnu@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.0-canary.46.tgz#cc154ce99cb63f944c709d23051a2fc4772dd70d"
integrity sha512-Snt1dijo+6cmgVs/6TsvNJyw71fE4yLSURQ931TA2SMU1r6nAWqdyOWqPFxRKbOAXqAknP5hdoBR/hnEbFwH5g==

"@next/swc-linux-x64-musl@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.0-canary.46.tgz#c92322d0e5d733187ba4c368d62c822d725999c5"
integrity sha512-QEQA+r37Qw1+XhxqLt1Pk7ZMcHRUNMp1lmMmmo18kM16GfxGPu7tPT2XtQcObcvMeH0u6hYwwzzuVrB5BQo2HA==

"@next/swc-win32-arm64-msvc@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.0-canary.46.tgz#a4a3ec5841705d48d54a5448796c235c66153d52"
integrity sha512-0BxRw87UV98DLrfv3+1r9KY29tvcRZ8iKKKubY/N/d82RFUx3J9/BiSCcacX1yckPvKSDFRUP3ukKzarIuDpXA==

"@next/swc-win32-ia32-msvc@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-15.0.0-canary.46.tgz#c03b6299cb4ecb064ea28b781b09a3202ca1e257"
integrity sha512-CHjNDxkjHQhx0d3Rrlld+V7M5VsYnE0IMasuWF7LiA4AwkKIeuOxrgMKfwGWLYq5Y3fZ8JyqWx/28qc9GTydqA==

"@next/swc-win32-x64-msvc@15.0.0-canary.46":
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.0-canary.46.tgz#1dd796683ba89e29235e423e738f142d5eb4b0b7"
integrity sha512-2Z+X4fMKFI6NXgS+1Sqe/hp+XkU1cbU9rJ9lJkdj0pmY/Q2Ch0438Vm2hx0SGw0u8H8oBonmQEEJJZotXa9kIA==

"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
Expand Down Expand Up @@ -5623,28 +5623,28 @@ next-tick@^1.1.0:
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"
integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==

next@^15.0.0-rc.0:
version "15.0.0-rc.0"
resolved "https://registry.yarnpkg.com/next/-/next-15.0.0-rc.0.tgz#ec9440e10c40f7f8c04487bd58aa970553d8148e"
integrity sha512-IWcCvxUSCAuOK5gig4+9yiyt/dLKpIa+WT01Qcx4CBE4TtwJljyTDnCVVn64jDZ4qmSzsaEYXpb4DTI8qbk03A==
next@15.0.0-canary.46:
version "15.0.0-canary.46"
resolved "https://registry.yarnpkg.com/next/-/next-15.0.0-canary.46.tgz#23d5ca935fadb418867804ea674aaee899775a01"
integrity sha512-m8raV39xX5v1JN20mA2olFQaglgWIHFo4WVIknrs11hQnW2A9sfYD5ULfYIGJu48eyBSVEMI8pf7VqDRrRZQKQ==
dependencies:
"@next/env" "15.0.0-rc.0"
"@next/env" "15.0.0-canary.46"
"@swc/helpers" "0.5.11"
busboy "1.6.0"
caniuse-lite "^1.0.30001579"
graceful-fs "^4.2.11"
postcss "8.4.31"
styled-jsx "5.1.3"
styled-jsx "5.1.6"
optionalDependencies:
"@next/swc-darwin-arm64" "15.0.0-rc.0"
"@next/swc-darwin-x64" "15.0.0-rc.0"
"@next/swc-linux-arm64-gnu" "15.0.0-rc.0"
"@next/swc-linux-arm64-musl" "15.0.0-rc.0"
"@next/swc-linux-x64-gnu" "15.0.0-rc.0"
"@next/swc-linux-x64-musl" "15.0.0-rc.0"
"@next/swc-win32-arm64-msvc" "15.0.0-rc.0"
"@next/swc-win32-ia32-msvc" "15.0.0-rc.0"
"@next/swc-win32-x64-msvc" "15.0.0-rc.0"
"@next/swc-darwin-arm64" "15.0.0-canary.46"
"@next/swc-darwin-x64" "15.0.0-canary.46"
"@next/swc-linux-arm64-gnu" "15.0.0-canary.46"
"@next/swc-linux-arm64-musl" "15.0.0-canary.46"
"@next/swc-linux-x64-gnu" "15.0.0-canary.46"
"@next/swc-linux-x64-musl" "15.0.0-canary.46"
"@next/swc-win32-arm64-msvc" "15.0.0-canary.46"
"@next/swc-win32-ia32-msvc" "15.0.0-canary.46"
"@next/swc-win32-x64-msvc" "15.0.0-canary.46"
sharp "^0.33.4"

nice-try@^1.0.4:
Expand Down Expand Up @@ -7564,10 +7564,10 @@ style-to-object@^0.3.0:
dependencies:
inline-style-parser "0.1.1"

styled-jsx@5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.3.tgz#b148f3373af118768d1fcbd935e98c19e4bfeb1d"
integrity sha512-qLRShOWTE/Mf6Bvl72kFeKBl8N2Eq9WIFfoAuvbtP/6tqlnj1SCjv117n2MIjOPpa1jTorYqLJgsHKy5Y3ziww==
styled-jsx@5.1.6:
version "5.1.6"
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.6.tgz#83b90c077e6c6a80f7f5e8781d0f311b2fe41499"
integrity sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==
dependencies:
client-only "0.0.1"

Expand Down
Loading