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

+1-2
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

+1-1
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

+3-1
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

+7-7
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

+22
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)=>{

patches/next-remote-watch+1.0.0.patch

+16
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

+1-5
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

+1-2
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

+1-2
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

+3-2
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"

src/components/Icon/IconClose.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
*/
44

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

8-
export const IconClose = memo<SVGProps<SVGSVGElement>>(function IconClose(
7+
export const IconClose = memo<JSX.IntrinsicElements['svg']>(function IconClose(
98
props
109
) {
1110
return (

src/components/Icon/IconFacebookCircle.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
*/
44

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

8-
export const IconFacebookCircle = memo<SVGProps<SVGSVGElement>>(
7+
export const IconFacebookCircle = memo<JSX.IntrinsicElements['svg']>(
98
function IconFacebookCircle(props) {
109
return (
1110
<svg

src/components/Icon/IconGitHub.tsx

+15-16
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
*/
44

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

8-
export const IconGitHub = memo<SVGProps<SVGSVGElement>>(function IconGitHub(
9-
props
10-
) {
11-
return (
12-
<svg
13-
xmlns="http://www.w3.org/2000/svg"
14-
width="1.5em"
15-
height="1.5em"
16-
viewBox="0 -2 24 24"
17-
fill="currentColor"
18-
{...props}>
19-
<path d="M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"></path>
20-
</svg>
21-
);
22-
});
7+
export const IconGitHub = memo<JSX.IntrinsicElements['svg']>(
8+
function IconGitHub(props) {
9+
return (
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
width="1.5em"
13+
height="1.5em"
14+
viewBox="0 -2 24 24"
15+
fill="currentColor"
16+
{...props}>
17+
<path d="M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"></path>
18+
</svg>
19+
);
20+
}
21+
);

src/components/Icon/IconHamburger.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
*/
44

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

8-
export const IconHamburger = memo<SVGProps<SVGSVGElement>>(
7+
export const IconHamburger = memo<JSX.IntrinsicElements['svg']>(
98
function IconHamburger(props) {
109
return (
1110
<svg

src/components/Icon/IconInstagram.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
*/
44

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

8-
export const IconInstagram = memo<SVGProps<SVGSVGElement>>(
7+
export const IconInstagram = memo<JSX.IntrinsicElements['svg']>(
98
function IconInstagram(props) {
109
return (
1110
<svg

src/components/Icon/IconLink.tsx

+3-2
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 IconLink = memo<SVGProps<SVGSVGElement>>(function IconLink(props) {
7+
export const IconLink = memo<JSX.IntrinsicElements['svg']>(function IconLink(
8+
props
9+
) {
910
return (
1011
<svg
1112
xmlns="http://www.w3.org/2000/svg"

src/components/Icon/IconNewPage.tsx

+22-23
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,26 @@
33
*/
44

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

8-
export const IconNewPage = memo<SVGProps<SVGSVGElement>>(function IconNewPage(
9-
props
10-
) {
11-
return (
12-
<svg
13-
width="1em"
14-
height="1em"
15-
viewBox="0 0 24 24"
16-
fill="none"
17-
xmlns="http://www.w3.org/2000/svg"
18-
{...props}>
19-
<path
20-
d="M20.5001 2H15.5001C15.3675 2 15.2403 2.05268 15.1465 2.14645C15.0528 2.24021 15.0001 2.36739 15.0001 2.5V3.5C15.0001 3.63261 15.0528 3.75979 15.1465 3.85355C15.2403 3.94732 15.3675 4 15.5001 4H18.5901L7.6501 14.94C7.60323 14.9865 7.56604 15.0418 7.54065 15.1027C7.51527 15.1636 7.5022 15.229 7.5022 15.295C7.5022 15.361 7.51527 15.4264 7.54065 15.4873C7.56604 15.5482 7.60323 15.6035 7.6501 15.65L8.3501 16.35C8.39658 16.3969 8.45188 16.4341 8.51281 16.4594C8.57374 16.4848 8.63909 16.4979 8.7051 16.4979C8.7711 16.4979 8.83646 16.4848 8.89738 16.4594C8.95831 16.4341 9.01362 16.3969 9.0601 16.35L20.0001 5.41V8.5C20.0001 8.63261 20.0528 8.75979 20.1465 8.85355C20.2403 8.94732 20.3675 9 20.5001 9H21.5001C21.6327 9 21.7599 8.94732 21.8537 8.85355C21.9474 8.75979 22.0001 8.63261 22.0001 8.5V3.5C22.0001 3.10218 21.8421 2.72064 21.5608 2.43934C21.2795 2.15804 20.8979 2 20.5001 2V2Z"
21-
fill="currentColor"
22-
/>
23-
<path
24-
d="M21.5 13H20.5C20.3674 13 20.2402 13.0527 20.1464 13.1464C20.0527 13.2402 20 13.3674 20 13.5V20H4V4H10.5C10.6326 4 10.7598 3.94732 10.8536 3.85355C10.9473 3.75979 11 3.63261 11 3.5V2.5C11 2.36739 10.9473 2.24021 10.8536 2.14645C10.7598 2.05268 10.6326 2 10.5 2H3.5C3.10218 2 2.72064 2.15804 2.43934 2.43934C2.15804 2.72064 2 3.10218 2 3.5V20.5C2 20.8978 2.15804 21.2794 2.43934 21.5607C2.72064 21.842 3.10218 22 3.5 22H20.5C20.8978 22 21.2794 21.842 21.5607 21.5607C21.842 21.2794 22 20.8978 22 20.5V13.5C22 13.3674 21.9473 13.2402 21.8536 13.1464C21.7598 13.0527 21.6326 13 21.5 13Z"
25-
fill="currentColor"
26-
/>
27-
</svg>
28-
);
29-
});
7+
export const IconNewPage = memo<JSX.IntrinsicElements['svg']>(
8+
function IconNewPage(props) {
9+
return (
10+
<svg
11+
width="1em"
12+
height="1em"
13+
viewBox="0 0 24 24"
14+
fill="none"
15+
xmlns="http://www.w3.org/2000/svg"
16+
{...props}>
17+
<path
18+
d="M20.5001 2H15.5001C15.3675 2 15.2403 2.05268 15.1465 2.14645C15.0528 2.24021 15.0001 2.36739 15.0001 2.5V3.5C15.0001 3.63261 15.0528 3.75979 15.1465 3.85355C15.2403 3.94732 15.3675 4 15.5001 4H18.5901L7.6501 14.94C7.60323 14.9865 7.56604 15.0418 7.54065 15.1027C7.51527 15.1636 7.5022 15.229 7.5022 15.295C7.5022 15.361 7.51527 15.4264 7.54065 15.4873C7.56604 15.5482 7.60323 15.6035 7.6501 15.65L8.3501 16.35C8.39658 16.3969 8.45188 16.4341 8.51281 16.4594C8.57374 16.4848 8.63909 16.4979 8.7051 16.4979C8.7711 16.4979 8.83646 16.4848 8.89738 16.4594C8.95831 16.4341 9.01362 16.3969 9.0601 16.35L20.0001 5.41V8.5C20.0001 8.63261 20.0528 8.75979 20.1465 8.85355C20.2403 8.94732 20.3675 9 20.5001 9H21.5001C21.6327 9 21.7599 8.94732 21.8537 8.85355C21.9474 8.75979 22.0001 8.63261 22.0001 8.5V3.5C22.0001 3.10218 21.8421 2.72064 21.5608 2.43934C21.2795 2.15804 20.8979 2 20.5001 2V2Z"
19+
fill="currentColor"
20+
/>
21+
<path
22+
d="M21.5 13H20.5C20.3674 13 20.2402 13.0527 20.1464 13.1464C20.0527 13.2402 20 13.3674 20 13.5V20H4V4H10.5C10.6326 4 10.7598 3.94732 10.8536 3.85355C10.9473 3.75979 11 3.63261 11 3.5V2.5C11 2.36739 10.9473 2.24021 10.8536 2.14645C10.7598 2.05268 10.6326 2 10.5 2H3.5C3.10218 2 2.72064 2.15804 2.43934 2.43934C2.15804 2.72064 2 3.10218 2 3.5V20.5C2 20.8978 2.15804 21.2794 2.43934 21.5607C2.72064 21.842 3.10218 22 3.5 22H20.5C20.8978 22 21.2794 21.842 21.5607 21.5607C21.842 21.2794 22 20.8978 22 20.5V13.5C22 13.3674 21.9473 13.2402 21.8536 13.1464C21.7598 13.0527 21.6326 13 21.5 13Z"
23+
fill="currentColor"
24+
/>
25+
</svg>
26+
);
27+
}
28+
);

src/components/Icon/IconRss.tsx

+3-2
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 IconRss = memo<SVGProps<SVGSVGElement>>(function IconRss(props) {
7+
export const IconRss = memo<JSX.IntrinsicElements['svg']>(function IconRss(
8+
props
9+
) {
910
return (
1011
<svg
1112
xmlns="http://www.w3.org/2000/svg"

src/components/Icon/IconSearch.tsx

+16-17
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
*/
44

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

8-
export const IconSearch = memo<SVGProps<SVGSVGElement>>(function IconSearch(
9-
props
10-
) {
11-
return (
12-
<svg width="1em" height="1em" viewBox="0 0 20 20" {...props}>
13-
<path
14-
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
15-
stroke="currentColor"
16-
fill="none"
17-
strokeWidth="2"
18-
fillRule="evenodd"
19-
strokeLinecap="round"
20-
strokeLinejoin="round"></path>
21-
</svg>
22-
);
23-
});
7+
export const IconSearch = memo<JSX.IntrinsicElements['svg']>(
8+
function IconSearch(props) {
9+
return (
10+
<svg width="1em" height="1em" viewBox="0 0 20 20" {...props}>
11+
<path
12+
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
13+
stroke="currentColor"
14+
fill="none"
15+
strokeWidth="2"
16+
fillRule="evenodd"
17+
strokeLinecap="round"
18+
strokeLinejoin="round"></path>
19+
</svg>
20+
);
21+
}
22+
);

0 commit comments

Comments
 (0)