Commit Graph
504 Commits
Author SHA1 Message Date
kassens cbb38c72ac Upgrade ReactDOMShorthandCSSPropertyCollision-test to createRoot (#27924)
Upgrade ReactDOMShorthandCSSPropertyCollision-test to createRoot

Using the codemod from #27921 as a starting point, this migrates the
test to `createRoot`.

DiffTrain build for commit https://github.com/facebook/react/commit/33068c9db9153a479bb29d138397cb9c32fabfdd.
2024-01-12 20:55:25 +00:00
sebmarkbage caf453249f Use getComponentNameFromType for debug info for the key warning (#27930)
If this is a client reference we shouldn't dot into it, which would
throw in the proxy.

Interestingly our client references don't really have a `name`
associated with them for debug information so a component type doesn't
show up in error logs even though it seems like it should.

DiffTrain build for commit https://github.com/facebook/react/commit/0ac3ea471fbcb7d79bc7d36179e960c72c779e76.
2024-01-11 22:29:00 +00:00
hoxyq 2a6d5aca86 refactor[isChildPublicInstance]: don't leak ReactNativeFiberHostComponent to Fabric implementation (#27923)
While inspecting the build artifacts for Fabric in
https://www.internalfb.com/diff/D51816108, I've noticed it has some
leaking implementation details from Paper, such as
`ReactNativeFiberHostComponent`.

The reason for it is the single implementation of
`isChildPublicInstance` in `ReactNativePublicCompat`, in which we were
using `instanceof ReactNativeFiberHostComponent`.

This new implementation removes the `ReactNativeFiberHostComponent`
leak, but decreases the Flow coverage.

DiffTrain build for commit https://github.com/facebook/react/commit/6639ed3b3a44f7736beb629144a7996145008f09.
2024-01-11 14:31:15 +00:00
kassens 772935f732 Upgrade Flow to 0.216.0 (#27922)
Upgrade Flow to 0.216.0

```
yarn add -W flow-bin flow-remove-types hermes-parser hermes-eslint
```

DiffTrain build for commit https://github.com/facebook/react/commit/49439b4db858b2cfc17a601ae087d392479121da.
2024-01-10 18:48:41 +00:00
kassens 9a55663aa3 Convert ReactPureComponent-test to createRoot (#27917)
Convert ReactPureComponent-test to createRoot

DiffTrain build for commit https://github.com/facebook/react/commit/08cd087cada28bf05165b87b6e31a97c6ac598b4.
2024-01-10 15:23:18 +00:00
kassens 5d47dbc459 Convert ReactComponentLifeCycle-test to createRoot (#27916)
Convert ReactComponentLifeCycle-test to createRoot

DiffTrain build for commit https://github.com/facebook/react/commit/2594caa09e0aca49493cd62659c1e3d1d3488a7e.
2024-01-10 15:21:46 +00:00
kassens 367597a2e2 Convert ReactElement-test to createRoot (#27918)
Convert ReactElement-test to createRoot

DiffTrain build for commit https://github.com/facebook/react/commit/344a6675a9974d9e7b14542dd4e8bddb81a235e5.
2024-01-10 15:21:14 +00:00
noahlemen c6d8e5452b re-add dynamic feature flags for isInputPending (#27919)
## Summary

these were removed in https://github.com/facebook/react/pull/26617. adds
them back so we can conduct another experiment.

## How did you test this change?
`yarn test-www`

DiffTrain build for commit https://github.com/facebook/react/commit/c81f4e02bab9d03e1583047d041fdb5e4eb19415.
2024-01-09 22:25:38 +00:00
kassens 8c55ade707 Convert createReactClassIntegration-test to createRoot (#27914)
Convert createReactClassIntegration-test to createRoot

DiffTrain build for commit https://github.com/facebook/react/commit/9723093df319f06886fe488d6d88ff615a3e8fc3.
2024-01-09 20:35:28 +00:00
kassens 0460bbf487 Convert DOMPropertyOperations-test to createRoot (#27911)
Convert DOMPropertyOperations-test to createRoot

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

DiffTrain build for commit https://github.com/facebook/react/commit/ef2859d50bb6b4b31b304f4fe4bb43dc273a9b54.
2024-01-09 20:35:03 +00:00
kassensanddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> e78782492e Bump follow-redirects from 1.7.0 to 1.15.4 (#27909)
Bumps
[follow-redirects](https://github.com/follow-redirects/follow-redirects)
from 1.7.0 to 1.15.4.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/65858205e59f1e23c9bf173348a7a7cbb8ac47f5"><code>6585820</code></a>
Release version 1.15.4 of the npm package.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/7a6567e16dfa9ad18a70bfe91784c28653fbf19d"><code>7a6567e</code></a>
Disallow bracketed hostnames.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/05629af696588b90d64e738bc2e809a97a5f92fc"><code>05629af</code></a>
Prefer native URL instead of deprecated url.parse.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/1cba8e85fa73f563a439fe460cf028688e4358df"><code>1cba8e8</code></a>
Prefer native URL instead of legacy url.resolve.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/72bc2a4229bc18dc9fbd57c60579713e6264cb92"><code>72bc2a4</code></a>
Simplify _processResponse error handling.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/3d42aecdca39b144a0a2f27ea134b4cf67dd796a"><code>3d42aec</code></a>
Add bracket tests.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/bcbb096b32686ecad6cd34235358ed6f2217d4f0"><code>bcbb096</code></a>
Do not directly set Error properties.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/192dbe7ce671ecad813c074bffe3b3f5d3680fee"><code>192dbe7</code></a>
Release version 1.15.3 of the npm package.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/bd8c81e4f32d12f28a35d265f88b1716703687c6"><code>bd8c81e</code></a>
Fix resource leak on destroy.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/9c728c314b06f9595dcd7f245d40731e8a27d79f"><code>9c728c3</code></a>
Split linting and testing.</li>
<li>Additional commits viewable in <a
href="https://github.com/follow-redirects/follow-redirects/compare/v1.7.0...v1.15.4">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.7.0&new-version=1.15.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/facebook/react/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

DiffTrain build for commit https://github.com/facebook/react/commit/9c08b96a788196e6ed42c9e6c934b0296a8bcd99.
2024-01-09 17:09:46 +00:00
kassensanddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> c84fa10017 Bump follow-redirects from 1.14.0 to 1.15.4 in /fixtures/concurrent/time-slicing (#27907)
Bumps
[follow-redirects](https://github.com/follow-redirects/follow-redirects)
from 1.14.0 to 1.15.4.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/65858205e59f1e23c9bf173348a7a7cbb8ac47f5"><code>6585820</code></a>
Release version 1.15.4 of the npm package.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/7a6567e16dfa9ad18a70bfe91784c28653fbf19d"><code>7a6567e</code></a>
Disallow bracketed hostnames.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/05629af696588b90d64e738bc2e809a97a5f92fc"><code>05629af</code></a>
Prefer native URL instead of deprecated url.parse.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/1cba8e85fa73f563a439fe460cf028688e4358df"><code>1cba8e8</code></a>
Prefer native URL instead of legacy url.resolve.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/72bc2a4229bc18dc9fbd57c60579713e6264cb92"><code>72bc2a4</code></a>
Simplify _processResponse error handling.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/3d42aecdca39b144a0a2f27ea134b4cf67dd796a"><code>3d42aec</code></a>
Add bracket tests.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/bcbb096b32686ecad6cd34235358ed6f2217d4f0"><code>bcbb096</code></a>
Do not directly set Error properties.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/192dbe7ce671ecad813c074bffe3b3f5d3680fee"><code>192dbe7</code></a>
Release version 1.15.3 of the npm package.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/bd8c81e4f32d12f28a35d265f88b1716703687c6"><code>bd8c81e</code></a>
Fix resource leak on destroy.</li>
<li><a
href="https://github.com/follow-redirects/follow-redirects/commit/9c728c314b06f9595dcd7f245d40731e8a27d79f"><code>9c728c3</code></a>
Split linting and testing.</li>
<li>Additional commits viewable in <a
href="https://github.com/follow-redirects/follow-redirects/compare/v1.14.0...v1.15.4">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.14.0&new-version=1.15.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/facebook/react/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

DiffTrain build for commit https://github.com/facebook/react/commit/31603f19d7114b751e89846d6eec73a8fbcdae71.
2024-01-09 16:09:52 +00:00
sebmarkbage 0bdbe4387b [Fizz] Fix Client Render after Postpone (#27905)
If we end up client rendering a boundary due to an error after we have
already injected a postponed hole in that boundary we'll end up trying
to target a missing segment. Since we never insert segments for an
already errored boundary into the HTML. Normally an errored prerender
wouldn't be used but if it is, such as if it was an intentional client
error it triggers this case. Those should really be replaced with
postpones though.

This is a bit annoying since we eagerly build up the postponed path. I
took the easy route here and just cleared out the suspense boundary
itself from having any postponed slots. However, this still creates an
unnecessary replay path along the way to the boundary. We could probably
walk the path and remove any empty parent nodes.

What is worse is that if this is the only thing that postponed, we'd
still generate a postponed state even though there's actually nothing to
resume. Since this is a bit of an edge case already maybe it's fine.

In my test I added a check for the `error` event on `window` since this
error only surfaces by throwing an ignored error. We should really do
that globally for all tests. Our tests should fail by default if there's
an error logged to the window.

DiffTrain build for commit https://github.com/facebook/react/commit/f9dddcbbb1c0b73f974e78b9488927b778630682.
2024-01-09 04:57:11 +00:00
acdlite 92eda60c24 Fix: useDeferredValue initialValue suspends forever without switching to final (#27888)
Fixes a bug in the experimental `initialValue` option for
`useDeferredValue` (added in #27500).

If rendering the `initialValue` causes the tree to suspend, React should
skip it and switch to rendering the final value instead. It should not
wait for `initialValue` to resolve.

This is not just an optimization, because in some cases the initial
value may _never_ resolve — intentionally. For example, if the
application does not provide an instant fallback state. This capability
is, in fact, the primary motivation for the `initialValue` API.

I mostly implemented this correctly in the original PR, but I missed
some cases where it wasn't working:

- If there's no Suspense boundary between the `useDeferredValue` hook
and the component that suspends, and we're not in the shell of the
transition (i.e. there's a parent Suspense boundary wrapping the
`useDeferredValue` hook), the deferred task would get incorrectly
dropped.
- Similarly, if there's no Suspense boundary between the
`useDeferredValue` hook and the component that suspends, and we're
rendering a synchronous update, the deferred task would get incorrectly
dropped.

What these cases have in common is that it causes the `useDeferredValue`
hook itself to be replaced by a Suspense fallback. The fix was the same
for both. (It already worked in cases where there's no Suspense fallback
at all, because those are handled differently, at the root.)

The way I discovered this was when investigating a particular bug in
Next.js that would happen during a 'popstate' transition (back/forward),
but not during a regular navigation. That's because we render popstate
transitions synchronously to preserve browser's scroll position — which
in this case triggered the second scenario above.

DiffTrain build for commit https://github.com/facebook/react/commit/f1039be4a48384e7e4b0a87d4d92c48e900053b9.
2024-01-08 04:22:00 +00:00
kassens 89da9fc1c9 [churn] remove Node 19 from dev engines, add 21 (#27870)
This allows running `yarn` with Node 21 installed, also removes Node 19
which is no longer supported according to
https://nodejs.org/en/about/previous-releases

DiffTrain build for commit https://github.com/facebook/react/commit/1d5667a1273386f84e416059af7b6aba069e068e.
2024-01-02 19:44:59 +00:00
kassens 790a57633b [flow] upgrade to 0.225.1 (#27871)
This Flow upgrade includes 2 fixes:
- Remove `React$StatelessFunctionalComponent` as that was replaced by
just `React$AbstractComponent` as Flow doesn't make any guarantees, see
the Flow change here:
https://github.com/facebook/flow/commit/521317c48f44ffb5eac072a7b2548a72b0745095
- Flow no longer allows `number` type indexing into objects which
discovered an incorrect type that is actually an array of the data.

Used this command to upgrade
```
yarn add -W flow-bin flow-remove-types hermes-parser hermes-eslint
```
and ran `yarn flow-ci` to check for errors in different configurations.

DiffTrain build for commit https://github.com/facebook/react/commit/45d61cf7effdba6bbd9835bb427c99c95beb7e17.
2024-01-02 19:44:49 +00:00
sebmarkbage 0a8c177bc1 [Fizz] Only compute component stacks in DEV and prerenders (#27850)
If you have a lot of intentional throws (or postpones) from client-only
rendering then computing the stack is too much.

DiffTrain build for commit https://github.com/facebook/react/commit/c5b9375767e2c4102d7e5559d383523736f1c902.
2023-12-19 23:08:48 +00:00
alunyov df9e40450b [RSC @ Meta] Simplify implementation of isClientReference, getClientReferenceKey, resolveClientReferenceMetadata (#27839)
For clientReferences we can just check the instance of the
`clientReference`.
The implementation of `isClientReference` is provided via configuration.
The class for ClientReference has to implement an interface that has
`getModuleId() method.

DiffTrain build for commit https://github.com/facebook/react/commit/cb2439624f43c510007f65aea5c50a8bb97917e4.
2023-12-19 14:22:41 +00:00
hoxyq 0f1f06d81b fix[devtools/e2e]: add fallback for act in integration tests (#27842)
https://github.com/facebook/react/pull/27805 broke integration tests for
React DevTools with React 17, these changes introduce a fallback for
such case when `act` is not available in `react`, but available in
`react-dom`, like before.

DiffTrain build for commit https://github.com/facebook/react/commit/3e00e58a6ac7f73a3660f31d3129fb06d344167e.
2023-12-17 13:22:35 +00:00
rickhanlonii 4154783f4f docs: fix typo in README.md (#27841)
DiffTrain build for commit https://github.com/facebook/react/commit/8b1547b671f9ea9a2db38f2404557fb59b84afc0.
2023-12-16 23:42:41 +00:00
sebmarkbage c8618d36d2 [Flight] Wire up async_hooks in Node.js DEV for inspecting Promises (#27840)
This wires up the use of `async_hooks` in the Node build (as well as the
Edge build when a global is available) in DEV mode only. This will be
used to track debug info about what suspended during an RSC pass.

Enabled behind a flag for now.

DiffTrain build for commit https://github.com/facebook/react/commit/8b8d265bd9a4cab7bbd04a9a13950fdc946ea51c.
2023-12-16 02:42:41 +00:00
gnoff 5344d070c0 [Fizz] Add Component Stacks to onError and onPostpone when in dev mode or during prerenders in prod mode (#27761)
Historically React would produce component stacks for dev builds only.
There is a cost to tracking component stacks and given the prod builds
try to optimize runtime performance these stacks were left out. More
recently React added production component stacks to Fiber in because it
can be immensely helpful in tracking down hard to debug production
issues. Fizz was not updated to have a similar behavior.

With the advent of prerendering however stacks for production in Fizz
are more relevant because prerendering is not really a dev-time task. If
you want the ability to reason about errors or postpones that happen
during a prerender having component stacks to interrogate is helpful and
these component stacks need to be available in production otherwise you
are really never going to see them. (it is possible that you could do
dev-mode prerenders but we don't expect this to be a common dev mode
workflow)

To better support the prerender use case and to make error logging in
Fizz more useful the following changes have been made

1. `onPostpone` now accepts a second `postponeInfo` argument which will
contain a componentStack. Postpones always originate from a component
render so the stack should be consistently available. The type however
will indicate the stack is optional so we can remove them in the future
if we decide the overhead is the wrong tradeoff in certain cases
2. `onError` now accepts a second `errorInfo` argument which may contain
a componentStack. If an error originated from a component a stack will
be included in the following cases.

This change entails tracking the component hierarchy in prod builds now.
While this isn't cost free it is implemented in a relatively lean
manner. Deferring the most expensive work (reifying the stack) until we
are actually in an error pathway.

In the course of implementing this change a number of simplifications
were made to the code which should make the stack tracking more
resilient. We no longer use a module global to curry the stack up to
some handler. This was delicate because you needed to always reset it
properly. We now curry the stack on the task itself.

Another change made was to track the component stack on SuspenseBoundary
instances so that we can provide the stack when aborting suspense
boundaries to help you determine which ones were affected by an abort.

DiffTrain build for commit https://github.com/facebook/react/commit/63310df2b243b6c3b2f01e8b121e7d115e839cfb.
2023-12-16 02:10:24 +00:00
kassens 8991f3ef0d [ci] remove fuzz tests from CircleCI (#27831)
These have been migrated to GitHub Actions with
c01ac689e9.

DiffTrain build for commit https://github.com/facebook/react/commit/493610f299ddf7d06e147e60dc4f2b97482982d2.
2023-12-12 20:43:01 +00:00
kassens 5ccbcfc9cd convert circleci worklfow fuzz_tests to github actions (#27801)
## Summary

This pull request converts the CircleCI workflows to GitHub actions
workflows. [Github Actions
Importer](https://github.com/github/gh-actions-importer) was used to
convert the workflows initially, then I edited them manually to correct
errors in translation.

## How did you test this change?

I tested these changes in a forked repo. You can [view the logs of this
workflow in my fork](https://github.com/robandpdx/react/actions).

https://fburl.com/workplace/f6mz6tmw

DiffTrain build for commit https://github.com/facebook/react/commit/c01ac689e9628c952761ba0583d6c00ba5521c6a.
2023-12-12 20:00:39 +00:00
kassens 2ad853a788 Add feature flags for expiration times (#27821)
It seems worthwhile to me to run a test to experiment with different
expiration times. This moves the expiration times for scheduler and
reconciler into FeatureFlags for the facebook build. Non-facebook should
not be affected by these changes.

DiffTrain build for commit https://github.com/facebook/react/commit/0cdfef19b96cc6202d48e0812b5069c286d12b04.
2023-12-11 15:02:55 +00:00
kassens 51cc16a738 Remove WARNINGS file from FB (#27820)
The test was migrated to the generated JS file that allows Jest to track
the dependencies, we can now remove this file generation.

DiffTrain build for commit https://github.com/facebook/react/commit/40f653d13c363c6f81b13de67ce391991fb1f870.
2023-12-08 21:25:55 +00:00
gnoff 1cf4f0336e [Flight] Support postponing through a serialized promise (#27818)
Postponing in a promise that is being serialized to the client from the
server should be possible however prior to this change Flight treated
this case like an error rather than a postpone. This fix adds support
for postponing in this position and adds a test asserting you can
successfully prerender the root if you unwrap this promise inside a
suspense boundary.

DiffTrain build for commit https://github.com/facebook/react/commit/5bcade5fcf5610e82e7cda05cc6de574bdace0c7.
2023-12-08 19:10:33 +00:00
kassens c63a3badbe Add header to ReactAllWarnings Meta-only file (#27819)
Adds missing headers to the generated file.

DiffTrain build for commit https://github.com/facebook/react/commit/8ff2c236a233a78c18d6f524dd74baec9153fd37.
2023-12-08 18:48:57 +00:00
kassens 2598dd8bfa [ci] try to fix commit_artifacts step (#27817)
Tries to fix the failure from
https://github.com/facebook/react/actions/runs/7142005723/job/19450371514

I think it failed because we cannot `mv` into a folder with existing
files or folders.

DiffTrain build for commit https://github.com/facebook/react/commit/d3ed07bce036df61fbce52151f1531a5762ba6d6.
2023-12-08 17:43:09 +00:00
jackpope d101850e48 Add stable concurrent option to react-test-renderer (#27804)
## Summary

Concurrent rendering has been the default since React 18 release.
ReactTestRenderer requires passing `{unstable_isConcurrent: true}` to
match this behavior, which means by default tests written with RTR use a
different rendering method than the code they test.

Eventually, RTR should only use ConcurrentRoot. As a first step, let's
add a version of the concurrent option that isn't marked unstable. Next
we will follow up with removing the unstable option when it is safe to
merge.

## How did you test this change?

`yarn test
packages/react-test-renderer/src/__tests__/ReactTestRendererAsync-test.js`

DiffTrain build for commit https://github.com/facebook/react/commit/b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9.
2023-12-07 15:31:27 +00:00
kassens 108b7a68f5 Enable flag disableModulePatternComponents for native-fb (#27807)
#27742 will remove this feature flag altogether, this just already
removes the dynamic flag for the Meta React Native build ahead of time.

DiffTrain build for commit https://github.com/facebook/react/commit/be8aa76873e231555676483a36534bb48ad1b1a3.
2023-12-06 21:07:32 +00:00
gnoff 8174454ad0 Update act references in tests (#27805)
As part of the process of removing the deprecated `react-dom/test-utils`
package references to `act` from this module are replaced with
references to `unstable_act` in `react`. It is likely that the unstable
act implementation will be made stable. The test utils act is just a
reexport of the unstable_act implementation in react itself.

DiffTrain build for commit https://github.com/facebook/react/commit/9cae4428a13c1377df9b4a752f8d87646df461ec.
2023-12-06 21:02:13 +00:00
kassens a8106c441a [easy] remove unused deps coveralls and @actuallyworks/node-fetch (#27792)
I do not see references to these modules. Unless there's some dynamic
loading going on (hopefully we should see that in CI) these seem like
they can be removed.

DiffTrain build for commit https://github.com/facebook/react/commit/aba93acb6c87c4fe87a5966d955f67acbf527bf4.
2023-12-05 19:21:03 +00:00
hoxyq 56c0affa35 fix: add isChildPublicInstance to ReactNativeTypes (#27788)
Follow-up on https://github.com/facebook/react/pull/27783.

React Native is actually using `ReactNativeTypes`, which are synced from
this repo. In order to make `isChildPublicInstance` visible for
renderers inside React Native repository, we need to list it in
`ReactNativeTypes`.

Because of current circular dependency between React Native and React,
it is impossible to actually type it properly:
- Can't import any types in `ReactNativeTypes` from local files, because
it will break React Native, once synced.
- Implementations can't use real types in their definitions, because it
will break these checks:

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/fabric.js#L12-L13

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/index.js#L12-L14

DiffTrain build for commit https://github.com/facebook/react/commit/c29ca23af91d8aeb9e175c08a0866ba54286f0f3.
2023-12-05 13:05:36 +00:00
kassens de3fc70fb8 package.json: cleanup deprecated scripts (#26852)
I think these have been dead for a while now. If the purpose is
documentation, we should see if we need to improve `yarn test --help` or
something instead.

DiffTrain build for commit https://github.com/facebook/react/commit/5ab6bbb4b058e22658fc6d4734db5acfbf393345.
2023-12-04 21:24:25 +00:00
kassens fd2c95816a Flow: make more objects exact (#27790)
This makes a couple objects more exact. Nothing critical, just noticed
this old branch I had created when doing some Flow upgrades in the past.

DiffTrain build for commit https://github.com/facebook/react/commit/f498aa299292d4d1e999f66d1c769440ad10d57c.
2023-12-04 21:15:10 +00:00
kassens 0ae27037c4 Create warnings JS file for Meta (#27786)
The `WARNINGS` file isn't picked up by the test dependency analyzer,
this creates a JS version of the file that I think should work.

DiffTrain build for commit https://github.com/facebook/react/commit/223db40d5a04dc3311f963f5296675f7f43139e8.
2023-12-04 18:38:17 +00:00
kassens b94d209ced Update warnings extraction to hermes-parser (#27785)
`hermes-parser` is recommended for all Flow files as it supports the
latest features. I noticed we were still using babel here.

Test Plan:
no diff in output before and after

DiffTrain build for commit https://github.com/facebook/react/commit/f391cdab02e90d7e9156a7e6d20c7d92a3c375ac.
2023-12-04 18:30:56 +00:00
hoxyq 73da448d35 feat[Fabric/Paper]: support isChildPublicInstance api method (#27783)
Adds `isChildPublicInstance` method to both renderers (Fabric and
Paper), which will receive 2 public instances and return if first
argument is an ancestor of the second, based on fibers.

This will be used as a fallback when DOM node APIs are not available:
for Paper renderer or for Fabric without DOM node APIs.

How it is going to be used: to determine which `AppContainer` component
in RN is responsible for highlighting an inspected element on the
screen.

DiffTrain build for commit https://github.com/facebook/react/commit/1729b499ed8cd456ef3d8bccd413cdecd9931abc.
2023-12-04 17:27:01 +00:00
kassens c114997251 [flow] upgrade to 0.213.2 (#27784)
No significant changes from Flow, just keeping us current.

[Changelog](https://github.com/facebook/flow/blob/main/Changelog.md)

DiffTrain build for commit https://github.com/facebook/react/commit/e3fb6ac862e895d7e491628589fca8300f308887.
2023-12-04 16:40:11 +00:00
kassens 70bf4f853a [lint] treat React.use() the same as use() (#27769)
We should probably treat `React.use()` the same as `use()` to allow it
within loops and conditionals.

Ideally this would implement a test that `React` is imported or required
from `'react'`, but we don't otherwise implement such a test.

DiffTrain build for commit https://github.com/facebook/react/commit/640ccebb7d9669f1efbd20e86f6f84086c3d698d.
2023-12-01 20:05:51 +00:00
kassensanddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> a4be190a0d Bump @adobe/css-tools from 4.0.1 to 4.3.2 in /fixtures/flight (#27766)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.0.1
to 4.3.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/adobe/css-tools/blob/main/History.md"><code>@​adobe/css-tools</code>'s
changelog</a>.</em></p>
<blockquote>
<h1>4.3.2 / 2023-11-28</h1>
<ul>
<li>Fix redos vulnerability with specific crafted css string -
CVE-2023-48631</li>
<li>Fix Problem parsing with :is() and nested :nth-child() <a
href="https://redirect.github.com/adobe/css-tools/issues/211">#211</a></li>
</ul>
<h1>4.3.1 / 2023-03-14</h1>
<ul>
<li>Fix redos vulnerability with specific crafted css string -
CVE-2023-26364</li>
</ul>
<h1>4.3.0 / 2023-03-07</h1>
<ul>
<li>Update build tools</li>
<li>Update exports path and files</li>
</ul>
<h1>4.2.0 / 2023-02-21</h1>
<ul>
<li>Add <a
href="https://github.com/container"><code>@​container</code></a>
support</li>
<li>Add <a href="https://github.com/layer"><code>@​layer</code></a>
support</li>
</ul>
<h1>4.1.0 / 2023-01-25</h1>
<ul>
<li>Support ESM Modules</li>
</ul>
<h1>4.0.2 / 2023-01-12</h1>
<ul>
<li><a
href="https://redirect.github.com/adobe/css-tools/issues/71">#71</a> :
<a href="https://github.com/import"><code>@​import</code></a> does not
work if url contains ';'</li>
<li><a
href="https://redirect.github.com/adobe/css-tools/issues/77">#77</a> :
Regression in selector parsing: Attribute selectors not parsed
correctly</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/adobe/css-tools/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@adobe/css-tools&package-manager=npm_and_yarn&previous-version=4.0.1&new-version=4.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/facebook/react/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

DiffTrain build for commit https://github.com/facebook/react/commit/d7b45ec9b765575e63e034fb7d844027a323b06c.
2023-12-01 20:00:55 +00:00
kassens 517d214670 Add sideEffects flag to react-is for tree shaking (#27701)
## Summary

This PR:

- Adds the `"sideEffects": false` flag to the `react-is` package, to
enable proper tree-shaking

## How did you test this change?

React-Redux v9 beta switches its artifacts from separate JS files to
pre-bundled artifacts. While testing builds locally, I noticed that our
use of `react-is` was no longer getting tree-shaken from Vite builds,
despite `react-is` only being used by our `connect` API and `connect`
itself getting shaken out of the final bundle.

Hand-adding `"sideEffects": false` to the `react-is` package locally
convinced Vite (+Rollup) to properly tree-shake `react-is` out of the
bundle when it wasn't being used.

I'd love to see this published as v18.2.1 as soon as this PR is merged -
we're hoping to release React-Redux v9 in the next few weeks!

DiffTrain build for commit https://github.com/facebook/react/commit/108fd8cab015688e6e8e57956c2f1ed1a0c054f2.
2023-12-01 19:42:52 +00:00
kassens 5a28486896 Update .prettierrc.js (#27732)
jsxBracketSameLine deprecated in v2.4.0 of Prettier, replaced by
bracketSameLine.

https://prettier.io/docs/en/options.html#deprecated-jsx-brackets

<!--
  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

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

I've always wanted to contribute to open source, even if it's in the
smallest way possible. Resolves deprecated feature with currently used
version of Prettier (2.4+). Those doing things like using React as a
reference for their ".prettierrc" files will be using the non-deprecated
versions.

## How did you test this change?

Modified line 969 of App.js to push </h1> to line 971, saved the file,
then ran "yarn prettier" and formatting returned it to original position
confirming that jsxBracketSameLine acts in the same fashion to
bracketSameLine, but also is no longer deprecated that has additional
features which may be useful in the future to the project.

<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->

λ yarn prettier
yarn run v1.22.19
$ node ./scripts/prettier/index.js write-changed
> git merge-base HEAD main
> git diff --name-only --diff-filter=ACMRTUB
bbb9cb116d
> git ls-files --others --exclude-standard
Done in 1.52s.

DiffTrain build for commit https://github.com/facebook/react/commit/dc40571b3efd18d4d08fdf6146ad5ec980ea12dd.
2023-12-01 19:35:18 +00:00
hoxyq 01d7c9757b fix: select console error to not suggest to set readonly to true (#27740)
fix #27657

added test in the `ReactDOMSELECT-test.js` to not allow regession to
happen in future.

After changes this is what the error message looks like

https://github.com/facebook/react/assets/72331432/53dcbe2a-70d2-43d2-a52d-a4fc389fdfbf

DiffTrain build for commit https://github.com/facebook/react/commit/5dd35968bef791ccc5948c657fabf191a77fff3f.
2023-12-01 15:59:58 +00:00
jackpopeandJack Pope 2b931e470e Rename fork ReactSharedInternals -> ReactSharedInternalsClient (#27767)
## Summary

Follow up from #27717 based on feedback to rename the fork module itself

## How did you test this change?

- `yarn build`
- `yarn test
packages/scheduler/src/__tests__/SchedulerUMDBundle-test.internal.js`

Co-authored-by: Jack Pope <jackpope@meta.com>

DiffTrain build for commit https://github.com/facebook/react/commit/3e97c00debbd6706b6ec6b7da15094bf2ba81ef4.
2023-12-01 14:52:49 +00:00
kassens 82cd6d3cfc [lint] move use lint to non-experimental (#27768)
`use` is being stabilized, so let's make sure the lint is updated for
the next release.

DiffTrain build for commit https://github.com/facebook/react/commit/b8be034f07e1abc59863742063f5baeff20e33fe.
2023-11-30 22:43:52 +00:00
kmiddleton14 8f66c8dadd Update README.md with react.dev links (#27765)
## Summary

Update legacy reactjs.org links and update to the corresponding ones on
react.dev

## How did you test this change?

Verify all links go to the expected pages

DiffTrain build for commit https://github.com/facebook/react/commit/60ad3693a554f24b116f3f9afdb171fb4beb6d02.
2023-11-30 17:13:18 +00:00
hoxyq 88862bbdc9 React DevTools 4.28.5 -> 5.0.0 (#27759)
### Breaking
* refactor[devtools]: highlight an array of elements for native
([hoxyq](https://github.com/hoxyq) in
[#27734](https://github.com/facebook/react/pull/27734))

### Features
* feat[devtools]: display Forget badge for the relevant components
([hoxyq](https://github.com/hoxyq) in
[#27709](https://github.com/facebook/react/pull/27709))

### Other
* Added windows powershell syntax to build scripts
([PrathamLalwani](https://github.com/PrathamLalwani) in
[#27692](https://github.com/facebook/react/pull/27692))
* refactor[react-devtools-shared]: minor parsing improvements and
modifications ([hoxyq](https://github.com/hoxyq) in
[#27661](https://github.com/facebook/react/pull/27661))

DiffTrain build for commit https://github.com/facebook/react/commit/87cb0bf182c59192047d6adaec228d821c298f4a.
2023-11-29 18:32:51 +00:00
alunyov 1416eb8618 FB-specific builds of Flight Server, Flight Client, and React Shared Subset (#27579)
This PR adds a new FB-specific configuration of Flight. We also need to
bundle a version of ReactSharedSubset that will be used for running
Flight on the server.

This initial implementation does not support server actions yet.

The FB-Flight still uses the text protocol on the server (the flag
`enableBinaryFlight` is set to false). It looks like we need some
changes in Hermes to properly support this binary format.

DiffTrain build for commit https://github.com/facebook/react/commit/c17a27ef492d9812351aecdfb017488e8e8404ce.
2023-11-27 23:40:02 +00:00