Skip to content

Commit 02a0ef4

Browse files
committed
Update
[ghstack-poisoned]
2 parents 8ef92e3 + 513ab05 commit 02a0ef4

File tree

96 files changed

+5324
-3606
lines changed

Some content is hidden

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

96 files changed

+5324
-3606
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,10 @@
11
version: 2
22
updates:
33
- package-ecosystem: "npm"
4-
directory: "/fixtures/art"
4+
directories:
5+
- "/fixtures/*"
56
schedule:
6-
interval: "weekly"
7-
open-pull-requests-limit: 0
8-
- package-ecosystem: "npm"
9-
directory: "/fixtures/attribute-behavior"
10-
schedule:
11-
interval: "weekly"
12-
open-pull-requests-limit: 0
13-
- package-ecosystem: "npm"
14-
directory: "/fixtures/concurrent"
15-
schedule:
16-
interval: "weekly"
17-
open-pull-requests-limit: 0
18-
- package-ecosystem: "npm"
19-
directory: "/fixtures/devtools"
20-
schedule:
21-
interval: "weekly"
22-
open-pull-requests-limit: 0
23-
- package-ecosystem: "npm"
24-
directory: "/fixtures/dom"
25-
schedule:
26-
interval: "weekly"
27-
open-pull-requests-limit: 0
28-
- package-ecosystem: "npm"
29-
directory: "/fixtures/eslint"
30-
schedule:
31-
interval: "weekly"
32-
open-pull-requests-limit: 0
33-
- package-ecosystem: "npm"
34-
directory: "/fixtures/expiration"
35-
schedule:
36-
interval: "weekly"
37-
open-pull-requests-limit: 0
38-
- package-ecosystem: "npm"
39-
directory: "/fixtures/fiber-debugger"
40-
schedule:
41-
interval: "weekly"
42-
open-pull-requests-limit: 0
43-
- package-ecosystem: "npm"
44-
directory: "/fixtures/fiber-triangle"
45-
schedule:
46-
interval: "weekly"
47-
open-pull-requests-limit: 0
48-
- package-ecosystem: "npm"
49-
directory: "/fixtures/fizz"
50-
schedule:
51-
interval: "weekly"
52-
open-pull-requests-limit: 0
53-
- package-ecosystem: "npm"
54-
directory: "/fixtures/fizz-ssr-browser"
55-
schedule:
56-
interval: "weekly"
57-
open-pull-requests-limit: 0
58-
- package-ecosystem: "npm"
59-
directory: "/fixtures/flight"
60-
schedule:
61-
interval: "weekly"
62-
open-pull-requests-limit: 0
63-
- package-ecosystem: "npm"
64-
directory: "/fixtures/flight-browser"
65-
schedule:
66-
interval: "weekly"
67-
open-pull-requests-limit: 0
68-
- package-ecosystem: "npm"
69-
directory: "/fixtures/flight-esm"
70-
schedule:
71-
interval: "weekly"
72-
open-pull-requests-limit: 0
73-
- package-ecosystem: "npm"
74-
directory: "/fixtures/legacy-jsx-runtimes"
75-
schedule:
76-
interval: "weekly"
77-
open-pull-requests-limit: 0
78-
- package-ecosystem: "npm"
79-
directory: "/fixtures/nesting"
80-
schedule:
81-
interval: "weekly"
82-
open-pull-requests-limit: 0
83-
- package-ecosystem: "npm"
84-
directory: "/fixtures/packaging"
85-
schedule:
86-
interval: "weekly"
87-
open-pull-requests-limit: 0
88-
- package-ecosystem: "npm"
89-
directory: "/fixtures/scheduler"
90-
schedule:
91-
interval: "weekly"
92-
open-pull-requests-limit: 0
93-
- package-ecosystem: "npm"
94-
directory: "/fixtures/ssr"
95-
schedule:
96-
interval: "weekly"
97-
open-pull-requests-limit: 0
98-
- package-ecosystem: "npm"
99-
directory: "/fixtures/ssr-2"
100-
schedule:
101-
interval: "weekly"
102-
open-pull-requests-limit: 0
103-
- package-ecosystem: "npm"
104-
directory: "/fixtures/stacks"
105-
schedule:
106-
interval: "weekly"
7+
interval: "monthly"
1078
open-pull-requests-limit: 0
9+
ignore:
10+
- dependency-name: "*"

