Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from facebook:main #107

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ae3190c
React DevTools 6.1.0 -> 6.1.1 (#32326)
hoxyq Feb 7, 2025
44c3d3d
fix[react-devtools-standalone]: define missing globals (#32327)
hoxyq Feb 7, 2025
8759c5c
Ship enableFabricCompleteRootInCommitPhase (#32318)
jackpope Feb 7, 2025
76e44c2
[compiler] Improve error messages for unhandled terminal and instruct…
inottn Feb 7, 2025
989b0cc
[compiler] Add simple walltime measurement (#32331)
poteto Feb 7, 2025
bc78de3
[ci] Use 'opened' event for discord notifications (#32332)
poteto Feb 7, 2025
569c3b2
[ci] Combine sizebot jobs (#32333)
poteto Feb 7, 2025
7588b6b
[ci] Disallow PRs against builds branch (#32335)
poteto Feb 7, 2025
062fb31
[ci] Fix typo (#32337)
poteto Feb 7, 2025
594ea53
Remove useActionState Hook export from experimental react-server cond…
sebmarkbage Feb 9, 2025
93b5836
Trigger Discord notification when draft PR is set to "ready for revie…
unstubbable Feb 9, 2025
3dd2c62
[react-native] fix divergence in synced code (#32348)
poteto Feb 10, 2025
cd90a4d
[react-native] Suppress Flow nonstrict-import check in ReactNativeTyp…
poteto Feb 10, 2025
0a7dc1b
[devtools] Introduce REACT_DEVTOOLS_PORT for the standalone react-dev…
brendo Feb 11, 2025
899e3d1
[crud] Narrow resource type (#32203)
poteto Feb 11, 2025
0461c0d
[crud] Rename useResourceEffect flag (#32204)
poteto Feb 11, 2025
2c5fd26
[crud] Merge useResourceEffect into useEffect (#32205)
poteto Feb 11, 2025
a69b80d
[crud] Remove useResourceEffect (#32206)
poteto Feb 11, 2025
192555b
Added dev-only warning for null/undefined create in use*Effect (#32355)
JoshuaKGoldberg Feb 11, 2025
f83903b
[RN] Set up test to create public instances lazily in Fabric (#32363)
rubennorte Feb 12, 2025
d814852
[compiler] Upgrade esbuild (#32368)
poteto Feb 12, 2025
5a78dd7
[ci] Also notify compiler ready for review PRs (#32371)
poteto Feb 12, 2025
e0131f1
fix(devtools): Handle nullish values passed to `formatConsoleArgument…
franky47 Feb 13, 2025
cbbe866
fix value formatting of proxies of class instances (#30880)
LoganDark Feb 13, 2025
c6a7e18
Ensure `captureOwnerStack` returns `null` when no stack is available …
eps1lon Feb 13, 2025
ed8b68d
Stop exporting dev-only methods in OSS production builds (#32200)
eps1lon Feb 13, 2025
32b0cad
Enable owner stacks in Canary builds (#32053)
eps1lon Feb 13, 2025
a53da6a
Add useSwipeTransition Hook Behind Experimental Flag (#32373)
sebmarkbage Feb 13, 2025
e670e72
Change TouchedViewDataAtPoint type in ReactNativeTypes to use support…
coado Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/compiler_discord_notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: (Compiler) Discord Notify

on:
pull_request_target:
types: [labeled]
types: [opened, ready_for_review]
paths:
- compiler/**
- .github/workflows/compiler_**.yml
Expand All @@ -14,7 +14,7 @@ jobs:
actor: ${{ github.event.pull_request.user.login }}

notify:
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' && github.event.label.name == 'React Core Team' }}
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
needs: check_maintainer
runs-on: ubuntu-latest
steps:
Expand Down
47 changes: 7 additions & 40 deletions .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,10 @@ jobs:
RELEASE_CHANNEL: experimental

# ----- SIZEBOT -----
download_base_build_for_sizebot:
if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' }}
name: Download base build for sizebot
sizebot:
if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
name: Run sizebot
needs: [build_and_lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -603,50 +604,23 @@ jobs:
id: node_modules
with:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile
working-directory: scripts/release
- name: Download artifacts for base revision
run: |
git fetch origin main
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse ${{ github.event.pull_request.base.sha }})
mv ./build ./base-build
# TODO: The `download-experimental-build` script copies the npm
# packages into the `node_modules` directory. This is a historical
# quirk of how the release script works. Let's pretend they
# don't exist.
- name: Delete extraneous files
run: rm -rf ./base-build/node_modules
- name: Display structure of base-build
- name: Display structure of base-build from origin/main
run: ls -R base-build
- name: Archive base-build
uses: actions/upload-artifact@v4
with:
name: base-build
path: base-build

sizebot:
name: Run sizebot
needs: [build_and_lint, download_base_build_for_sizebot]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
Expand All @@ -662,13 +636,6 @@ jobs:
node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
- name: Display structure of build for PR
run: ls -R build
- name: Restore archived base-build from origin/main
uses: actions/download-artifact@v4
with:
name: base-build
path: base-build
- name: Display structure of base-build from origin/main
run: ls -R base-build
- run: echo ${{ github.sha }} >> build/COMMIT_SHA
- run: node ./scripts/tasks/danger
- name: Archive sizebot results
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/runtime_discord_notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: (Runtime) Discord Notify

on:
pull_request_target:
types: [labeled]
types: [opened, ready_for_review]
paths-ignore:
- compiler/**
- .github/workflows/compiler_**.yml
Expand All @@ -14,7 +14,7 @@ jobs:
actor: ${{ github.event.pull_request.user.login }}

notify:
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' && github.event.label.name == 'React Core Team' }}
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
needs: check_maintainer
runs-on: ubuntu-latest
steps:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/shared_close_direct_sync_branch_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: (Shared) Close Direct Sync Branch PRs

on:
pull_request:
branches:
- 'builds/facebook-**'

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

jobs:
close_pr:
runs-on: ubuntu-latest
steps:
- name: Close PR
uses: actions/github-script@v7
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const pullNumber = ${{ github.event.number }};

await github.rest.pulls.createReview({
owner,
repo,
pull_number: pullNumber,
body: 'Do not land changes to `${{ github.event.pull_request.base.ref }}`. Please re-open your PR targeting `main` instead.',
event: 'REQUEST_CHANGES'
});
await github.rest.pulls.update({
owner,
repo,
pull_number: pullNumber,
state: 'closed'
});
2 changes: 1 addition & 1 deletion compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"devDependencies": {
"@tsconfig/strictest": "^2.0.5",
"concurrently": "^7.4.0",
"esbuild": "^0.24.2",
"esbuild": "^0.25.0",
"folder-hash": "^4.0.4",
"npm-dts": "^1.3.13",
"object-assign": "^4.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
*/

import type * as BabelCore from '@babel/core';
import {compileProgram, parsePluginOptions} from '../Entrypoint';
import {compileProgram, Logger, parsePluginOptions} from '../Entrypoint';
import {
injectReanimatedFlag,
pipelineUsesReanimatedPlugin,
} from '../Entrypoint/Reanimated';

const ENABLE_REACT_COMPILER_TIMINGS =
process.env['ENABLE_REACT_COMPILER_TIMINGS'] === '1';

/*
* The React Forget Babel Plugin
* @param {*} _babel
Expand All @@ -28,35 +31,65 @@ export default function BabelPluginReactCompiler(
* prior to B, if A does not have a Program visitor and B does, B will run first. We always
* want Forget to run true to source as possible.
*/
Program(prog, pass): void {
let opts = parsePluginOptions(pass.opts);
const isDev =
(typeof __DEV__ !== 'undefined' && __DEV__ === true) ||
process.env['NODE_ENV'] === 'development';
if (
opts.enableReanimatedCheck === true &&
pipelineUsesReanimatedPlugin(pass.file.opts.plugins)
) {
opts = injectReanimatedFlag(opts);
}
if (
opts.environment.enableResetCacheOnSourceFileChanges !== false &&
isDev
) {
opts = {
...opts,
environment: {
...opts.environment,
enableResetCacheOnSourceFileChanges: true,
},
};
}
compileProgram(prog, {
opts,
filename: pass.filename ?? null,
comments: pass.file.ast.comments ?? [],
code: pass.file.code,
});
Program: {
enter(prog, pass): void {
const filename = pass.filename ?? 'unknown';
if (ENABLE_REACT_COMPILER_TIMINGS === true) {
performance.mark(`${filename}:start`, {
detail: 'BabelPlugin:Program:start',
});
}
let opts = parsePluginOptions(pass.opts);
const isDev =
(typeof __DEV__ !== 'undefined' && __DEV__ === true) ||
process.env['NODE_ENV'] === 'development';
if (
opts.enableReanimatedCheck === true &&
pipelineUsesReanimatedPlugin(pass.file.opts.plugins)
) {
opts = injectReanimatedFlag(opts);
}
if (
opts.environment.enableResetCacheOnSourceFileChanges !== false &&
isDev
) {
opts = {
...opts,
environment: {
...opts.environment,
enableResetCacheOnSourceFileChanges: true,
},
};
}
compileProgram(prog, {
opts,
filename: pass.filename ?? null,
comments: pass.file.ast.comments ?? [],
code: pass.file.code,
});
if (ENABLE_REACT_COMPILER_TIMINGS === true) {
performance.mark(`${filename}:end`, {
detail: 'BabelPlugin:Program:end',
});
}
},
exit(_, pass): void {
if (ENABLE_REACT_COMPILER_TIMINGS === true) {
const filename = pass.filename ?? 'unknown';
const measurement = performance.measure(filename, {
start: `${filename}:start`,
end: `${filename}:end`,
detail: 'BabelPlugin:Program',
});
if ('logger' in pass.opts && pass.opts.logger != null) {
const logger: Logger = pass.opts.logger as Logger;
logger.logEvent(filename, {
kind: 'Timing',
measurement,
});
}
}
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ export type LoggerEvent =
kind: 'PipelineError';
fnLoc: t.SourceLocation | null;
data: string;
}
| {
kind: 'Timing';
measurement: PerformanceMeasure;
};

export type Logger = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ function writeTerminal(writer: Writer, terminal: ReactiveTerminal): void {
break;
}
default:
assertExhaustive(terminal, `Unhandled terminal ${terminal}`);
assertExhaustive(
terminal,
`Unhandled terminal kind \`${(terminal as any).kind}\``,
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ function* generateInstructionTypes(
break;
}
default:
assertExhaustive(value, `Unhandled instruction value kind: ${value}`);
assertExhaustive(
value,
`Unhandled instruction value kind: ${(value as any).kind}`,
);
}
}

Expand Down
Loading