Skip to content

Commit 88e5909

Browse files
merging all conflicts
2 parents 9e229e9 + f6d762c commit 88e5909

File tree

249 files changed

+12169
-5446
lines changed

Some content is hidden

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

249 files changed

+12169
-5446
lines changed

.eslintrc

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
"root": true,
33
"extends": "next/core-web-vitals",
44
"parser": "@typescript-eslint/parser",
5-
"plugins": ["@typescript-eslint"],
5+
"plugins": ["@typescript-eslint", "eslint-plugin-react-compiler"],
66
"rules": {
77
"no-unused-vars": "off",
8-
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
9-
"react-hooks/exhaustive-deps": "error"
8+
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
9+
"react-hooks/exhaustive-deps": "error",
10+
"react/no-unknown-property": ["error", {"ignore": ["meta"]}],
11+
"react-compiler/react-compiler": "error"
1012
},
1113
"env": {
1214
"node": true,

.github/workflows/analyze.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,32 @@ on:
77
- main # change this if your default branch is named differently
88
workflow_dispatch:
99

10+
permissions: {}
11+
1012
jobs:
1113
analyze:
1214
runs-on: ubuntu-latest
1315
steps:
14-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1517

1618
- name: Set up node
17-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v4
1820
with:
1921
node-version: '20.x'
22+
cache: yarn
23+
cache-dependency-path: yarn.lock
24+
25+
- name: Restore cached node_modules
26+
uses: actions/cache@v4
27+
with:
28+
path: '**/node_modules'
29+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
2030

21-
- name: Install dependencies
22-
uses: bahmutov/npm-install@v1.7.10
31+
- name: Install deps
32+
run: yarn install --frozen-lockfile
2333

2434
- name: Restore next build
25-
uses: actions/cache@v2
35+
uses: actions/cache@v4
2636
id: restore-build-cache
2737
env:
2838
cache-name: cache-next-build
@@ -41,13 +51,13 @@ jobs:
4151
run: npx -p [email protected] report
4252

4353
- name: Upload bundle
44-
uses: actions/upload-artifact@v2
54+
uses: actions/upload-artifact@v4
4555
with:
4656
path: .next/analyze/__bundle_analysis.json
4757
name: bundle_analysis.json
4858

4959
- name: Download base branch bundle stats
50-
uses: dawidd6/action-download-artifact@v2
60+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
5161
if: success() && github.event.number
5262
with:
5363
workflow: analyze.yml
@@ -73,7 +83,7 @@ jobs:
7383
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
7484

7585
- name: Upload analysis comment
76-
uses: actions/upload-artifact@v2
86+
uses: actions/upload-artifact@v4
7787
with:
7888
name: analysis_comment.txt
7989
path: .next/analyze/__bundle_analysis_comment.txt
@@ -82,7 +92,7 @@ jobs:
8292
run: echo ${{ github.event.number }} > ./pr_number
8393

8494
- name: Upload PR number
85-
uses: actions/upload-artifact@v2
95+
uses: actions/upload-artifact@v4
8696
with:
8797
name: pr_number
8898
path: ./pr_number

.github/workflows/analyze_comment.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: Analyze Bundle (Comment)
22

33
on:
44
workflow_run:
5-
workflows: ["Analyze Bundle"]
5+
workflows: ['Analyze Bundle']
66
types:
77
- completed
88

9+
permissions: {}
10+
911
jobs:
1012
comment:
1113
runs-on: ubuntu-latest
@@ -14,15 +16,15 @@ jobs:
1416
github.event.workflow_run.conclusion == 'success' }}
1517
steps:
1618
- name: Download base branch bundle stats
17-
uses: dawidd6/action-download-artifact@v2
19+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
1820
with:
1921
workflow: analyze.yml
2022
run_id: ${{ github.event.workflow_run.id }}
2123
name: analysis_comment.txt
2224
path: analysis_comment.txt
2325

2426
- name: Download PR number
25-
uses: dawidd6/action-download-artifact@v2
27+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
2628
with:
2729
workflow: analyze.yml
2830
run_id: ${{ github.event.workflow_run.id }}
@@ -48,7 +50,7 @@ jobs:
4850
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
4951
5052
- name: Comment
51-
uses: marocchino/sticky-pull-request-comment@v2
53+
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
5254
with:
5355
header: next-bundle-analysis
5456
number: ${{ steps.get-comment-body.outputs.pr-number }}

