Skip to content

Commit c10aa5f

Browse files
committed
Revert "Upgrade to React 19, Next 15.1 and enable React Compiler (#6996)"
This reverts commit 855ce23.
1 parent c65a3fe commit c10aa5f

40 files changed

+1039
-1399
lines changed

.eslintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"rules": {
77
"no-unused-vars": "off",
88
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
9-
"react-hooks/exhaustive-deps": "error",
10-
"react/no-unknown-property": ["error", { "ignore": ["meta"] }]
9+
"react-hooks/exhaustive-deps": "error"
1110
},
1211
"env": {
1312
"node": true,

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ const nextConfig = {
99
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
1010
reactStrictMode: true,
1111
experimental: {
12+
// TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed
13+
appDir: false,
1214
scrollRestoration: true,
13-
reactCompiler: true,
15+
legacyBrowsers: false,
1416
},
1517
env: {},
1618
webpack: (config, {dev, isServer, ...options}) => {

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss lint-editorconfig",
1818
"tsc": "tsc --noEmit",
1919
"start": "next start",
20-
"postinstall": "is-ci || husky install .husky",
20+
"postinstall": "patch-package && (is-ci || husky install .husky)",
2121
"check-all": "npm-run-all prettier lint:fix tsc rss",
2222
"rss": "node scripts/generateRss.js",
2323
"cache-reset": "rm -rf node_modules/.cache && rm -rf .next && yarn cache clean",
@@ -32,18 +32,17 @@
3232
"@docsearch/react": "^3.6.1",
3333
"@headlessui/react": "^1.7.0",
3434
"@radix-ui/react-context-menu": "^2.1.5",
35-
"babel-plugin-react-compiler": "0.0.0-experimental-696af53-20240625",
3635
"body-scroll-lock": "^3.1.3",
3736
"classnames": "^2.2.6",
3837
"date-fns": "^2.16.1",
3938
"debounce": "^1.2.1",
4039
"github-slugger": "^1.3.0",
41-
"next": "15.1.0",
40+
"next": "^13.4.1",
4241
"next-remote-watch": "^1.0.0",
4342
"parse-numeric-range": "^1.2.0",
44-
"react": "^19.0.0",
43+
"react": "^0.0.0-experimental-16d053d59-20230506",
4544
"react-collapsed": "4.0.4",
46-
"react-dom": "^19.0.0",
45+
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
4746
"remark-frontmatter": "^4.0.1",
4847
"remark-gfm": "^3.0.1"
4948
},
@@ -59,8 +58,8 @@
5958
"@types/mdx-js__react": "^1.5.2",
6059
"@types/node": "^14.6.4",
6160
"@types/parse-numeric-range": "^0.0.1",
62-
"@types/react": "^19.0.0",
63-
"@types/react-dom": "^19.0.0",
61+
"@types/react": "^18.0.9",
62+
"@types/react-dom": "^18.0.5",
6463
"@typescript-eslint/eslint-plugin": "^5.36.2",
6564
"@typescript-eslint/parser": "^5.36.2",
6665
"asyncro": "^3.0.0",
@@ -85,6 +84,7 @@
8584
"metro-cache": "0.72.2",
8685
"mocha": "^10.6.0",
8786
"npm-run-all": "^4.1.5",
87+
"patch-package": "^6.2.2",
8888
"postcss": "^8.4.5",
8989
"postcss-flexbugs-fixes": "4.2.1",
9090
"postcss-preset-env": "^6.7.0",

patches/next+13.4.1.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/node_modules/next/dist/server/render.js b/node_modules/next/dist/server/render.js
2+
index a1f8648..1b3d608 100644
3+
--- a/node_modules/next/dist/server/render.js
4+
+++ b/node_modules/next/dist/server/render.js
5+
@@ -758,9 +758,14 @@ async function renderToHTML(req, res, pathname, query, renderOpts) {
6+
// Always using react concurrent rendering mode with required react version 18.x
7+
const renderShell = async (EnhancedApp, EnhancedComponent)=>{
8+
const content = renderContent(EnhancedApp, EnhancedComponent);
9+
- return await (0, _nodewebstreamshelper.renderToInitialStream)({
10+
- ReactDOMServer: _serverbrowser.default,
11+
- element: content
12+
+ return new Promise((resolve, reject) => {
13+
+ (0, _nodewebstreamshelper.renderToInitialStream)({
14+
+ ReactDOMServer: _serverbrowser.default,
15+
+ element: content,
16+
+ streamOptions: {
17+
+ onError: reject
18+
+ }
19+
+ }).then(resolve, reject);
20+
});
21+
};
22+
const createBodyResult = (0, _tracer.getTracer)().wrap(_constants2.RenderSpan.createBodyResult, (initialStream, suffix)=>{
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/node_modules/next-remote-watch/bin/next-remote-watch b/node_modules/next-remote-watch/bin/next-remote-watch
2+
index c055b66..a2f749c 100755
3+
--- a/node_modules/next-remote-watch/bin/next-remote-watch
4+
+++ b/node_modules/next-remote-watch/bin/next-remote-watch
5+
@@ -66,7 +66,10 @@ app.prepare().then(() => {
6+
}
7+
}
8+
9+
- app.server.hotReloader.send('reloadPage')
10+
+ app.server.hotReloader.send({
11+
+ event: 'serverOnlyChanges',
12+
+ pages: ['/[[...markdownPath]]']
13+
+ });
14+
}
15+
)
16+
}

src/components/ExternalLink.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
/*
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
4-
import type {DetailedHTMLProps, AnchorHTMLAttributes} from 'react';
54

65
export function ExternalLink({
76
href,
87
target,
98
children,
109
...props
11-
}: DetailedHTMLProps<
12-
AnchorHTMLAttributes<HTMLAnchorElement>,
13-
HTMLAnchorElement
14-
>) {
10+
}: JSX.IntrinsicElements['a']) {
1511
return (
1612
<a href={href} target={target ?? '_blank'} rel="noopener" {...props}>
1713
{children}

src/components/Icon/IconArrow.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
import {memo} from 'react';
66
import cn from 'classnames';
7-
import type {SVGProps} from 'react';
87

98
export const IconArrow = memo<
10-
SVGProps<SVGSVGElement> & {
9+
JSX.IntrinsicElements['svg'] & {
1110
/**
1211
* The direction the arrow should point.
1312
* `start` and `end` are relative to the current locale.

src/components/Icon/IconArrowSmall.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
import {memo} from 'react';
66
import cn from 'classnames';
7-
import type {SVGProps} from 'react';
87

98
export const IconArrowSmall = memo<
10-
SVGProps<SVGSVGElement> & {
9+
JSX.IntrinsicElements['svg'] & {
1110
/**
1211
* The direction the arrow should point.
1312
* `start` and `end` are relative to the current locale.

src/components/Icon/IconBsky.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
*/
44

55
import {memo} from 'react';
6-
import type {SVGProps} from 'react';
76

8-
export const IconBsky = memo<SVGProps<SVGSVGElement>>(function IconBsky(props) {
7+
export const IconBsky = memo<JSX.IntrinsicElements['svg']>(function IconBsky(
8+
props
9+
) {
910
return (
1011
<svg
1112
aria-label="Bluesky"

0 commit comments

Comments
 (0)