Skip to content

Commit d5f878a

Browse files
Merge pull request #521 from reactjs/sync-366b5fbd
2 parents 3f81940 + e2f1831 commit d5f878a

File tree

334 files changed

+29832
-2784
lines changed

Some content is hidden

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

334 files changed

+29832
-2784
lines changed

.eslintrc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,36 @@
22
"root": true,
33
"extends": "next/core-web-vitals",
44
"parser": "@typescript-eslint/parser",
5-
"plugins": ["@typescript-eslint", "eslint-plugin-react-compiler"],
5+
"plugins": ["@typescript-eslint", "eslint-plugin-react-compiler", "local-rules"],
66
"rules": {
77
"no-unused-vars": "off",
88
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
99
"react-hooks/exhaustive-deps": "error",
1010
"react/no-unknown-property": ["error", {"ignore": ["meta"]}],
11-
"react-compiler/react-compiler": "error"
11+
"react-compiler/react-compiler": "error",
12+
"local-rules/lint-markdown-code-blocks": "error"
1213
},
1314
"env": {
1415
"node": true,
1516
"commonjs": true,
1617
"browser": true,
1718
"es6": true
18-
}
19+
},
20+
"overrides": [
21+
{
22+
"files": ["src/content/**/*.md"],
23+
"parser": "./eslint-local-rules/parser",
24+
"parserOptions": {
25+
"sourceType": "module"
26+
},
27+
"rules": {
28+
"no-unused-vars": "off",
29+
"@typescript-eslint/no-unused-vars": "off",
30+
"react-hooks/exhaustive-deps": "off",
31+
"react/no-unknown-property": "off",
32+
"react-compiler/react-compiler": "off",
33+
"local-rules/lint-markdown-code-blocks": "error"
34+
}
35+
}
36+
]
1937
}

.github/workflows/analyze.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ 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
@@ -23,7 +25,7 @@ jobs:
2325
- name: Restore cached node_modules
2426
uses: actions/cache@v4
2527
with:
26-
path: "**/node_modules"
28+
path: '**/node_modules'
2729
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
2830

2931
- name: Install deps
@@ -55,7 +57,7 @@ jobs:
5557
name: bundle_analysis.json
5658

5759
- name: Download base branch bundle stats
58-
uses: dawidd6/action-download-artifact@v2
60+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
5961
if: success() && github.event.number
6062
with:
6163
workflow: analyze.yml

.github/workflows/analyze_comment.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ 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+
contents: read
11+
issues: write
12+
pull-requests: write
13+
914
jobs:
1015
comment:
1116
runs-on: ubuntu-latest
@@ -14,15 +19,15 @@ jobs:
1419
github.event.workflow_run.conclusion == 'success' }}
1520
steps:
1621
- name: Download base branch bundle stats
17-
uses: dawidd6/action-download-artifact@v2
22+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
1823
with:
1924
workflow: analyze.yml
2025
run_id: ${{ github.event.workflow_run.id }}
2126
name: analysis_comment.txt
2227
path: analysis_comment.txt
2328

2429
- name: Download PR number
25-
uses: dawidd6/action-download-artifact@v2
30+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
2631
with:
2732
workflow: analyze.yml
2833
run_id: ${{ github.event.workflow_run.id }}
@@ -48,7 +53,7 @@ jobs:
4853
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
4954
5055
- name: Comment
51-
uses: marocchino/sticky-pull-request-comment@v2
56+
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
5257
with:
5358
header: next-bundle-analysis
5459
number: ${{ steps.get-comment-body.outputs.pr-number }}

.github/workflows/discord_notify.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ name: Discord Notify
22

33
on:
44
pull_request_target:
5-
types: [ labeled ]
5+
types: [opened, ready_for_review]
6+
7+
permissions: {}
68

79
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+
818
notify:
9-
if: ${{ github.event.label.name == 'React Core Team' }}
19+
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
20+
needs: check_maintainer
1021
runs-on: ubuntu-latest
1122
steps:
1223
- name: Discord Webhook Action
@@ -18,4 +29,4 @@ jobs:
1829
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
1930
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
2031
embed-description: ${{ github.event.pull_request.body }}
21-
embed-url: ${{ github.event.pull_request.html_url }}
32+
embed-url: ${{ github.event.pull_request.html_url }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Label Core Team PRs
2+
3+
on:
4+
pull_request_target:
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+
22+
label:
23+
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
24+
runs-on: ubuntu-latest
25+
needs: check_maintainer
26+
permissions:
27+
# Used to add labels on issues
28+
issues: write
29+
# Used to add labels on PRs
30+
pull-requests: write
31+
steps:
32+
- name: Label PR as React Core Team
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
github.rest.issues.addLabels({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
issue_number: ${{ github.event.number }},
40+
labels: ['React Core Team']
41+
});

.github/workflows/site_lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99

10+
permissions: {}
11+
1012
jobs:
1113
lint:
1214
runs-on: ubuntu-latest
@@ -25,7 +27,7 @@ jobs:
2527
- name: Restore cached node_modules
2628
uses: actions/cache@v4
2729
with:
28-
path: "**/node_modules"
30+
path: '**/node_modules'
2931
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
3032

3133
- name: Install deps

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
/node_modules
4+
node_modules
55
/.pnp
66
.pnp.js
77

colors.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
18
/*
29
* Copyright (c) Facebook, Inc. and its affiliates.
310
*/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```jsx
2+
import {useState} from 'react';
3+
function Counter() {
4+
const [count, setCount] = useState(0);
5+
setCount(count + 1);
6+
return <div>{count}</div>;
7+
}
8+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```jsx title="Counter" {expectedErrors: {'react-compiler': [99]}} {expectedErrors: {'react-compiler': [2]}}
2+
import {useState} from 'react';
3+
function Counter() {
4+
const [count, setCount] = useState(0);
5+
setCount(count + 1);
6+
return <div>{count}</div>;
7+
}
8+
```

0 commit comments

Comments
 (0)