Commit Graph
44 Commits
Author SHA1 Message Date
poteto afed35b486 [eprh] Bump stable version (#32978)
https://www.npmjs.com/package/eslint-plugin-react-hooks/v/6.0.0 was just
released, so we can bump this now.

DiffTrain build for [b303610c33](https://github.com/facebook/react/commit/b303610c33ab903f6f0d9d1c6297b704781b3678)
2025-04-21 11:41:40 -07:00
poteto df7ab8b838 [ci] Remove compiler weekly release (#32977)
No longer needed.

DiffTrain build for [fea92d8462](https://github.com/facebook/react/commit/fea92d846284bb7f4427ccbe8c16aaf85f0e2943)
2025-04-21 10:55:50 -07:00
jbrown215 25f69b725f [compiler][autodeps/fire] Do not include fire functions in autodep arrays (#32532)
Summary: We landed on not including fire functions in dep arrays. They
aren't needed because all values returned from the useFire hook call
will read from the same ref. The linter will error if you include a
fired function in an explicit dep array.

Test Plan: yarn snap --watch

--

DiffTrain build for [b8bedc267f](https://github.com/facebook/react/commit/b8bedc267f79db375f3147db4d766e09de599b68)
2025-04-17 10:09:19 -07:00
poteto c684ed4ef3 [ci] Only label on PR open (#32936)
No reason to label it every update, only do it once when it's first
opened.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32936).
* __->__ #32936
* #32935

DiffTrain build for [4a36d3eab7](https://github.com/facebook/react/commit/4a36d3eab7d9bbbfae62699989aa95e5a0297c16)
2025-04-16 15:07:17 -07:00
poteto 0de480943e [ci] Fix check_access again (#32935)
I can see the value being output and set correctly but not sure why it's
skipping the 2nd job.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32935).
* #32936
* __->__ #32935

DiffTrain build for [2ddf8caa9d](https://github.com/facebook/react/commit/2ddf8caa9d3abd22f54304bf7650e512efb93f18)
2025-04-16 15:05:49 -07:00
sebmarkbage d9958b393f Don't try to hydrate a hidden Offscreen tree (#32862)
I found a bug even before the Activity hydration stuff.

If we're hydrating an Offscreen boundary in its "hidden" state it won't
have any content to hydrate so will trigger hydration errors (which are
then eaten by the Offscreen boundary itself). Leaving it not prewarmed.

This doesn't happen in the simple case because we'd be hydrating at a
higher priority than Offscreen at the root, and those are deferred to
Offscreen by not having higher priority. However, we've hydrating at the
Offscreen priority, which we do inside Suspense boundaries, then it
tries to hydrate against an empty set.

I ended up moving this to the Activity boundary in a future PR since
it's the SSR side that decided where to not render something and it only
has a concept of Activity, no Offscreen.

https://github.com/facebook/react/pull/32863/commits/1dc05a5e2222e18fc3a2062ee1bd957109e21344#diff-d5166797ebbc5b646a49e6a06a049330ca617985d7a6edf3ad1641b43fde1ddfR1111

DiffTrain build for [b04254fdce](https://github.com/facebook/react/commit/b04254fdcee30871760301f34236ee0dfadf86ab)
2025-04-15 14:49:25 -07:00
sebmarkbage 3187da070d Warn if you pass a hidden prop to Activity (#32916)
Since `hidden` is a prop on arbitrary DOM elements it's a common mistake
to think that it would also work that way on `<Activity>` but it
doesn't. In fact, we even had this mistakes in our own tests.

Maybe there's an argument that we should actually just support it but we
also have more modes planned.

So this adds a warning. It should also already be covered by TypeScript.

DiffTrain build for [539bbdbd86](https://github.com/facebook/react/commit/539bbdbd86d9cd342aabde4cb08e398751789103)
2025-04-15 14:23:19 -07:00
sebmarkbage 0bf585bb32 Clarify that there's three different kinds of OffscreenProps (#32838)
ActivityProps - Public API
LegacyHiddenProps - Public Legacy API
OffscreenProps - Internal implementation detail

DiffTrain build for [31ecc9804a](https://github.com/facebook/react/commit/31ecc9804a3f263033611f069774e50059c0743a)
2025-04-09 19:30:31 -07:00
poteto 402cf9f099 [eprh] Temporarily disable ref access in render validation (#32839)
This rule currently has a few false positives, so let's disable it for
now (just in the eslint rule, it's still enabled in the compiler) while
we iterate on it.

DiffTrain build for [ff697fc58b](https://github.com/facebook/react/commit/ff697fc58be53dd485bd2babb826bc6cd664929c)
2025-04-09 11:56:15 -07:00
eps1lon 7857e82b39 Send notification to Discord if automated publish fails (#32840)
DiffTrain build for [096dd7385d](https://github.com/facebook/react/commit/096dd7385dfc6e9732d588189e59c8c6fe7a4975)
2025-04-09 10:21:05 -07:00
sebmarkbage 5c01acf862 Enable Suspensey Images inside <ViewTransition> subtrees (#32820)
Even if the `enableSuspenseyImages` flag is off.

Started View Transitions already wait for Suspensey Fonts and this is
another Suspensey feature that is even more important for View
Transitions - even though we eventually want it all the time. So this
uses `<ViewTransition>` as an early opt-in for that tree into Suspensey
Images, which we can ship in a minor.

If you're doing an update inside a ViewTransition then we're eligible to
start a ViewTransition in any Transition that might suspend. Even if
that doesn't end up animating after all, we still consider it Suspensey.
We could try to suspend inside the startViewTransition but that's not
how it would work with `enableSuspenseyImages` on and we can't do that
for startGestureTransition.

Even so we still need some opt-in to trigger the Suspense fallback even
before we know whether we'll animate or not. So the simple solution is
just that `<ViewTransition>` opts in the whole subtree into Suspensey
Images in general.

In this PR I disable `enableSuspenseyImages` in experimental so that we
can instead test the path that only enables it inside `<ViewTransition>`
tree since that's the path that would next graduate to a minor.

DiffTrain build for [8da36d0508](https://github.com/facebook/react/commit/8da36d0508e83dd342ddbb98cb18f0606fd4045b)
2025-04-08 15:01:08 -07:00
sebmarkbage b154791a6c Allow Passing Blob/File/MediaSource/MediaStream to src of <img>, <video> and <audio> (#32828)
Behind the `enableSrcObject` flag. This is revisiting a variant of what
was discussed in #11163.

Instead of supporting the [`srcObject`
property](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject)
as a separate name, this adds an overload of `src` to allow objects to
be passed. The DOM needs to add separate properties for the object forms
since you read back but it doesn't make sense for React's write-only API
to do that. Similar to how we'll like add an overload for
`popoverTarget` instead of calling it `popoverTargetElement` and how
`style` accepts an object and it's not `styleObject={{...}}`.

There are a number of reason to revisit this.

- It's just way more convenient to have this built-in and it makes
conceptual sense. We typically support declarative APIs and polyfill
them when necessary.
- RSC supports Blobs and by having it built-in you don't need a Client
Component wrapper to render it where as doing it with effects would
require more complex wrappers. By picking Blobs over base64,
client-navigations can use the more optimized binary encoding in the RSC
protocol.
- The timing aspect of coordinating it with Suspensey images and image
decoding is a bit tricky to get right because if you set it in an effect
it's too late because you've already rendered it.
- SSR gets complicated when done in user space because you have to
handle both branches. Likely with `useSyncExternalStore`.
- By having it built-in we could optimize the payloads shared between
RSC payloads embedded in the HTML and data URLs.

This does not support objects for `<source src>` nor `<img srcset>`.
Those don't really have equivalents in the DOM neither. They're mainly
for picking an option when you don't know programmatically. However, for
this use case you're really better off picking a variant before
generating the blobs.

We may support Response objects in the future too as per
https://github.com/whatwg/fetch/issues/49

DiffTrain build for [ea05b750a5](https://github.com/facebook/react/commit/ea05b750a5374458fc8c74ea0918059c818d1167)
2025-04-08 09:18:31 -07:00
mofeiZandRodrigo Faria cb70b73d5a feat(babel-plugin-react-compiler): support satisfies operator (#32742)
Solve https://github.com/facebook/react/pull/29818

---------

Co-authored-by: Rodrigo Faria <rodrigo.faria@cartrack.com>

DiffTrain build for [ef4bc8b4f9](https://github.com/facebook/react/commit/ef4bc8b4f91023afac437be9179beef350b32db3)
2025-03-28 08:16:33 -07:00
mofeiZ 0c1b2bf6d6 [compiler] Fix inferEffectDependencies lint false positives (#32769)
Currently, inferred effect dependencies are considered a
"compiler-required" feature. This means that untransformed callsites
should escalate to a build error.

`ValidateNoUntransformedReferences` iterates 'special effect' callsites
and checks that the compiler was able to successfully transform them.
Prior to this PR, this relied on checking the number of arguments passed
to this special effect.

This obviously doesn't work with `noEmit: true`, which is used for our
eslint plugin (this avoids mutating the babel program as other linters
run with the same ast). This PR adds a set of `babel.SourceLocation`s to
do best effort matching in this mode.

DiffTrain build for [8039f1b2a0](https://github.com/facebook/react/commit/8039f1b2a05d00437cd29707761aeae098c80adc)
2025-03-27 09:24:40 -07:00
mofeiZ 574b2c4d1d [compiler][be] Playground now uses tsup bundled plugin (#32759)
Followup to https://github.com/facebook/react/pull/32758.

This moves playground to use the tsup bundled plugin instead of
webpack-built `babel-plugin-react-compiler`.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32759).
* __->__ #32759
* #32758

DiffTrain build for [254114616a](https://github.com/facebook/react/commit/254114616a24e0ed66468570b00d34bfabf9f73b)
2025-03-26 11:38:23 -07:00
mofeiZ 7ec3133d86 [compiler][be] Test runner (snap) now uses tsup bundled plugin (#32758)
Currently, `babel-plugin-react-compiler` is bundled with (almost) all
external dependencies. This is because babel traversal and ast logic is
not forward-compatible. Since `babel-plugin-react-compiler` needs to be
compatible with babel pipelines across a wide semvar range, we (1) set
this package's babel dependency to an early version and (2) inline babel
libraries into our bundle.

A few other packages in `react/compiler` depend on the compiler. This PR
moves `snap`, our test fixture compiler and evaluator, to use the
bundled version of `babel-plugin-react-compiler`. This decouples the
babel version used by `snap` with the version used by
`babel-plugin-react-compiler`, which means that `snap` now can test
features from newer babel versions (see
https://github.com/facebook/react/pull/32742).

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32758).
* #32759
* __->__ #32758

DiffTrain build for [33999c4317](https://github.com/facebook/react/commit/33999c43177e13580730c2fad94a77f4b0e08ef2)
2025-03-26 11:35:39 -07:00
sebmarkbage be61447cca Avoid double logging component render time (#32749)
This got moved into the functional component and class component case
statements here:
https://github.com/facebook/react/commit/0de1233fd180969f7ffdfc98151922f2466ceb1f.
So that we could separate the error case for class components.

However, due to a faulty rebase this got restored at the top as well.
Leading to double component renders being logged.

In the other offscreen reconnect passes we don't do this in each case
statement but still once at the top. The reason this doesn't matter is
because use the PerformedWork flag and that is only set for function and
class components. Although maybe it should be set for expensive DOM
components too and then we have to remember this.

DiffTrain build for [f9e1b16098](https://github.com/facebook/react/commit/f9e1b16098f2ff4ed483285219b07066525796b6)
2025-03-25 18:03:19 -07:00
poteto 0c45045456 [ci] Fix param casing (#32748)
Casing was incorrect.

Tested by running locally with a PAT.

```
$ scripts/release/download-experimental-build.js --commit=2d40460cf768071d3a70b4cdc16075d23ca1ff25
Command failed: gh attestation verify artifacts_combined.zip --repo=facebook/react

Error: failed to fetch attestations from facebook/react: HTTP 404: Not Found (https://api.github.com/repos/facebook/react/attestations/sha256:23d05644f9e49e02cbb441e3932cc4366b261826e58ce222ea249a6b786f0b5f?per_page=30)
`gh attestation verify artifacts_combined.zip --repo=facebook/react` (exited with error code 1)

$ scripts/release/download-experimental-build.js --commit=2d40460cf768071d3a70b4cdc16075d23ca1ff25 --noVerify
⠼ Downloading artifacts from GitHub for commit 2d40460cf7)  5%                  0.1m, estimated 1.6m
✓ Downloading artifacts from GitHub for commit 2d40460cf7) 9.5 secs
An experimental build has been downloaded!

You can download this build again by running:
  scripts/download-experimental-build.js --commit=2d40460cf768071d3a70b4cdc16075d23ca1ff25
```

DiffTrain build for [4845e16c22](https://github.com/facebook/react/commit/4845e16c22caf27334a1eab712ed258a9ae09752)
2025-03-25 13:13:00 -07:00
hoxyqandAohua Mu ca4475cd53 [DevTools] Add fb local build command (#32644)
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary
1. Having a development build for FB will be convenient for fb internal
feature development
2. Add a new checkbox to toggle new internal features added to React
Devtools.

## How did you test this change?
1. yarn test
2. set extra env variables in bash profile and build an internal version
with the new script.
3. toggle on/off the new checkbox, the value is stored in local storage
correctly.

---------

Co-authored-by: Aohua Mu <muaohua@fb.com>

DiffTrain build for [dc9b74647e](https://github.com/facebook/react/commit/dc9b74647e093b531dc876a2438f12dac776e480)
2025-03-25 06:52:04 -07:00
SamChou19815 a6ff86e36f [flow] Replace $PropertyType with indexed access type in ReactNativeTypes (#32733)
DiffTrain build for [b59f186011](https://github.com/facebook/react/commit/b59f18601179bb06a2c32a76547fd4929aa1ce9c)
2025-03-24 20:06:19 -07:00
poteto f5f1e49b86 [scripts] Verify artifact integrity when downloading (#32728)
Uses https://cli.github.com/manual/gh_attestation_verify to verify that
the downloaded artifact matches the attestation generated during the
build process in runtime_commit_artifacts.

Example:

On a workflow run of runtime_build_and_test.yml with no attestations:
```
$ scripts/release/download-experimental-build.js --commit=ea5f065745b777cb41cc9e54a3b29ed8c727a574

Command failed: gh attestation verify artifacts_combined.zip --repo=facebook/react

Error: failed to fetch attestations from facebook/react: HTTP 404: Not Found (https://api.github.com/repos/facebook/react/attestations/sha256:7adba0992ba477a927aad5a07f95ee2deb7d18427c84279d33fc40a3bc28ebaa?per_page=30)
`gh attestation verify artifacts_combined.zip --repo=facebook/react` (exited with error code 1)
```

On one which does:

```
$ scripts/release/download-experimental-build.js --commit=12e85d74c1c233cdc2f3228a97473a4435d50c3b

✓ Downloading artifacts from GitHub for commit 12e85d74c1) 10.5 secs
An experimental build has been downloaded!

You can download this build again by running:
  scripts/download-experimental-build.js --commit=12e85d74c1c233cdc2f3228a97473a4435d50c3b
```
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32728).
* #32729
* __->__ #32728

DiffTrain build for [7e4c258e16](https://github.com/facebook/react/commit/7e4c258e160d3a2ca690b44a5938271873919ee1)
2025-03-24 15:31:29 -07:00
poteto 8e00114460 [ci] Add artifact attestation to build (#32711)
Adds a signed build provenance attestations via
https://github.com/actions/attest-build-provenance
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32711).
* #32729
* #32728
* __->__ #32711

DiffTrain build for [07276b8682](https://github.com/facebook/react/commit/07276b8682059cd310cedf574c7f3ecddce68f5c)
2025-03-24 15:21:59 -07:00
mofeiZ 2c83cca631 [compiler][bugfix] Fix hoisting of let declarations (#32724)
(Found when compiling Meta React code)

Let variable declarations and reassignments are currently rewritten to
`StoreLocal <varName>` instructions, which each translates to a new
`const varName` declaration in codegen.

```js
// Example input
function useHook() {
  const getX = () => x;
  let x = CONSTANT1;
  if (cond) {
    x += CONSTANT2;
  }
  return <Stringify getX={getX} />
}

// Compiled output, prior to this PR
import { c as _c } from "react/compiler-runtime";
function useHook() {
  const $ = _c(1);
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    const getX = () => x;
    let x = CONSTANT1;
    if (cond) {
      let x = x + CONSTANT2;
      x;
    }

    t0 = <Stringify getX={getX} />;
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  return t0;
}
```

This also manifests as a babel internal error when replacing the
original function declaration with the compiler output. The below
compilation output fails with `Duplicate declaration "x" (This is an
error on an internal node. Probably an internal error.)`.
```js
// example input
let x = CONSTANT1;
if (cond) {
  x += CONSTANT2;
  x = CONSTANT3;
}

// current output
let x = CONSTANT1;
if (playheadDragState) {
  let x = x + CONSTANT2
  x;
  let x = CONSTANT3;
}
```

DiffTrain build for [254dc4d9f3](https://github.com/facebook/react/commit/254dc4d9f37eb512d4ee8bad6a0fae7ae491caef)
2025-03-24 11:36:37 -07:00
mofeiZ ac9e62b123 [compiler] Avoid failing builds when import specifiers conflict or shadow vars (#32663)
Avoid failing builds when imported function specifiers conflict by using
babel's `generateUid`. Failing a build is very disruptive, as it usually
presents to developers similar to a javascript parse error.
```js
import {logRender as _logRender} from 'instrument-runtime';

const logRender = () => { /* local conflicting implementation */ }

function Component_optimized() {
  _logRender(); // inserted by compiler
}
```

Currently, we fail builds (even in `panicThreshold:none` cases) when
import specifiers are detected to conflict with existing local
variables. The reason we destructively throw (instead of bailing out) is
because (1) we first generate identifier references to the conflicting
name in compiled functions, (2) replaced original functions with
compiled functions, and then (3) finally check for conflicts.

When we finally check for conflicts, it's too late to bail out.
```js
// import {logRender} from 'instrument-runtime';

const logRender = () => { /* local conflicting implementation */ }

function Component_optimized() {
  logRender(); // inserted by compiler
}
```

DiffTrain build for [c61e75b76d](https://github.com/facebook/react/commit/c61e75b76d5ff6707ad75c8beb777e721d982207)
2025-03-24 06:38:02 -07:00
mofeiZ 7f9b639eec [compiler][optim] Add Effect.ConditionallyMutateIterator (#32698)
Adds Effect.ConditionallyMutateIterator, which has the following
effects:
- capture for known array, map, and sets
- mutate for all other values

An alternative to this approach could be to add polymorphic shape
definitions

DiffTrain build for [7c908bcf4e](https://github.com/facebook/react/commit/7c908bcf4e6b46135164be961972f0d756378517)
2025-03-23 20:31:44 -07:00
mofeiZ 9744c3a5b5 [compiler][optim] Add map and set constructors (#32697)
* Adds `isConstructor: boolean` to `FunctionType`. With this PR, each
typed function can either be a constructor (currently only known
globals) or non constructor. Alternatively, we prefer to encode
polymorphic types / effects (and match the closest subtype)

* Add Map and Set globals + built-ins
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32697).
* #32698
* __->__ #32697

DiffTrain build for [a8e503dce0](https://github.com/facebook/react/commit/a8e503dce0ec386eef752a1219dd6ef861c48ced)
2025-03-23 20:25:23 -07:00
mofeiZ 8e83d8c66f [compiler][be] Refactor similar CallExpression and MethodCall effect handling (#32696)
Simplify InferReferenceEffect function signature matching logic for next
PRs in stack
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32696).
* #32698
* #32697
* __->__ #32696
* #32695

DiffTrain build for [45463ab3ac](https://github.com/facebook/react/commit/45463ab3ac3ed0e65dfdbbfd5e53a50a8384e909)
2025-03-23 20:14:08 -07:00
josephsavona 8ca918c4b6 fix(react-compiler): optimize components declared with arrow function and implicit return and compilationMode: 'infer' (#31792)
fixes https://github.com/facebook/react/issues/31601
https://github.com/facebook/react/issues/31639 cc @josephsavona

DiffTrain build for [6b1a2c1d81](https://github.com/facebook/react/commit/6b1a2c1d81630a5f385c5be0f758365b63d92eae)
2025-03-21 16:51:56 -07:00
mofeiZ 40af6fd39b [compiler][bugfix] Don't insert hook guards in retry pipeline (#32665)
Fixing bug from https://github.com/facebook/react/pull/32164 -- prior to
this PR, we inserted hook guards even for functions that bailed out of
compilation.

DiffTrain build for [0962f684a0](https://github.com/facebook/react/commit/0962f684a066df4fd2a7db7489cb1984799ad674)
2025-03-20 14:45:02 -07:00
josephsavona f846612902 [compiler] Refactor validations to return Result and log where appropriate
Updates ~all of our validations to return a Result, and then updates callers to either unwrap() if they should bailout or else just log.

ghstack-source-id: 418b5f5aa2
Pull Request resolved: https://github.com/facebook/react/pull/32688

DiffTrain build for [e3c06424ae](https://github.com/facebook/react/commit/e3c06424ae1162319d786a76371d649dee412c29)
2025-03-20 11:09:13 -07:00
poteto 11071c3740 Minor Fixes to View Transition Fixture (#32664)
Follow up to #32656.

Remove touchAction from SwipeRecognizer. I was under the wrong
impression that this was only the touch-action applied to this
particular element, but that parents would still win but in fact this
blocks the parent from scrolling in the other direction. By specifying a
fixed direction it also blocked rage-swiping in the other direction
early on.

Disable pointer-events on view-transition so that the scroll can be hit.
This means that touches hit below the items animating above. This allows
swiping to happen again before momentum scroll has finished. Previously
they were ignored. This only works as long as the SwipeRecognizer is
itself not animating. This means you can now rage-swipe in both
directions quickly.

DiffTrain build for [c2a1961747](https://github.com/facebook/react/commit/c2a196174763e0b4f16ed1c512ed4442b062395e)

DiffTrain build for [646835fb59](https://github.com/facebook/react/commit/646835fb59f9ad8557b9f3641515697c153e3faa)

DiffTrain build for [db7dfe0550](https://github.com/facebook/react/commit/db7dfe05508392ba3bdf7bc24717fe71f9b84a29)
2025-03-19 08:57:41 -07:00
poteto dd465cbbb2 Minor Fixes to View Transition Fixture (#32664)
Follow up to #32656.

Remove touchAction from SwipeRecognizer. I was under the wrong
impression that this was only the touch-action applied to this
particular element, but that parents would still win but in fact this
blocks the parent from scrolling in the other direction. By specifying a
fixed direction it also blocked rage-swiping in the other direction
early on.

Disable pointer-events on view-transition so that the scroll can be hit.
This means that touches hit below the items animating above. This allows
swiping to happen again before momentum scroll has finished. Previously
they were ignored. This only works as long as the SwipeRecognizer is
itself not animating. This means you can now rage-swipe in both
directions quickly.

DiffTrain build for [c2a1961747](https://github.com/facebook/react/commit/c2a196174763e0b4f16ed1c512ed4442b062395e)

DiffTrain build for [646835fb59](https://github.com/facebook/react/commit/646835fb59f9ad8557b9f3641515697c153e3faa)
2025-03-19 08:56:34 -07:00
sebmarkbage e2d679e6c2 Minor Fixes to View Transition Fixture (#32664)
Follow up to #32656.

Remove touchAction from SwipeRecognizer. I was under the wrong
impression that this was only the touch-action applied to this
particular element, but that parents would still win but in fact this
blocks the parent from scrolling in the other direction. By specifying a
fixed direction it also blocked rage-swiping in the other direction
early on.

Disable pointer-events on view-transition so that the scroll can be hit.
This means that touches hit below the items animating above. This allows
swiping to happen again before momentum scroll has finished. Previously
they were ignored. This only works as long as the SwipeRecognizer is
itself not animating. This means you can now rage-swipe in both
directions quickly.

DiffTrain build for [c2a1961747](https://github.com/facebook/react/commit/c2a196174763e0b4f16ed1c512ed4442b062395e)
2025-03-18 17:11:05 -07:00
mofeiZ 952df7fd1d fix(react-compiler): implement NumericLiteral as ObjectPropertyKey (#31791)
DiffTrain build for [90b511ec7a](https://github.com/facebook/react/commit/90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1)
2025-03-17 16:37:52 -07:00
sebmarkbage f8c51fc6a3 Don't auto-start browser in SSR fixtures (#32652)
I end up restarting these a lot and it's annoying to have it open
another tab each time.

The flight fixture already doesn't auto-start.

DiffTrain build for [02372952e4](https://github.com/facebook/react/commit/02372952e4f24fa02dcb9b32af26cb2472617cef)
2025-03-17 14:32:46 -07:00
sebmarkbage 9d5f469c0f Materialize the tree ID when ViewTransition name=auto consumes one (#32651)
ViewTransition uses the  algorithm to auto-assign names. This
ensures that we could animate between SSR content and client content by
ensuring that the names line up.

However, I missed that we need to bump the id (materialize it) when we
do that. This is what function components do if they use one or more
. This caused duplicate names when two ViewTransitions were
nested without any siblings since they would share name.

DiffTrain build for [9fde224a53](https://github.com/facebook/react/commit/9fde224a53693101a4d15e038d6db37e7a3596ff)
2025-03-17 13:23:53 -07:00
acdliteandacdlite edc6b1ccb9 Fix COMMIT_SHA when generating PR artifacts (#32647)
Follow-up to #31850. We want to build using the original commit SHA, not
the merge commit that GitHub Actions creates behind the scenes. We were
already checking out the correct commit object, but the COMMIT_SHA
artifact was still pointing to the merge commit.

This should fix the sizebot links to point to working URLs, too.

DiffTrain build for [9320a0139d](https://github.com/facebook/react/commit/9320a0139df876509c8ebb6f6fd950a6690bd5d9)
2025-03-17 09:53:26 -07:00
rickhanloniiandrickhanlonii 92ce7b2d07 [devtools] add filters for internal builds (#32646)
We don't have an experimental-only build of devtools, but we can at
least add these filters to the internal build.

A better way would be to use feature detection, but I'm not sure how and
this isn't a very heavily used feautre.

DiffTrain build for [fbcda19a23](https://github.com/facebook/react/commit/fbcda19a23da819889afdd7164b29c556fbcfc7a)
2025-03-17 09:21:25 -07:00
mofeiZandmofeiZ d89553906d [compiler] detect and throw on untransformed required features (#32512)
Traverse program after running compiler transform to find untransformed
references to compiler features (e.g. `inferEffectDeps`, `fire`).

Hard error to fail the babel pipeline when the compiler fails to
transform these features to give predictable runtime semantics.
Untransformed calls to functions like `fire` will throw at runtime
anyways, so let's fail the build to catch these earlier.

Note that with this fails the build *regardless of panicThreshold*

DiffTrain build for [5398b71158](https://github.com/facebook/react/commit/5398b7115847e87c0053aa719728d8dd1a635ccd)
2025-03-14 08:52:39 -07:00
potetoandpoteto 48bdd3208f Revert "[ci] Update yarn and node_modules cache key (#32603)" (#32607)
This reverts commit 67338703aa.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32607).
* #32609
* #32608
* __->__ #32607

DiffTrain build for [5200721e5c](https://github.com/facebook/react/commit/5200721e5c93a59f8af0403d61abe513cb7d32fe)
2025-03-13 19:21:41 -07:00
potetoandpoteto ba34cb6471 Revert "[ci] Fix node_modules cache glob (#32604)" (#32606)
This reverts commit ef1103d3e9.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32606).
* #32609
* #32608
* #32607
* __->__ #32606

DiffTrain build for [e9d80d939e](https://github.com/facebook/react/commit/e9d80d939ee0f6b1d6146eb11917c433a7791d17)
2025-03-13 19:13:17 -07:00
mofeiZandmofeiZ 2a7850d294 [compiler] clean up retry pipeline: fireRetry flag -> compileMode (#32511)
Removes `EnvironmentConfig.enableMinimalTransformsForRetry` in favor of
`run` parameters. This is a minimal difference but lets us explicitly
opt out certain compiler passes based on mode parameters, instead of
environment configurations

Retry flags don't really make sense to have in `EnvironmentConfig`
anyways as the config is user-facing API, while retrying is a compiler
implementation detail.

(per @josephsavona's feedback
https://github.com/facebook/react/pull/32164#issuecomment-2608616479)
> Re the "hacky" framing of this in the PR title: I think this is fine.
I can see having something like a compilation or output mode that we use
when running the pipeline. Rather than changing environment settings
when we re-run, various passes could take effect based on the
combination of the mode + env flags. The modes might be:
>
> * Full: transform, validate, memoize. This is the default today.
> * Transform: Along the lines of the backup mode in this PR. Only
applies transforms that do not require following the rules of React,
like `fire()`.
> * Validate: This could be used for ESLint.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32511).
* #32512
* __->__ #32511

DiffTrain build for [7939d92fcc](https://github.com/facebook/react/commit/7939d92fcc95ad5ee719c38272eaef14a3750fc0)
2025-03-13 17:02:27 -07:00
mofeiZandmofeiZ 4a62ea81fc [compiler] Avoid bailouts when inserting gating (#32598)
This change fixes a coverage hole in rolling out with `gating`. Prior to
this PR, configuring `gating` causes React Compiler to bail out of
optimizing some functions.

This means that it's not entirely safe to cutover from `gating` enabled
for all users (i.e. rolled out 100%) to removing the `gating` config
altogether, as new functions may be opted into compilation when they
stop bailing out due to gating-specific logic.

This is technically slightly slower due to the additional function
indirection. An alternative approach is to recommend running a codemod
to insert `use no memo`s on currently-bailing out functions before
removing the`gating` config.

---
Tested [internally](
https://fburl.com/diff/q982ovua) by enabling on a page that previously
had a few hundred bailouts due to gating + hoisted function declarations
and (1) clicking around locally and (2) running a bunch of e2e tests

DiffTrain build for [d92e5713be](https://github.com/facebook/react/commit/d92e5713be2dc78f467c31fce4a1e5c84a74e4e6)
2025-03-13 16:44:33 -07:00
potetoandpoteto ac6da563f1 [ci] mkdir before mv (#32602)
Missed this earlier.

DiffTrain build for [77987e5ee3](https://github.com/facebook/react/commit/77987e5ee370dd40c53a6f026c8026065cc3178c)
2025-03-13 14:53:56 -07:00