.github/workflows/compiler_playground.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
defaults:
1717
run:
18-
working-directory: compiler
18+
working-directory: compiler/apps/playground
1919

2020
jobs:
2121
playground:
@@ -27,13 +27,17 @@ jobs:
2727
with:
2828
node-version-file: '.nvmrc'
2929
cache: yarn
30-
cache-dependency-path: compiler/yarn.lock
30+
cache-dependency-path: compiler/**/yarn.lock
3131
- name: Restore cached node_modules
3232
uses: actions/cache@v4
3333
id: node_modules
3434
with:
3535
path: "**/node_modules"
3636
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
37-
- run: yarn install --frozen-lockfile
37+
- name: yarn install compiler
38+
run: yarn install --frozen-lockfile
39+
working-directory: compiler
40+
- name: yarn install playground
41+
run: yarn install --frozen-lockfile
3842
- run: npx playwright install --with-deps chromium
39-
- run: yarn workspace playground test
43+
- run: yarn test

.github/workflows/runtime_commit_artifacts.yml

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
working-directory: scripts/release
8383
- name: Download artifacts for base revision
8484
run: |
85-
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.event.workflow_run.head_sha }}
85+
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }}
8686
- name: Display structure of build
8787
run: ls -R build
8888
- name: Strip @license from eslint plugin and react-refresh
@@ -145,9 +145,9 @@ jobs:
145145
ls -R ./compiled-rn
146146
- name: Add REVISION files
147147
run: |
148-
echo ${{ github.event.workflow_run.head_sha }} >> ./compiled/facebook-www/REVISION
148+
echo ${{ github.sha }} >> ./compiled/facebook-www/REVISION
149149
cp ./compiled/facebook-www/REVISION ./compiled/facebook-www/REVISION_TRANSFORMS
150-
echo ${{ github.event.workflow_run.head_sha}} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
150+
echo ${{ github.sha}} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
151151
- name: "Get current version string"
152152
id: get_current_version
153153
run: |
@@ -171,7 +171,7 @@ jobs:
171171

172172
commit_www_artifacts:
173173
needs: download_artifacts
174-
if: ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0') || github.ref == 'refs/heads/meta-www' }}
174+
if: inputs.force == true || (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0')
175175
runs-on: ubuntu-latest
176176
steps:
177177
- uses: actions/checkout@v4
@@ -201,7 +201,7 @@ jobs:
201201
grep -rl "$CURRENT_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$CURRENT_VERSION_MODERN/$LAST_VERSION_MODERN/g"
202202
grep -rl "$CURRENT_VERSION_MODERN" ./compiled || echo "Modern version reverted"
203203
- name: Check for changes
204-
if: !inputs.force
204+
if: inputs.force != true
205205
id: check_should_commit
206206
run: |
207207
echo "Full git status"
@@ -219,7 +219,7 @@ jobs:
219219
echo "should_commit=false" >> "$GITHUB_OUTPUT"
220220
fi
221221
- name: Re-apply version changes
222-
if: inputs.force || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '')
222+
if: inputs.force == true || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '')
223223
env:
224224
CURRENT_VERSION_CLASSIC: ${{ needs.download_artifacts.outputs.current_version_classic }}
225225
CURRENT_VERSION_MODERN: ${{ needs.download_artifacts.outputs.current_version_modern }}
@@ -236,26 +236,26 @@ jobs:
236236
grep -rl "$LAST_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$LAST_VERSION_MODERN/$CURRENT_VERSION_MODERN/g"
237237
grep -rl "$LAST_VERSION_MODERN" ./compiled || echo "Classic version re-applied"
238238
- name: Will commit these changes
239-
if: inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
239+
if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
240240
run: |
241241
echo ":"
242242
git status -u
243243
- name: Commit changes to branch
244-
if: inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
245-
uses: stefanzweifel/git-auto-commit-action@v4
244+
if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
245+
uses: stefanzweifel/git-auto-commit-action@v5
246246
with:
247247
commit_message: |
248-
${{ github.event.workflow_run.head_commit.message }}
248+
${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
249249
250-
DiffTrain build for [${{ github.event.workflow_run.head_sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }})
250+
DiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha }})
251251
branch: builds/facebook-www
252-
commit_user_name: ${{ github.event.workflow_run.triggering_actor.login }}
253-
commit_user_email: ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run.triggering_actor.login) }}
252+
commit_user_name: ${{ github.triggering_actor }}
253+
commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
254254
create_branch: true
255255

