Skip to content

Commit 1088a04

Browse files
committed
Merge branch 'main' into tr/ref-dom
2 parents 752fc99 + 1e9eefd commit 1088a04

Some content is hidden

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

45 files changed

+2864
-1302
lines changed

.github/workflows/analyze.yml

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

.github/workflows/site_lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ 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
18+
- name: Use Node.js 20.x
1919
uses: actions/setup-node@v1
2020
with:
21-
node-version: 12.x
21+
node-version: 20.x
2222

2323
- name: Install deps and build (with cache)
2424
uses: bahmutov/[email protected]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This repo contains the source code and documentation powering [react.dev](https://react.dev/).
44

5-
> 以下はオリジナル(英語版)リポジトリの README です。日本語版 React ドキュメントへの貢献(翻訳・修正など)に興味がある方は [TRANSLATION.md](TRANSLATION.md) を参照してください。
5+
> 以下はオリジナル(英語版)リポジトリの README です。日本語版 React ドキュメントへの貢献(翻訳・修正など)に興味がある方は[こちらの Wiki ページ](https://github.com/reactjs/ja.react.dev/wiki)を参照してください。
66
77
## Getting started
88

TRANSLATION.md

-66
This file was deleted.

next.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ 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,
1616
},
1717
env: {
1818
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,

package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"tsc": "tsc --noEmit",
2020
"start": "next start",
2121
"postinstall": "patch-package && (is-ci || husky install .husky)",
22-
"check-all": "npm-run-all prettier lint:fix tsc"
22+
"check-all": "npm-run-all prettier lint:fix tsc",
23+
"textlint": "cd textlint && yarn --frozen-lockfile && yarn textlint",
24+
"textlint-staged": "cd textlint && yarn --frozen-lockfile && yarn textlint-staged --"
2325
},
2426
"dependencies": {
2527
"@codesandbox/sandpack-react": "1.15.5",
@@ -32,12 +34,12 @@
3234
"debounce": "^1.2.1",
3335
"ga-lite": "^2.1.4",
3436
"github-slugger": "^1.3.0",
35-
"next": "12.3.2-canary.7",
37+
"next": "^13.4.1",
3638
"next-remote-watch": "^1.0.0",
3739
"parse-numeric-range": "^1.2.0",
38-
"react": "0.0.0-experimental-cb5084d1c-20220924",
40+
"react": "^0.0.0-experimental-16d053d59-20230506",
3941
"react-collapsed": "npm:@gaearon/[email protected]",
40-
"react-dom": "0.0.0-experimental-cb5084d1c-20220924",
42+
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
4143
"remark-frontmatter": "^4.0.1",
4244
"remark-gfm": "^3.0.1"
4345
},
@@ -98,7 +100,7 @@
98100
"webpack-bundle-analyzer": "^4.5.0"
99101
},
100102
"engines": {
101-
"node": ">=12.x"
103+
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
102104
},
103105
"nextBundleAnalysis": {
104106
"budget": null,
@@ -107,6 +109,6 @@
107109
},
108110
"lint-staged": {
109111
"*.{js,ts,jsx,tsx,css}": "yarn prettier",
110-
"src/**/*.md": "yarn fix-headings"
112+
"src/**/*.md": ["yarn fix-headings", "yarn textlint-staged --"]
111113
}
112114
}

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

prh.yml

-76
This file was deleted.

src/components/Breadcrumbs.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ 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 mr-1 hover:underline">
21+
{crumb.title}
2222
</Link>
2323
<span className="inline-block mr-1 text-link dark:text-link-dark text-lg">
2424
<svg

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-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}
8684
</span>
87-
</a>
85+
<span className="block text-lg group-hover:underline">{title}</span>
86+
</span>
8887
</NextLink>
8988
);
9089
}

src/components/Layout/Footer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ function FooterLink({
388388

389389
return (
390390
<div>
391-
<NextLink href={href}>
392-
<a className={classes}>{children}</a>
391+
<NextLink href={href} className={classes}>
392+
{children}
393393
</NextLink>
394394
</div>
395395
);

0 commit comments

Comments
 (0)