Skip to content

Mirror of upstream PR #33464 #155

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

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
5d04d73
Add eager alternate.stateNode cleanup (#33161)
sammy-SC May 12, 2025
2bcf06b
[ReactFlightWebpackPlugin] Add support for .mjs file extension (#33028)
jennyscript May 13, 2025
b94603b
[Fizz] Gate rel="expect" behind enableFizzBlockingRender (#33183)
sebmarkbage May 13, 2025
997c7bc
[DevTools] Get source location from structured callsites in prepareSt…
sebmarkbage May 13, 2025
676f087
Reset currentEventTransitionLane after flushing sync work (#33159)
sebmarkbage May 13, 2025
0cac32d
[Fiber] Stash the entangled async action lane on currentEventTransiti…
sebmarkbage May 13, 2025
62d3f36
[Fiber] Trigger default transition indicator if needed (#33160)
sebmarkbage May 13, 2025
b480865
[Fiber] Always flush Default priority in the microtask if a Transitio…
sebmarkbage May 13, 2025
5944042
Implement Navigation API backed default indicator for DOM renderer (#…
sebmarkbage May 13, 2025
3a5b326
[Fiber] Trigger default indicator for isomorphic async actions with n…
sebmarkbage May 13, 2025
d85f86c
Delete stray file (#33199)
kassens May 14, 2025
63d664b
Don't consider Portals animating unless they're wrapped in a ViewTran…
sebmarkbage May 14, 2025
96eb84e
Claim the useId name space for every auto named ViewTransition (#33200)
sebmarkbage May 14, 2025
3f67d08
[Fizz] Track whether we're in a fallback on FormatContext (#33194)
sebmarkbage May 15, 2025
65b5aae
[Fizz] Add vt- prefix attributes to annotate <ViewTransition> in HTML…
sebmarkbage May 15, 2025
203df2c
[compiler] Update changelog for 19.1.0-rc.2 (#33207)
poteto May 15, 2025
08cb2d7
[ci] Log author_association (#33213)
poteto May 15, 2025
4a45ba9
[sync] Fix noop for xplat (#33214)
rickhanlonii May 15, 2025
4448b18
[eslint-plugin-react-hooks] fix exhaustive deps lint rule with compon…
kassens May 15, 2025
c250b7d
[Fizz] Should be considered complete inside onShellReady callback (#3…
sebmarkbage May 16, 2025
6060367
[Fizz] Wrap revealCompletedBoundaries in a ViewTransitions aware vers…
sebmarkbage May 17, 2025
462d08f
Move SuspenseListProps into a shared/ReactTypes (#33298)
sebmarkbage May 18, 2025
a3abf5f
[eslint-plugin-react-hooks] add experimental_autoDependenciesHooks op…
kassens May 19, 2025
5dc1b21
[Fizz] Support basic SuspenseList forwards/backwards revealOrder (#33…
sebmarkbage May 19, 2025
c6c2a52
[compiler] Fix error message for custom hooks (#33310)
josephsavona May 19, 2025
4c6967b
[Fiber] Support AsyncIterable children in SuspenseList (#33299)
sebmarkbage May 20, 2025
c4676e7
[Fizz] Handle nested SuspenseList (#33308)
sebmarkbage May 20, 2025
d38c7e1
Remove leftover Rust script (#33314)
kassens May 20, 2025
99aa685
[Fizz] Support SuspenseList revealOrder="together" (#33311)
sebmarkbage May 20, 2025
50389e1
[Fizz] Hoist hoistables to each row and transfer the dependencies to …
sebmarkbage May 20, 2025
9c7b10e
[Fizz] Clean up row that was blocked by an aborted boundary (#33318)
sebmarkbage May 21, 2025
2388481
[Fizz] Set keyPath for SuspenseList (#33320)
sebmarkbage May 21, 2025
3710c4d
Prevent errors from comment node roots with enableViewTransition (#33…
jackpope May 21, 2025
f4041aa
[Fizz] Unblock SuspenseList when prerendering (#33321)
sebmarkbage May 21, 2025
1835b3f
New children notify fragment instances in Fabric (#33093)
jackpope May 21, 2025
1c43d0a
Unify serverAct helpers (#33327)
sebmarkbage May 21, 2025
459a2c4
[compiler][gating] Experimental directive based gating (#33149)
mofeiZ May 21, 2025
99781d6
[Fizz] Track boundaries in future rows as postponed (#33329)
sebmarkbage May 22, 2025
08064ea
[Fizz] Make ViewTransition enter/exit/share null the same as none (#3…
sebmarkbage May 22, 2025
91ac1fe
[Fizz] Pass batch as argument to revealCompletedBoundaries (#33330)
sebmarkbage May 22, 2025
8ce15b0
[Fizz] Apply View Transition Name and Class to SSR:ed View Transition…
sebmarkbage May 22, 2025
13f2004
[compiler] Prepare HIRBuilder to be used by later passes (#32286)
mofeiZ May 22, 2025
abf9fd5
[compiler] Add reactive flag on scope dependencies (#33325)
mofeiZ May 22, 2025
0d07288
[compiler] Inferred effect dependencies now include optional chains (…
mofeiZ May 22, 2025
3e9db65
Fix typo in error message. (#33313)
cpojer May 22, 2025
bfaeb4a
Fix incorrect use of NoLanes in executionContext check (#33170)
0xFANGO May 23, 2025
99efc62
[eslint] Add an option to require dependencies on effect hooks (#33344)
jbrown215 May 23, 2025
6a1dfe3
Disable moveBefore experiment (#33348)
sebmarkbage May 23, 2025
c0464ae
[Fizz] Block on Suspensey Fonts during reveal (#33342)
sebmarkbage May 23, 2025
f702620
[fb-www] ship enableViewTransition (#33357)
kassens May 27, 2025
f9ae0a4
[compiler][gating] Custom opt out directives (experimental option) (#…
mofeiZ May 27, 2025
283f87f
Revert "enableViewTransition in www" (#33362)
kassens May 27, 2025
b07717d
[devtools] upgrade json5 (#33358)
rickhanlonii May 28, 2025
5717f19
[react-dom] Enforce small gap between completed navigation and defaul…
eps1lon May 28, 2025
14094f8
Allow `nonce` to be used on hoistable styles (#32461)
Andarist May 29, 2025
8b55eb4
Cleanup props diffing experiments (#33381)
javache May 30, 2025
ee76351
fix typo in compiler validation filename (#33345)
wlemahieu May 30, 2025
526dd34
[compiler][patch] Emit unary expressions instead of negative numbers …
mofeiZ Jun 2, 2025
4a1f290
[Fizz] Add Owner Stacks when render is aborted (#32735)
eps1lon Jun 2, 2025
3531b26
[scripts] Switch back to flow parser for prettier (#33414)
rickhanlonii Jun 3, 2025
2b4064e
[mcp] Add MCP tool to print out the component tree of the currently o…
jorge-cab Jun 3, 2025
1ae0a84
Use underscore instead of « » for useId algorithm (#33422)
sebmarkbage Jun 3, 2025
acee65d
[Flight] Track Awaits on I/O as Debug Info (#33388)
sebmarkbage Jun 3, 2025
3fb17d1
[Flight] Encode ReactIOInfo as its own row type (#33390)
sebmarkbage Jun 3, 2025
65a46c7
[Flight] Track the function name that was called for I/O entries (#33…
sebmarkbage Jun 3, 2025
2e9f8cd
Clear bundler cache before bundling fixtures (#33426)
eps1lon Jun 3, 2025
d8919a0
[Flight] Log "Server Requests" Track (#33394)
sebmarkbage Jun 3, 2025
45da4e0
[Flight] Track Owner on AsyncInfo and IOInfo (#33395)
sebmarkbage Jun 3, 2025
157ac57
[Flight] Include env in ReactAsyncInfo and ReactIOInfo (#33400)
sebmarkbage Jun 3, 2025
9cc74fe
[Flight] Emit the time we awaited something inside a Server Component…
sebmarkbage Jun 3, 2025
1540081
[Flight] Encode Async I/O Tasks using the Enclosing Line/Column (#33403)
sebmarkbage Jun 3, 2025
d742611
Replace Implicit Options on SuspenseList with Explicit Options (#33424)
sebmarkbage Jun 3, 2025
3705486
[Flight] Forward debugInfo from awaited instrumented Promises (#33415)
sebmarkbage Jun 4, 2025
93f1668
[Fizz] Add Node Web Streams bundle for SSR (#33441)
sebmarkbage Jun 5, 2025
b4477d3
[Flight] Add a cached 3rd-party component to the Flight fixture (#33443)
unstubbable Jun 5, 2025
876d990
CI: reduce excessive sharding
kassens Jun 6, 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
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ module.exports = {
'packages/react-devtools-shared/src/devtools/views/**/*.js',
'packages/react-devtools-shared/src/hook.js',
'packages/react-devtools-shared/src/backend/console.js',
'packages/react-devtools-shared/src/backend/fiber/renderer.js',
'packages/react-devtools-shared/src/backend/shared/DevToolsComponentStackFrame.js',
'packages/react-devtools-shared/src/frontend/utils/withPermissionsCheck.js',
],
Expand All @@ -504,6 +505,7 @@ module.exports = {
__IS_FIREFOX__: 'readonly',
__IS_EDGE__: 'readonly',
__IS_NATIVE__: 'readonly',
__IS_INTERNAL_MCP_BUILD__: 'readonly',
__IS_INTERNAL_VERSION__: 'readonly',
chrome: 'readonly',
},
Expand Down Expand Up @@ -559,6 +561,7 @@ module.exports = {
ConsoleTask: 'readonly', // TOOD: Figure out what the official name of this will be.
ReturnType: 'readonly',
AnimationFrameID: 'readonly',
WeakRef: 'readonly',
// For Flow type annotation. Only `BigInt` is valid at runtime.
bigint: 'readonly',
BigInt: 'readonly',
Expand All @@ -579,6 +582,7 @@ module.exports = {
JSONValue: 'readonly',
JSResourceReference: 'readonly',
MouseEventHandler: 'readonly',
NavigateEvent: 'readonly',
PropagationPhases: 'readonly',
PropertyDescriptor: 'readonly',
React$AbstractComponent: 'readonly',
Expand Down Expand Up @@ -608,6 +612,7 @@ module.exports = {
TimeoutID: 'readonly',
WheelEventHandler: 'readonly',
FinalizationRegistry: 'readonly',
Exclude: 'readonly',
Omit: 'readonly',
Keyframe: 'readonly',
PropertyIndexedKeyframes: 'readonly',
Expand All @@ -634,5 +639,6 @@ module.exports = {
AsyncLocalStorage: 'readonly',
async_hooks: 'readonly',
globalThis: 'readonly',
navigation: 'readonly',
},
};
1 change: 1 addition & 0 deletions .github/workflows/compiler_discord_notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
outputs:
is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }}
steps:
- run: echo ${{ github.event.pull_request.author_association }}
- name: Check is member or collaborator
id: check_is_member_or_collaborator
if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ jobs:
- "-r=stable --env=development --persistent"
- "-r=experimental --env=development --persistent"
shard:
- 1/5
- 2/5
- 3/5
- 4/5
- 5/5
- 1/2
- 2/2
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -278,7 +275,7 @@ jobs:
if: steps.node_modules.outputs.cache-hit != 'true'
- run: yarn --cwd compiler install --frozen-lockfile
if: steps.node_modules.outputs.cache-hit != 'true'
- run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}
- run: yarn test ${{ matrix.params }} --ci

# ----- BUILD -----
build_and_lint:
Expand All @@ -289,7 +286,7 @@ jobs:
fail-fast: false
matrix:
# yml is dumb. update the --total arg to yarn build if you change the number of workers
worker_id: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
worker_id: [0,1,2,3,4]
release_channel: [stable, experimental]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -322,7 +319,7 @@ jobs:
if: steps.node_modules.outputs.cache-hit != 'true'
- run: yarn --cwd compiler install --frozen-lockfile
if: steps.node_modules.outputs.cache-hit != 'true'
- run: yarn build --index=${{ matrix.worker_id }} --total=25 --r=${{ matrix.release_channel }} --ci
- run: yarn build --index=${{ matrix.worker_id }} --total=5 --r=${{ matrix.release_channel }} --ci
env:
CI: github
RELEASE_CHANNEL: ${{ matrix.release_channel }}
Expand Down Expand Up @@ -374,17 +371,6 @@ jobs:

# TODO: Test more persistent configurations?
]
shard:
- 1/10
- 2/10
- 3/10
- 4/10
- 5/10
- 6/10
- 7/10
- 8/10
- 9/10
- 10/10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -421,7 +407,7 @@ jobs:
merge-multiple: true
- name: Display structure of build
run: ls -R build
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci
- run: yarn test --build ${{ matrix.test_params }} --ci

process_artifacts_combined:
name: Process artifacts combined
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/runtime_commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ jobs:
git --no-pager diff -U0 --cached | grep '^[+-]' | head -n 100
echo "===================="
# Ignore REVISION or lines removing @generated headers.
if git diff --cached ':(exclude)*REVISION' | grep -vE "^(@@|diff|index|\-\-\-|\+\+\+|\- \* @generated SignedSource)" | grep "^[+-]" > /dev/null; then
if git diff --cached ':(exclude)*REVISION' ':(exclude)*/eslint-plugin-react-hooks/package.json' | grep -vE "^(@@|diff|index|\-\-\-|\+\+\+|\- \* @generated SignedSource)" | grep "^[+-]" > /dev/null; then
echo "Changes detected"
echo "===== Changes ====="
git --no-pager diff --cached ':(exclude)*REVISION' | grep -vE "^(@@|diff|index|\-\-\-|\+\+\+|\- \* @generated SignedSource)" | grep "^[+-]" | head -n 50
git --no-pager diff --cached ':(exclude)*REVISION' ':(exclude)*/eslint-plugin-react-hooks/package.json' | grep -vE "^(@@|diff|index|\-\-\-|\+\+\+|\- \* @generated SignedSource)" | grep "^[+-]" | head -n 50
echo "==================="
echo "should_commit=true" >> "$GITHUB_OUTPUT"
else
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/runtime_discord_notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
outputs:
is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }}
steps:
- run: echo ${{ github.event.pull_request.author_association }}
- name: Check is member or collaborator
id: check_is_member_or_collaborator
if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/shared_label_core_team_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
outputs:
is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }}
steps:
- run: echo ${{ github.event.pull_request.author_association }}
- name: Check is member or collaborator
id: check_is_member_or_collaborator
if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
Expand Down
3 changes: 1 addition & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion');

module.exports = {
plugins: ['prettier-plugin-hermes-parser'],
bracketSpacing: false,
singleQuote: true,
bracketSameLine: true,
trailingComma: 'es5',
printWidth: 80,
parser: 'hermes',
parser: 'flow',
arrowParens: 'avoid',
overrides: [
{
Expand Down
14 changes: 0 additions & 14 deletions compiler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
.DS_Store
.spr.yml

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

node_modules
.watchmanconfig
.watchman-cookie-*
dist
.vscode
!packages/playground/.vscode
.spr.yml
testfilter.txt

bundle-oss.sh

# forgive
*.vsix
.vscode-test
6 changes: 6 additions & 0 deletions compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 19.1.0-rc.2 (May 14, 2025)

## babel-plugin-react-compiler

* Fix for string attribute values with emoji [#33096](https://github.com/facebook/react/pull/33096) by [@josephsavona](https://github.com/josephsavona)

## 19.1.0-rc.1 (April 21, 2025)

## eslint-plugin-react-hooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ const PanicThresholdOptionsSchema = z.enum([
]);

export type PanicThresholdOptions = z.infer<typeof PanicThresholdOptionsSchema>;
const DynamicGatingOptionsSchema = z.object({
source: z.string(),
});
export type DynamicGatingOptions = z.infer<typeof DynamicGatingOptionsSchema>;
const CustomOptOutDirectiveSchema = z
.nullable(z.array(z.string()))
.default(null);
type CustomOptOutDirective = z.infer<typeof CustomOptOutDirectiveSchema>;

export type PluginOptions = {
environment: EnvironmentConfig;
Expand Down Expand Up @@ -65,6 +73,28 @@ export type PluginOptions = {
*/
gating: ExternalFunction | null;

/**
* If specified, this enables dynamic gating which matches `use memo if(...)`
* directives.
*
* Example usage:
* ```js
* // @dynamicGating:{"source":"myModule"}
* export function MyComponent() {
* 'use memo if(isEnabled)';
* return <div>...</div>;
* }
* ```
* This will emit:
* ```js
* import {isEnabled} from 'myModule';
* export const MyComponent = isEnabled()
* ? <optimized version>
* : <original version>;
* ```
*/
dynamicGating: DynamicGatingOptions | null;

panicThreshold: PanicThresholdOptions;

/*
Expand Down Expand Up @@ -106,6 +136,11 @@ export type PluginOptions = {
*/
ignoreUseNoForget: boolean;

/**
* Unstable / do not use
*/
customOptOutDirectives: CustomOptOutDirective;

sources: Array<string> | ((filename: string) => boolean) | null;

/**
Expand Down Expand Up @@ -244,13 +279,15 @@ export const defaultOptions: PluginOptions = {
logger: null,
gating: null,
noEmit: false,
dynamicGating: null,
eslintSuppressionRules: null,
flowSuppressions: true,
ignoreUseNoForget: false,
sources: filename => {
return filename.indexOf('node_modules') === -1;
},
enableReanimatedCheck: true,
customOptOutDirectives: null,
target: '19',
} as const;

Expand Down Expand Up @@ -292,6 +329,40 @@ export function parsePluginOptions(obj: unknown): PluginOptions {
}
break;
}
case 'dynamicGating': {
if (value == null) {
parsedOptions[key] = null;
} else {
const result = DynamicGatingOptionsSchema.safeParse(value);
if (result.success) {
parsedOptions[key] = result.data;
} else {
CompilerError.throwInvalidConfig({
reason:
'Could not parse dynamic gating. Update React Compiler config to fix the error',
description: `${fromZodError(result.error)}`,
loc: null,
suggestions: null,
});
}
}
break;
}
case 'customOptOutDirectives': {
const result = CustomOptOutDirectiveSchema.safeParse(value);
if (result.success) {
parsedOptions[key] = result.data;
} else {
CompilerError.throwInvalidConfig({
reason:
'Could not parse custom opt out directives. Update React Compiler config to fix the error',
description: `${fromZodError(result.error)}`,
loc: null,
suggestions: null,
});
}
break;
}
default: {
parsedOptions[key] = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function run(
mode,
config,
contextIdentifiers,
func,
logger,
filename,
code,
Expand Down
Loading
Loading