Skip to content

Commit 3a65f94

Browse files
Merge branch 'main' of https://github.com/reactjs/react.dev into sync-6570e6cd
2 parents 760be6d + 6570e6c commit 3a65f94

File tree

182 files changed

+6060
-2065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+6060
-2065
lines changed

.env.development

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
SANDPACK_BARE_COMPONENTS=true

.env.production

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
2-
SANDPACK_BARE_COMPONENTS=true
1+
NEXT_PUBLIC_GA_TRACKING_ID = 'G-B1E83PJ3RT'

.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"plugins": ["@typescript-eslint"],
66
"rules": {
77
"no-unused-vars": "off",
8-
"@typescript-eslint/no-unused-vars": "warn"
8+
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
9+
"react-hooks/exhaustive-deps": "error"
910
},
1011
"env": {
1112
"node": true,

.github/workflows/analyze.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up node
1717
uses: actions/setup-node@v1
1818
with:
19-
node-version: "14.x"
19+
node-version: '20.x'
2020

2121
- name: Install dependencies
2222
uses: bahmutov/[email protected]
@@ -38,7 +38,7 @@ jobs:
3838
# Here's the first place where next-bundle-analysis' own script is used
3939
# This step pulls the raw bundle stats for the current bundle
4040
- name: Analyze bundle
41-
run: npx -p nextjs-bundle-analysis report
41+
run: npx -p nextjs-bundle-analysis@0.5.0 report
4242

4343
- name: Upload bundle
4444
uses: actions/upload-artifact@v2

.github/workflows/analyze_comment.yml

+5-22
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,9 @@ jobs:
4747
pr_number=$(cat pr_number/pr_number)
4848
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
4949
50-
- name: Find Comment
51-
uses: peter-evans/find-comment@v1
52-
if: success()
53-
id: fc
54-
with:
55-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
56-
body-includes: "<!-- __NEXTJS_BUNDLE -->"
57-
58-
- name: Create Comment
59-
uses: peter-evans/[email protected]
60-
if: success() && steps.fc.outputs.comment-id == 0
61-
with:
62-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
63-
body: ${{ steps.get-comment-body.outputs.body }}
64-
65-
- name: Update Comment
66-
uses: peter-evans/[email protected]
67-
if: success() && steps.fc.outputs.comment-id != 0
50+
- name: Comment
51+
uses: marocchino/sticky-pull-request-comment@v2
6852
with:
69-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
70-
body: ${{ steps.get-comment-body.outputs.body }}
71-
comment-id: ${{ steps.fc.outputs.comment-id }}
72-
edit-mode: replace
53+
header: next-bundle-analysis
54+
number: ${{ steps.get-comment-body.outputs.pr-number }}
55+
message: ${{ steps.get-comment-body.outputs.body }}

.github/workflows/site_lint.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
lint:
1212
runs-on: ubuntu-latest
1313

14-
name: Lint on node 12.x and ubuntu-latest
14+
name: Lint on node 20.x and ubuntu-latest
1515

1616
steps:
1717
- uses: actions/checkout@v1
18-
- name: Use Node.js 12.x
19-
uses: actions/setup-node@v1
18+
- name: Use Node.js 20.x
19+
uses: actions/setup-node@v3
2020
with:
21-
node-version: 12.x
21+
node-version: 20.x
2222

2323
- name: Install deps and build (with cache)
24-
uses: bahmutov/npm-install@v1.7.10
24+
uses: bahmutov/npm-install@v1.8.32
2525

2626
- name: Lint codebase
2727
run: yarn ci-check

next.config.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ const nextConfig = {
99
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
1010
reactStrictMode: true,
1111
experimental: {
12-
plugins: true,
12+
// TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed
13+
appDir: false,
1314
scrollRestoration: true,
1415
legacyBrowsers: false,
15-
browsersListForSwc: true,
16-
},
17-
env: {
18-
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
1916
},
17+
env: {},
2018
webpack: (config, {dev, isServer, ...options}) => {
2119
if (process.env.ANALYZE) {
2220
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
@@ -35,10 +33,6 @@ const nextConfig = {
3533

3634
const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack');
3735
config.plugins.push(
38-
new NormalModuleReplacementPlugin(
39-
/^@stitches\/core$/,
40-
require.resolve('./src/utils/emptyShim.js')
41-
),
4236
new NormalModuleReplacementPlugin(
4337
/^raf$/,
4438
require.resolve('./src/utils/rafShim.js')

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@
2222
"check-all": "npm-run-all prettier lint:fix tsc"
2323
},
2424
"dependencies": {
25-
"@codesandbox/sandpack-react": "1.15.5",
25+
"@codesandbox/sandpack-react": "2.6.0",
2626
"@docsearch/css": "3.0.0-alpha.41",
2727
"@docsearch/react": "3.0.0-alpha.41",
2828
"@headlessui/react": "^1.7.0",
2929
"body-scroll-lock": "^3.1.3",
3030
"classnames": "^2.2.6",
3131
"date-fns": "^2.16.1",
3232
"debounce": "^1.2.1",
33-
"ga-lite": "^2.1.4",
3433
"github-slugger": "^1.3.0",
35-
"next": "12.3.2-canary.7",
34+
"next": "^13.4.1",
3635
"next-remote-watch": "^1.0.0",
3736
"parse-numeric-range": "^1.2.0",
38-
"react": "0.0.0-experimental-cb5084d1c-20220924",
39-
"react-collapsed": "npm:@gaearon/[email protected]",
40-
"react-dom": "0.0.0-experimental-cb5084d1c-20220924",
37+
"react": "^0.0.0-experimental-16d053d59-20230506",
38+
"react-collapsed": "4.0.4",
39+
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
4140
"remark-frontmatter": "^4.0.1",
4241
"remark-gfm": "^3.0.1"
4342
},
@@ -92,13 +91,13 @@
9291
"retext": "^7.0.1",
9392
"retext-smartypants": "^4.0.0",
9493
"rss": "^1.2.2",
95-
"tailwindcss": "^3.0.22",
94+
"tailwindcss": "^3.3.2",
9695
"typescript": "^4.0.2",
9796
"unist-util-visit": "^2.0.3",
9897
"webpack-bundle-analyzer": "^4.5.0"
9998
},
10099
"engines": {
101-
"node": ">=12.x"
100+
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
102101
},
103102
"nextBundleAnalysis": {
104103
"budget": null,

patches/@codemirror+lang-javascript+0.19.6.patch

-30
This file was deleted.

patches/@codesandbox+sandpack-react+1.15.5.patch

-62
This file was deleted.

patches/@lezer+javascript+0.15.2.patch

-345
This file was deleted.

patches/next+12.3.2-canary.7.patch

-22
This file was deleted.

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)=>{
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
11.7 KB
Loading
12.3 KB
Loading
Loading
Loading
Loading
Loading

public/images/team/dave-mccabe.jpg

-203 KB
Binary file not shown.

public/images/team/lunaruan.jpg

-150 KB
Binary file not shown.

public/images/team/mengdi-chen.jpg

-106 KB
Binary file not shown.

public/images/team/sean-keegan.jpg

-199 KB
Binary file not shown.

src/components/Breadcrumbs.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ function Breadcrumbs({breadcrumbs}: {breadcrumbs: RouteItem[]}) {
1515
!crumb.skipBreadcrumb && (
1616
<div className="flex mb-3 mt-0.5 items-center" key={i}>
1717
<Fragment key={crumb.path}>
18-
<Link href={crumb.path}>
19-
<a className="text-link dark:text-link-dark text-sm tracking-wide font-bold uppercase mr-1 hover:underline">
20-
{crumb.title}
21-
</a>
18+
<Link
19+
href={crumb.path}
20+
className="text-link dark:text-link-dark text-sm tracking-wide font-bold uppercase me-1 hover:underline">
21+
{crumb.title}
2222
</Link>
23-
<span className="inline-block mr-1 text-link dark:text-link-dark text-lg">
23+
<span className="inline-block me-1 text-link dark:text-link-dark text-lg rtl:rotate-180">
2424
<svg
2525
width="20"
2626
height="20"

src/components/ButtonLink.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function ButtonLink({
2121
label,
2222
target = '_self',
2323
...props
24-
}: JSX.IntrinsicElements['a'] & ButtonLinkProps) {
24+
}: React.AnchorHTMLAttributes<HTMLAnchorElement> & ButtonLinkProps) {
2525
const classes = cn(
2626
className,
2727
'active:scale-[.98] transition-transform inline-flex font-bold items-center outline-none focus:outline-none focus-visible:outline focus-visible:outline-link focus:outline-offset-2 focus-visible:dark:focus:outline-link-dark leading-snug',
@@ -34,10 +34,13 @@ function ButtonLink({
3434
}
3535
);
3636
return (
37-
<NextLink href={href as string}>
38-
<a className={classes} {...props} aria-label={label} target={target}>
39-
{children}
40-
</a>
37+
<NextLink
38+
href={href as string}
39+
className={classes}
40+
{...props}
41+
aria-label={label}
42+
target={target}>
43+
{children}
4144
</NextLink>
4245
);
4346
}

src/components/DocsFooter.tsx

+17-18
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,24 @@ function FooterLink({
6666
type: 'Previous' | 'Next';
6767
}) {
6868
return (
69-
<NextLink href={href}>
70-
<a
71-
className={cn(
72-
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
73-
{
74-
'flex-row-reverse justify-self-end text-right': type === 'Next',
75-
}
76-
)}>
77-
<IconNavArrow
78-
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
79-
displayDirection={type === 'Previous' ? 'left' : 'right'}
80-
/>
81-
<span>
82-
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
83-
{type}
84-
</span>
85-
<span className="block text-lg group-hover:underline">{title}</span>
69+
<NextLink
70+
href={href}
71+
className={cn(
72+
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
73+
{
74+
'flex-row-reverse justify-self-end text-end': type === 'Next',
75+
}
76+
)}>
77+
<IconNavArrow
78+
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
79+
displayDirection={type === 'Previous' ? 'start' : 'end'}
80+
/>
81+
<span>
82+
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
83+
{type}
8684
</span>
87-
</a>
85+
<span className="block text-lg group-hover:underline">{title}</span>
86+
</span>
8887
</NextLink>
8988
);
9089
}

src/components/Icon/IconArrow.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import cn from 'classnames';
77

88
export const IconArrow = memo<
99
JSX.IntrinsicElements['svg'] & {
10-
displayDirection: 'left' | 'right' | 'up' | 'down';
10+
/**
11+
* The direction the arrow should point.
12+
* `start` and `end` are relative to the current locale.
13+
* for example, in LTR, `start` is left and `end` is right.
14+
*/
15+
displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down';
1116
}
1217
>(function IconArrow({displayDirection, className, ...rest}) {
1318
return (
@@ -20,6 +25,7 @@ export const IconArrow = memo<
2025
{...rest}
2126
className={cn(className, {
2227
'rotate-180': displayDirection === 'right',
28+
'rotate-180 rtl:rotate-0': displayDirection === 'end',
2329
})}>
2430
<path fill="none" d="M0 0h24v24H0z" />
2531
<path d="M7.828 11H20v2H7.828l5.364 5.364-1.414 1.414L4 12l7.778-7.778 1.414 1.414z" />

src/components/Icon/IconArrowSmall.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ import cn from 'classnames';
77

88
export const IconArrowSmall = memo<
99
JSX.IntrinsicElements['svg'] & {
10-
displayDirection: 'left' | 'right' | 'up' | 'down';
10+
/**
11+
* The direction the arrow should point.
12+
* `start` and `end` are relative to the current locale.
13+
* for example, in LTR, `start` is left and `end` is right.
14+
*/
15+
displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down';
1116
}
1217
>(function IconArrowSmall({displayDirection, className, ...rest}) {
1318
const classes = cn(className, {
1419
'rotate-180': displayDirection === 'left',
20+
'rotate-180 rtl:rotate-0': displayDirection === 'start',
1521
'rotate-90': displayDirection === 'down',
1622
});
1723
return (

0 commit comments

Comments
 (0)