.github/workflows/discord_notify.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Discord Notify
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review]
6+
7+
permissions: {}
8+
9+
jobs:
10+
check_maintainer:
11+
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
12+
permissions:
13+
# Used by check_maintainer
14+
contents: read
15+
with:
16+
actor: ${{ github.event.pull_request.user.login }}
17+
is_remote: true
18+
19+
notify:
20+
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
21+
needs: check_maintainer
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Discord Webhook Action
25+
uses: tsickert/[email protected]
26+
with:
27+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
28+
embed-author-name: ${{ github.event.pull_request.user.login }}
29+
embed-author-url: ${{ github.event.pull_request.user.html_url }}
30+
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
31+
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
32+
embed-description: ${{ github.event.pull_request.body }}
33+
embed-url: ${{ github.event.pull_request.html_url }}
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Label Core Team PRs
2+
3+
on:
4+
pull_request:
5+
6+
permissions: {}
7+
8+
env:
9+
TZ: /usr/share/zoneinfo/America/Los_Angeles
10+
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
11+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
12+
13+
jobs:
14+
check_maintainer:
15+
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
16+
permissions:
17+
# Used by check_maintainer
18+
contents: read
19+
with:
20+
actor: ${{ github.event.pull_request.user.login }}
21+
is_remote: true
22+
23+
label:
24+
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
25+
runs-on: ubuntu-latest
26+
needs: check_maintainer
27+
permissions:
28+
# Used to add labels on issues
29+
issues: write
30+
# Used to add labels on PRs
31+
pull-requests: write
32+
steps:
33+
- name: Label PR as React Core Team
34+
uses: actions/github-script@v7
35+
with:
36+
script: |
37+
github.rest.issues.addLabels({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
issue_number: ${{ github.event.number }},
41+
labels: ['React Core Team']
42+
});

.github/workflows/site_lint.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,31 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99

10+
permissions: {}
11+
1012
jobs:
1113
lint:
1214
runs-on: ubuntu-latest
1315

1416
name: Lint on node 20.x and ubuntu-latest
1517

1618
steps:
17-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@v4
1820
- name: Use Node.js 20.x
19-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2022
with:
2123
node-version: 20.x
24+
cache: yarn
25+
cache-dependency-path: yarn.lock
26+
27+
- name: Restore cached node_modules
28+
uses: actions/cache@v4
29+
with:
30+
path: '**/node_modules'
31+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
2232

23-
- name: Install deps and build (with cache)
24-
uses: bahmutov/npm-install@v1.8.32
33+
- name: Install deps
34+
run: yarn install --frozen-lockfile
2535

2636
- name: Lint codebase
2737
run: yarn ci-check

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ yarn-error.log*
3636

