Commit Graph

19189 Commits

Author SHA1 Message Date
Jan Kassens
41ecbada0e Enable prettier for some blocklisted fixtures with invalid GraphQL (#30425)
The invalid GraphQL in these fixtures somehow causes an unhandled
promise rejection error when running `yarn prettier-all`. This fixes
that issue by making the GraphQL valid.
2024-07-30 14:23:43 -04:00
Lauren Tan
ab7c166313 [ci] Fix incorrect polling
Oops. Actually poll correctly by fetching the latest workflow run each
retry, and not just checking the first attempt.

Test plan: https://github.com/facebook/react/actions/runs/10165564989

ghstack-source-id: 3202d8f6ae
Pull Request resolved: https://github.com/facebook/react/pull/30531
2024-07-30 11:54:48 -04:00
Lauren Tan
73b21a05e3 [ci] Read node version from .nvmrc instead of hardcoding
ghstack-source-id: 336ac1a45f
Pull Request resolved: https://github.com/facebook/react/pull/30530
2024-07-30 11:54:48 -04:00
Lauren Tan
a7f3b49be2 [ci] Make some workflows dispatchable
The previous checks for prerelease_commit_sha was incorrectly
implemented for devtools regression tests so I fixed it. I also made
some other workflows dispatchable so they can be manually run from
GitHub's UI as needed.

Test plan: https://github.com/facebook/react/actions/runs/10165564989

ghstack-source-id: b30c7b48e7
Pull Request resolved: https://github.com/facebook/react/pull/30529
2024-07-30 11:54:48 -04:00
Lauren Tan
927ba5799a [rfc] Delete devtools_check_repro workflow
With GitHub issue templates this workflow is not truly necessary and
can deny other workflows from running due to a limited amount of CI
workers in the pool.

I propose deleting this workflow and relying on issue templates instead.

ghstack-source-id: a798621f36
Pull Request resolved: https://github.com/facebook/react/pull/30518
2024-07-30 10:57:35 -04:00
Sebastian Markbåge
33e54fa252 [DevTools] Rename NativeElement to HostInstance in the Bridge (#30491)
Stacked on #30490.

This is in the same spirit but to clarify the difference between what is
React Native vs part of any generic Host. We used to use "Native" to
mean three different concepts. Now "Native" just means React Native.

E.g. from the frontend's perspective the Host can be
Highlighted/Inspected. However, that in turn can then be implemented as
either direct DOM manipulation or commands to React Native. So frontend
-> backend is "Host" but backend -> React Native is "Native" while
backend -> DOM is "Web".

Rename NativeElementsPanel to BuiltinElementsPanel. This isn't a React
Native panel but one part of the surrounding DevTools. We refer to Host
more as the thing running React itself. I.e. where the backend lives.
The runtime you're inspecting. The DevTools itself needs a third term.
So I went with "Builtin".
2024-07-30 09:12:12 -04:00
Sebastian Markbåge
bea5a2bc46 [Fiber/DevTools] Stop injecting findHostInstanceByFiber (#30519)
This is not used by DevTools since it has its own implementation of it.

This function is getting removed since `findDOMNode` is getting removed
so we shouldn't keep around extra bytes unnecessarily.

There is also `findHostInstancesForRefresh` which should really be
implemented on the `react-refresh` side. Not using an injection but
that's a heavier lift and only affects `__DEV__`.
2024-07-29 20:05:14 -04:00
Lauren Tan
3043e1ae21 [ci] Add polling to download-build-artifacts
Several CI workflows depend on the runtime_build_and_test.yml workflow
to complete before it can successfully download the build artifact.
However it is possible to encounter a race condition where the build
hasn't completed when the new workflow is started.

This PR adds a simple polling mechanism that waits up to 10 minutes for
the build for that revision to complete.

ghstack-source-id: 6a954638a800fbea8081e6fba35ee4b4437731c5
Pull Request resolved: https://github.com/facebook/react/pull/30515
2024-07-29 19:18:04 -04:00
Lauren Tan
d98f1a4bc6 [ci] Deprecate yarn publish-prereleases
Added instructions on the new workflow. Let's keep this short around for
now as it may be used again due to muscle memory and emit a helpful
message instead.

ghstack-source-id: 3f840a3d4319309d31cefeae028f97d280b0c09a
Pull Request resolved: https://github.com/facebook/react/pull/30510
2024-07-29 19:18:04 -04:00
Lauren Tan
8fe510752f [ci] Cleanup more references to circleci
ghstack-source-id: 85a5f17b2b9dee35bb747ce2da13bffaed0fa34a
Pull Request resolved: https://github.com/facebook/react/pull/30509
2024-07-29 19:18:03 -04:00
Lauren Tan
8ebe42f17c [ci] Cleanup --ci flag
This can be restored back to being a boolean instead of an enum

ghstack-source-id: aca58fb7ea386ee489dd895e028f1aa2fc507193
Pull Request resolved: https://github.com/facebook/react/pull/30508
2024-07-29 19:18:03 -04:00
Lauren Tan
e415b22494 [ci] Rename scripts/circleci to scripts/ci
ghstack-source-id: 5d9cb7d3dbd0f5c54856ad194517524f14cf1ccb
Pull Request resolved: https://github.com/facebook/react/pull/30507
2024-07-29 19:18:03 -04:00
Lauren Tan
70885cfebe [ci] Cleanup forked build files
Unforks these scripts now that we are fully migrated to GH.

ghstack-source-id: e1e15452f2d2e178a5b56203ebd0b42151e6a9ba
Pull Request resolved: https://github.com/facebook/react/pull/30506
2024-07-29 19:18:02 -04:00
Jan Kassens
6b82f3c904 [RN] experiment to move Fabric completeWork to the commit phase (#30513)
There is currently a mismatch in how the persistent mode JS API and the
Fabric native code interpret `completeRoot`.

This is a short-lived experiment to see the effect of moving the Fabric
`completeRoot` call from `finalizeContainerChildren` to
`replaceContainerChildren` which in some cases does not get called.
2024-07-29 18:38:55 -04:00
Lauren Tan
87b1a942ef [ci] Override actions/cache default timeout
actions/cache has a default timeout of 10 minutes. Occasionally the
cache service download gets stuck and it waits this amount of time
before proceeding like it was a cache miss.

10 minutes is way too long so let's shorten this to a minute.

ghstack-source-id: 95dee31bd9
Pull Request resolved: https://github.com/facebook/react/pull/30512
2024-07-29 17:36:43 -04:00
Jack Pope
397646ad51 Update enableLazyContextPropagation flag (#30514)
- Flag set to true for FB
- Flag set to experimental for OSS
2024-07-29 16:50:28 -04:00
Josh Story
a451de014c [Fizz] Allow aborting during render (#30488)
Currently if you abort a Fizz render during rendering the render will
not complete correctly because there are inconsistencies with task
counting. This change updates the abort implementation to allow you to
abort from within a render itself. We already landed a similar change
for Flight in #29764
2024-07-29 13:18:15 -07:00
Lauren Tan
fe68112240 [ci] Temporarily always build from source for codesandbox
We need a GitHub token to download artifacts from GitHub so
unfortunately codesandboxci will need to revert to the slower process
of building from source for now until it's possible to pass secrets to
codesandboxci.

ghstack-source-id: edab979084
Pull Request resolved: https://github.com/facebook/react/pull/30511
2024-07-29 16:16:09 -04:00
Sebastian Markbåge
ec98d36c3a [DevTools] Rename Fiber to Element in the Bridge Protocol and RendererInterface (#30490)
I need to start clarifying where things are really actually Fibers and
where they're not since I'm adding Server Components as a separate type
of component instance which is not backed by a Fiber.

Nothing in the front end should really know anything about what kind of
renderer implementation we're inspecting and indeed it's already not
always a "Fiber" in the legacy renderer.

We typically refer to this as a "Component Instance" but the front end
currently refers to it as an Element as it historically grew from the
browser DevTools Elements tab.

I also moved the renderer.js implementation into the `backend/fiber`
folder. These are at the same level as `backend/legacy`. This clarifies
that anything outside of this folder ideally shouldn't refer to a
"Fiber".

console.js and profilingHooks.js unfortunately use Fibers a lot which
needs further refactoring. The profiler frontend also uses the term
alot.
2024-07-29 14:29:52 -04:00
Lauren Tan
941e1b4a0a [ci] Fix passing secrets to runtime_prereleases
Second try, seems like you need to explicitly pass secrets to reusable
workflows.

ghstack-source-id: 05ffdae13474dba64119182bf72c15d07f83efd2
Pull Request resolved: https://github.com/facebook/react/pull/30504
2024-07-29 14:27:21 -04:00
Josh Story
9938e248fe [Fizz] Don't perform work when closing (#30497)
When a Fizz render is closing but not yet closed it's possible that
pinged tasks can spawn more work. The point of the closing state is to
allow time to start piping/reading the underlying stream but
semantically the render is finished at that point so work should no
longer happen.
2024-07-29 11:09:54 -07:00
Lauren Tan
93b12b824c [ci] Fix prerelease script npm authtoken
Try again to specify the npm token so the publish script can succeed.

ghstack-source-id: cd6e01b2ea
Pull Request resolved: https://github.com/facebook/react/pull/30503
2024-07-29 13:46:57 -04:00
Lauren Tan
4e482f4904 [ez] Remove circleci badge from readme
CircleCI is no longer in use in this repo: a6b5ed01ae

ghstack-source-id: b6234f11d143d2c65832e17ccf180b255dc23c9d
Pull Request resolved: https://github.com/facebook/react/pull/30502
2024-07-29 13:26:14 -04:00
Mofei Zhang
a8f5c4e16d [compiler] patch: retain UpdateExpression for globals
ghstack-source-id: aff6606f85698ccda13d1deffb6faa9d91f9821a
Pull Request resolved: https://github.com/facebook/react/pull/30471
2024-07-29 13:18:45 -04:00
Mofei Zhang
2a9274a73e [compiler] Repro: updates to globals should be retained
ghstack-source-id: 7ee813c0d72e3c752b299f63bfcec3647b022544
Pull Request resolved: https://github.com/facebook/react/pull/30470
2024-07-29 13:18:45 -04:00
Mofei Zhang
e215aa1160 [compiler] Fix FBT whitespace handling again (again (again))
ghstack-source-id: 00a86e41cfb8a6fb56b7fcd811740d1d9b89a611
Pull Request resolved: https://github.com/facebook/react/pull/30451
2024-07-29 13:18:45 -04:00
Mofei Zhang
e0acd77aab [compiler] Todo for fbt with multiple pronoun/plural
ghstack-source-id: 77b6980c2b080771d18aa275c3b3258884bd463c
Pull Request resolved: https://github.com/facebook/react/pull/30437
2024-07-29 13:18:45 -04:00
Mofei Zhang
a15e8d7cdc [compiler][repro] Test fixture for fbt plural bug
ghstack-source-id: 222e7312c081faf36702a1c790a4e336b5bcc928
Pull Request resolved: https://github.com/facebook/react/pull/30432
2024-07-29 13:18:45 -04:00
Lauren Tan
28b7f0bb71 [ci] Remove references to CIRCLE_NODE_{TOTAL,INDEX}
These env variables were used for circlci parallelization and can now be
removed.

ghstack-source-id: 224c47194d
Pull Request resolved: https://github.com/facebook/react/pull/30501
2024-07-29 13:04:00 -04:00
Lauren Tan
164af898c4 [ci] Remove jestSequencer
This was previously used for circleci parallelization but is no longer
needed.

ghstack-source-id: d8c1005e09
Pull Request resolved: https://github.com/facebook/react/pull/30500
2024-07-29 13:04:00 -04:00
Lauren Tan
39acfdb3be [ci] Fix ci prep script
During params parsing for this script, it previously would call out to
CircleCI for a build ID, but this is no longer needed.

ghstack-source-id: 9c70824498
Pull Request resolved: https://github.com/facebook/react/pull/30499
2024-07-29 13:03:59 -04:00
Lauren Tan
03072a7a11 [ci] Fix prereleases reusable workflow
Turns out I had configured the reusable workflow with the wrong `on`
command.

Also removes the workflow_dispatch config from the nightly workflow as
that was not meant to be triggered manually.

ghstack-source-id: 426d07279d
Pull Request resolved: https://github.com/facebook/react/pull/30498
2024-07-29 12:37:05 -04:00
Lauren Tan
a6b5ed01ae [ci] Delete .circleci
Everything has been migrated to GH. It's time to say goodbye...

ghstack-source-id: c7a9f49a72
Pull Request resolved: https://github.com/facebook/react/pull/30496
2024-07-29 11:29:29 -04:00
Lauren Tan
9af9764f55 [ci] Add prerelease workflows to GH actions
Migrates the last 2 remaining circleci jobs to GH actions. The behavior
of these workflows have been kept the same.

Overview:
- Reusable workflow `runtime_prereleases.yml` added
- Nightly workflow on cron triggers the reusable workflow with the
  current HEAD sha
- Manual workflow which can be triggered from the github UI with a
  `prerelease_commit_sha` which triggers the reusable workflow

ghstack-source-id: 84ef33c732
Pull Request resolved: https://github.com/facebook/react/pull/30495
2024-07-29 11:29:29 -04:00
Josh Story
d17e9d1ce5 [Fizz] Prerender fallbacks before children (#30483)
When prerendering it can be convenient to abort the prerender while
rendering. However if any Suspense fallbacks have not yet rendered
before the abort happens the fallback itself will error and cause the
nearest parent Suspense boundary to render a fallback instead.
Prerenders are by definition not time critical so the prioritization of
children over fallbacks which makes sense for render isn't similarly
motivated for prerender. Given this, this change updates fallback
rendering during a prerender to attempt the fallback before attempting
children.
2024-07-26 14:06:47 -07:00
Lauren Tan
b9af819f8b [ci] Fix invalid username and email in synthetic commit
ghstack-source-id: 951d0ef445
Pull Request resolved: https://github.com/facebook/react/pull/30486
2024-07-26 15:15:00 -04:00
Lauren Tan
c00e895c19 [ci] Update prepare-release-from-ci to dl from GH
Updates this script to download from GH actions instead, to prepare for
moving the cron jobs over to GH actions.

ghstack-source-id: 9bba9f2721e42b508d7fac6604be72906dedd836
Pull Request resolved: https://github.com/facebook/react/pull/30485
2024-07-26 14:57:52 -04:00
Lauren Tan
0d022861d2 [ci] Refactor download-build-artifacts
Extracts out the code to download builds from GH into its own module so
that it can be reused later.

ghstack-source-id: 26687db971d06339d099d1d5075825efb82cf6b8
Pull Request resolved: https://github.com/facebook/react/pull/30484
2024-07-26 14:57:51 -04:00
Jack Pope
1350a85980 Add unstable context bailout for profiling (#30407)
**This API is not intended to ship. This is a temporary unstable hook
for internal performance profiling.**

This PR exposes `unstable_useContextWithBailout`, which takes a compare
function in addition to Context. The comparison function is run to
determine if Context propagation and render should bail out earlier.
`unstable_useContextWithBailout` returns the full Context value, same as
`useContext`.

We can profile this API against `useContext` to better measure the cost
of Context value updates and gather more data around propagation and
render performance.

The bailout logic and test cases are based on
https://github.com/facebook/react/pull/20646

Additionally, this implementation allows multiple values to be compared
in one hook by returning a tuple to avoid requiring additional Context
consumer hooks.
2024-07-26 14:38:24 -04:00
Ahmed Abdelbaset
f7ee804c22 [compiler] Add git info to package.json files in compiler packages (#30475)
This PR adds the repository field to `compiler/packages/*/package.json`

| eslint-plugin-react-compiler | eslint-plugin-react-hooks |
| --- | --- |
|
![image](https://github.com/user-attachments/assets/3392a496-1ff1-4f36-ab96-cfbe1ed88693)
|
![image](https://github.com/user-attachments/assets/b0605dba-eef7-44fe-9484-979b4814d9fb)
|
2024-07-26 12:56:39 -04:00
Lauren Tan
c5f3a6f42f [circleci] Remove build_and_test workflow
Now that we've fully migrated the PR CI workflow (build_and_test) to GH,
we can fully delete the workflow altogether. This will break
https://react-builds.vercel.app/ unfortunately but I'll wait for
acdlite to come back from vacation and work with him to fix it.

The remaining jobs in circleci are for publishing prereleases of React
to npm. I'll work on migrating those next.

ghstack-source-id: 05f346829f
Pull Request resolved: https://github.com/facebook/react/pull/30480
2024-07-26 11:58:20 -04:00
Lauren Tan
0023cff871 [ci] Update runtime_commit_artifacts step versions
These were outdated and emitting warnings

ghstack-source-id: 2e22c29253
Pull Request resolved: https://github.com/facebook/react/pull/30479
2024-07-26 11:58:20 -04:00
Lauren Tan
2883d28b2d [ci] Unfork runtime_commit_artifacts
Promotes v2 to the primary workflow file so that we don't double write
to the protected branches.

Note: this may break DiffTrain temporarily, I will fix forward if so

ghstack-source-id: f6505a72f2
Pull Request resolved: https://github.com/facebook/react/pull/30477
2024-07-26 11:34:26 -04:00
Lauren Tan
417e93ca19 [ci] Add commit steps to new runtime_commit_artifacts_v2
Adds back the missing steps with a few tweaks to where previously some
`github` context value was referenced, I changed it to read from the
triggering workflow_run (ie the build on `main`) instead.

ghstack-source-id: 4b0fa135f0
Pull Request resolved: https://github.com/facebook/react/pull/30476
2024-07-26 11:34:25 -04:00
Josh Story
7f217d1d88 [Fiber] use srcset to trigger load even on img mount (#30351)
In https://github.com/facebook/react/pull/23316 we fixed a bug where
onload events were missed if they happened too early. This update adds
support for srcset to retrigger the load event. Firefox unfortunately
does not trigger a load even when you assign srcset so this won't work
in every browser when you use srcset without src however it does close a
gap in chrome at least
2024-07-25 15:46:45 -07:00
Lauren Tan
27d5dba884 [ci] Temporary fork runtime_commit_artifacts
Unfortunately creating a workflow that depends on another worfklow run
requires it to first be merged into main, so I can't really test porting
this without landing it first.

To do this safely, I've left the original job intact for DiffTrain and
added a forked file. This fork only currently downloads the artifact
from the HEAD commit in GH actions; I've removed the steps that push to
the protected branches for now while I test to see if this works as
expected.

This workflow needs to depend on the runtime_build_and_test workflow
being complete because otherwise it will fail since the artifacts
haven't been built yet.

ghstack-source-id: 0f9cebc525
Pull Request resolved: https://github.com/facebook/react/pull/30472
2024-07-25 18:09:32 -04:00
Lauren Tan
720a982a1f [ci] Remove devtools_regression_tests workflow from circleci
This has now been migrated to GH actions.

ghstack-source-id: 2dcc9ae5ad
Pull Request resolved: https://github.com/facebook/react/pull/30468
2024-07-25 17:27:38 -04:00
Lauren Tan
fe225e3a1f [ci] Add devtools regression workflow
More or less a straight copy from the circleci config. I spotted some
inefficiencies but will fix those later to make reviewing this easier.

ghstack-source-id: cb3456c602
Pull Request resolved: https://github.com/facebook/react/pull/30406
2024-07-25 17:27:38 -04:00
Lauren Tan
0a76aecbfa [ci] Cleanup run_devtools_e2e_tests
This was only used for build_and_test which has since been migrated to
gh actions and is now therefore unused. Looks like I missed this during
the previous cleanup.

ghstack-source-id: 278443951e
Pull Request resolved: https://github.com/facebook/react/pull/30467
2024-07-25 17:09:12 -04:00
Lauren Tan
a0e7ecfc6a Bump version to 0.0.0-experimental-ab3118d-20240725 2024-07-25 15:46:47 -04:00