256256
commit_fbsource_artifacts:
257257
needs: download_artifacts
258-
if: ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
258+
if: inputs.force == true || (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0')
259259
runs-on: ubuntu-latest
260260
steps:
261261
- uses: actions/checkout@v4
@@ -278,7 +278,7 @@ jobs:
278278
grep -rl "$CURRENT_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$CURRENT_VERSION/$LAST_VERSION/g"
279279
grep -rl "$CURRENT_VERSION" ./compiled-rn || echo "Version reverted"
280280
- name: Check for changes
281-
if: !inputs.force
281+
if: inputs.force != 'true'
282282
id: check_should_commit
283283
run: |
284284
echo "Full git status"
@@ -297,7 +297,7 @@ jobs:
297297
echo "should_commit=false" >> "$GITHUB_OUTPUT"
298298
fi
299299
- name: Re-apply version changes
300-
if: inputs.force || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '')
300+
if: inputs.force == true || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '')
301301
env:
302302
CURRENT_VERSION: ${{ needs.download_artifacts.outputs.current_version_rn }}
303303
LAST_VERSION: ${{ needs.download_artifacts.outputs.last_version_rn }}
@@ -307,12 +307,12 @@ jobs:
307307
grep -rl "$LAST_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$LAST_VERSION/$CURRENT_VERSION/g"
308308
grep -rl "$LAST_VERSION" ./compiled-rn || echo "Version re-applied"
309309
- name: Add files for signing
310-
if: inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
310+
if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
311311
run: |
312312
echo ":"
313313
git add .
314314
- name: Signing files
315-
if: inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
315+
if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
316316
uses: actions/github-script@v7
317317
with:
318318
script: |
@@ -366,8 +366,9 @@ jobs:
366366
console.log('Signing files in directory:', directory);
367367
try {
368368
const result = execSync(`git status --porcelain ${directory}`, {encoding: 'utf8'});
369+
console.log(result);
369370
370-
// Parse the git status output to get file paths
371+
// Parse the git status output to get file paths!
371372
const files = result.split('\n').filter(file => file.endsWith('.js'));
372373
373374
if (files.length === 0) {
@@ -376,7 +377,14 @@ jobs:
376377
);
377378
} else {
378379
files.forEach(line => {
379-
const file = line.slice(3).trim();
380+
let file = null;
381+
if (line.startsWith('D ')) {
382+
return;
383+
} else if (line.startsWith('R ')) {
384+
file = line.slice(line.indexOf('->') + 3);
385+
} else {
386+
file = line.slice(3).trim();
387+
}
380388
if (file) {
381389
console.log(' Signing file:', file);
382390
const originalContents = fs.readFileSync(file, 'utf8');
@@ -395,19 +403,19 @@ jobs:
395403
console.error('Error signing files:', e);
396404
}
397405
- name: Will commit these changes
398-
if: inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
406+
if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
399407
run: |
400408
git add .
401409
git status
402410
- name: Commit changes to branch
403-
if: inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
404-
uses: stefanzweifel/git-auto-commit-action@v4
411+
if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
412+
uses: stefanzweifel/git-auto-commit-action@v5
405413
with:
406414
commit_message: |
407-
${{ github.event.workflow_run.head_commit.message }}
415+
${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
408416
409-
DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }}.
417+
DiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha }})
410418
branch: builds/facebook-fbsource
411-
commit_user_name: ${{ github.event.workflow_run.triggering_actor.login }}
412-
commit_user_email: ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run.triggering_actor.login) }}
419+
commit_user_name: ${{ github.triggering_actor }}
420+
commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
413421
create_branch: true