3737
# external fonts
3838
public/fonts/**/Optimistic_*.woff2
39+
40+
# rss
41+
public/rss.xml

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Ignore this rule if you're specifically describing an experimental proposal. Mak
7979
- Use semicolons.
8080
- No space between function names and parens (`method() {}` not `method () {}`).
8181
- When in doubt, use the default style favored by [Prettier](https://prettier.io/playground/).
82+
- Always capitalize React concepts such as Hooks, Effects, and Transitions.
8283

8384
### Highlighting
8485

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This repo contains the source code and documentation powering [cs.react.dev](htt
77
### Prerequisites
88

99
1. Git
10-
1. Node: any 12.x version starting with v12.0.0 or greater
10+
1. Node: any version starting with v16.8.0 or greater
1111
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
1212
1. A fork of the repo (for any contributions)
1313
1. A clone of the [cs.react.dev repo](https://github.com/reactjs/cs.react.dev) on your local machine

colors.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
tertiary: '#5E687E', // gray-50
1212
'tertiary-dark': '#99A1B3', // gray-30
1313
link: '#087EA4', // blue-50
14-
'link-dark': '#149ECA', // blue-40
14+
'link-dark': '#58C4DC', // blue-40
1515
syntax: '#EBECF0', // gray-10
1616
wash: '#FFFFFF',
1717
'wash-dark': '#23272F', // gray-90
@@ -23,6 +23,8 @@ module.exports = {
2323
'border-dark': '#343A46', // gray-80
2424
'secondary-button': '#EBECF0', // gray-10
2525
'secondary-button-dark': '#404756', // gray-70
26+
brand: '#087EA4', // blue-40
27+
'brand-dark': '#58C4DC', // blue-40
2628

2729
// Gray
2830
'gray-95': '#16181D',

next-env.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference types="next/navigation-types/compat/navigation" />
34

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

next.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ 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,
1412
scrollRestoration: true,
15-
legacyBrowsers: false,
13+
reactCompiler: true,
1614
},
1715
env: {},
1816
webpack: (config, {dev, isServer, ...options}) => {

package.json

+18-14
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,30 @@
1515
"prettier:diff": "yarn nit:source",
1616
"lint-heading-ids": "node scripts/headingIdLinter.js",
1717
"fix-headings": "node scripts/headingIdLinter.js --fix",
18-
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids",
18+
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss",
1919
"tsc": "tsc --noEmit",
2020
"start": "next start",
21-
"postinstall": "patch-package && (is-ci || husky install .husky)",
22-
"check-all": "npm-run-all prettier lint:fix tsc"
21+
"postinstall": "is-ci || husky install .husky",
22+
"check-all": "npm-run-all prettier lint:fix tsc rss",
23+
"rss": "node scripts/generateRss.js"
2324
},
2425
"dependencies": {
2526
"@codesandbox/sandpack-react": "2.13.5",
26-
"@docsearch/css": "3.0.0-alpha.41",
27-
"@docsearch/react": "3.0.0-alpha.41",
27+
"@docsearch/css": "^3.8.3",
28+
"@docsearch/react": "^3.8.3",
2829
"@headlessui/react": "^1.7.0",
30+
"@radix-ui/react-context-menu": "^2.1.5",
2931
"body-scroll-lock": "^3.1.3",
3032
"classnames": "^2.2.6",
3133
"date-fns": "^2.16.1",
3234
"debounce": "^1.2.1",
3335
"github-slugger": "^1.3.0",
34-
"next": "^13.4.1",
36+
"next": "15.1.0",
3537
"next-remote-watch": "^1.0.0",
3638
"parse-numeric-range": "^1.2.0",
37-
"react": "^0.0.0-experimental-16d053d59-20230506",
39+
"react": "^19.0.0",
3840
"react-collapsed": "4.0.4",
39-
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
41+
"react-dom": "^19.0.0",
4042
"remark-frontmatter": "^4.0.1",
4143
"remark-gfm": "^3.0.1"
4244
},
@@ -52,20 +54,22 @@
5254
"@types/mdx-js__react": "^1.5.2",
5355
"@types/node": "^14.6.4",
5456
"@types/parse-numeric-range": "^0.0.1",
55-
"@types/react": "^18.0.9",
56-
"@types/react-dom": "^18.0.5",
57+
"@types/react": "^19.0.0",
58+
"@types/react-dom": "^19.0.0",
5759
"@typescript-eslint/eslint-plugin": "^5.36.2",
5860
"@typescript-eslint/parser": "^5.36.2",
5961
"asyncro": "^3.0.0",
6062
"autoprefixer": "^10.4.2",
6163
"babel-eslint": "10.x",
64+
"babel-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
6265
"eslint": "7.x",
6366
"eslint-config-next": "12.0.3",
6467
"eslint-config-react-app": "^5.2.1",
6568
"eslint-plugin-flowtype": "4.x",
6669
"eslint-plugin-import": "2.x",
6770
"eslint-plugin-jsx-a11y": "6.x",
6871
"eslint-plugin-react": "7.x",
72+
"eslint-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
6973
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",
7074
"fs-extra": "^9.0.1",
7175
"globby": "^11.0.1",
@@ -76,7 +80,6 @@
7680
"mdast-util-to-string": "^1.1.0",
7781
"metro-cache": "0.72.2",
7882
"npm-run-all": "^4.1.5",
79-
"patch-package": "^6.2.2",
8083
"postcss": "^8.4.5",
8184
"postcss-flexbugs-fixes": "4.2.1",
8285
"postcss-preset-env": "^6.7.0",
@@ -92,12 +95,12 @@
9295
"retext-smartypants": "^4.0.0",
9396
"rss": "^1.2.2",
9497
"tailwindcss": "^3.4.1",
95-
"typescript": "^4.0.2",
98+
"typescript": "^5.7.2",
9699
"unist-util-visit": "^2.0.3",
97100
"webpack-bundle-analyzer": "^4.5.0"
98101
},
99102
"engines": {
100-
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
103+
"node": ">=16.8.0"
101104
},
102105
"nextBundleAnalysis": {
103106
"budget": null,
@@ -107,5 +110,6 @@
107110
"lint-staged": {
108111
"*.{js,ts,jsx,tsx,css}": "yarn prettier",
109112
"src/**/*.md": "yarn fix-headings"
110-
}
113+
},
114+
"packageManager": "[email protected]"
111115
}

0 commit comments

Comments
 (0)