compiler/apps/playground/app/layout.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
import '../styles/globals.css';
99

10-
export default function RootLayout({children}: {children: React.ReactNode}) {
10+
export default function RootLayout({
11+
children,
12+
}: {
13+
children: React.ReactNode;
14+
}): JSX.Element {
1115
'use no memo';
1216
return (
1317
<html lang="en">

compiler/apps/playground/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {SnackbarProvider} from 'notistack';
1111
import {Editor, Header, StoreProvider} from '../components';
1212
import MessageSnackbar from '../components/Message';
1313

14-
export default function Hoot() {
14+
export default function Page(): JSX.Element {
1515
return (
1616
<StoreProvider>
1717
<SnackbarProvider

compiler/apps/playground/components/Editor/EditorImpl.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343
import {printFunctionWithOutlined} from 'babel-plugin-react-compiler/src/HIR/PrintHIR';
4444
import {printReactiveFunctionWithOutlined} from 'babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction';
4545

46-
function parseInput(input: string, language: 'flow' | 'typescript') {
46+
function parseInput(input: string, language: 'flow' | 'typescript'): any {
4747
// Extract the first line to quickly check for custom test directives
4848
if (language === 'flow') {
4949
return HermesParser.parse(input, {
@@ -181,9 +181,9 @@ function getFunctionIdentifier(
181181
}
182182

183183
function compile(source: string): [CompilerOutput, 'flow' | 'typescript'] {
184-
const results = new Map<string, PrintedCompilerPipelineValue[]>();
184+
const results = new Map<string, Array<PrintedCompilerPipelineValue>>();
185185
const error = new CompilerError();
186-
const upsert = (result: PrintedCompilerPipelineValue) => {
186+
const upsert: (result: PrintedCompilerPipelineValue) => void = result => {
187187
const entry = results.get(result.name);
188188
if (Array.isArray(entry)) {
189189
entry.push(result);
@@ -273,13 +273,17 @@ function compile(source: string): [CompilerOutput, 'flow' | 'typescript'] {
273273
}
274274
}
275275
} catch (err) {
276-
// error might be an invariant violation or other runtime error
277-
// (i.e. object shape that is not CompilerError)
276+
/**
277+
* error might be an invariant violation or other runtime error
278+
* (i.e. object shape that is not CompilerError)
279+
*/
278280
if (err instanceof CompilerError && err.details.length > 0) {
279281
error.details.push(...err.details);
280282
} else {
281-
// Handle unexpected failures by logging (to get a stack trace)
282-
// and reporting
283+
/**
284+
* Handle unexpected failures by logging (to get a stack trace)
285+
* and reporting
286+
*/
283287
console.error(err);
284288
error.details.push(
285289
new CompilerErrorDetail({
@@ -297,7 +301,7 @@ function compile(source: string): [CompilerOutput, 'flow' | 'typescript'] {
297301
return [{kind: 'ok', results}, language];
298302
}
299303

300-
export default function Editor() {
304+
export default function Editor(): JSX.Element {
301305
const store = useStore();
302306
const deferredStore = useDeferredValue(store);
303307
const dispatchStore = useStoreDispatch();

0 commit comments

Comments
 (0)