Commit Graph

191 Commits

Author SHA1 Message Date
gnoff be35c8a6ef [Float] support fetchpriority on ReactDOM.preload() and ReactDOM.preinit() (#26880)
exposes fetchPriority as an option for `ReactDOM.preload()` and
`ReactDOM.preinit()`

the typings should be `'high' | 'low' | 'auto'`

DiffTrain build for commit https://github.com/facebook/react/commit/042d8f606ce643d2eca955badbf07ea5b8ac266c.
2023-06-01 20:17:31 +00:00
tyao1 2c4d9cef8b Always trigger componentWillUnmount in StrictMode (#26842)
<!--
  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?
-->
In StrictMode, React currently only triggers `componentWillUnmount` if
`componentDidMount` is defined. This would miss detecting issues like
initializing resources in constructor or componentWillMount, for
example:
```
class Component {
  constructor() {
     this._subscriptions = new Subscriptions();
  }
  componentWillUnmount() {
     this._subscriptions.reset();
  }
}
```

The PR makes `componentWillUnmount` always run in StrictMode.

## How did you test this change?

<!--
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 test ci`

DiffTrain build for commit https://github.com/facebook/react/commit/811022232efed62a3c943701bc99d18655bc78b3.
2023-06-01 17:40:16 +00:00
rickhanlonii b80a98a52d Clean up enableSyncDefaultUpdates flag a bit (#26858)
## Overview

Does a few things:
- Renames `enableSyncDefaultUpdates` to
`forceConcurrentByDefaultForTesting`
- Changes the way it's used so it's dead-code eliminated separate from
`allowConcurrentByDefault`
- Deletes a bunch of the gated code

The gates that are deleted are unnecessary now. We were keeping them
when we originally thought we would come back to being concurrent by
default. But we've shifted and now sync-by default is the desired
behavior long term, so there's no need to keep all these forked tests
around.

I'll follow up to delete more of the forked behavior if possible.
Ideally we wouldn't need this flag even if we're still using
`allowConcurrentByDefault`.

DiffTrain build for commit https://github.com/facebook/react/commit/018c58c9c65452cff25aaf1f38f78a9b90d8e5c1.
2023-06-01 13:31:00 +00:00
gnoff 4c0c82b945 [Fizz] preload bootstrapModules (#26754)
stacked on #26753

Adds support for preloading bootstrapModules. We don't yet support
modules in Float's public interface but this implementation should be
compatible with what we do when we add it.

DiffTrain build for commit https://github.com/facebook/react/commit/ae31d2ea3c3f9f0a87ff2c6193484d5d8786bc5f.
2023-05-31 23:53:03 +00:00
gnoff 8eeccff021 [Fizz] preload bootstrapScripts (#26753)
This PR adds a preload for bootstrapScripts. preloads are captured
synchronously when you create a new Request and as such the normal logic
to check if a preload already exists is skipped.

DiffTrain build for commit https://github.com/facebook/react/commit/b864ad4397e7b366ece9ecfdfafa5660ae6b8390.
2023-05-31 23:30:27 +00:00
gnoff 6e4ace8a25 [Fiber][Float] preinitialized stylesheets should support integrity option (#26881)
preinitialized stylesheets did not render the integrity option on the
client implementation of Float. This was an oversight.

DiffTrain build for commit https://github.com/facebook/react/commit/e1e68b9f7ffecf98e1b625cfe3ab95741be1417b.
2023-05-31 20:53:54 +00:00
gnoff 8f0236b525 [Fiber] retain scripts on clearContainer and clearSingleton (#26871)
clearContainer and clearSingleton both assumed scripts could be safely
removed from the DOM because normally once a script has been inserted
into the DOM it is executable and removing it, even synchronously, will
not prevent it from running. However There is an edge case in a couple
browsers (Chrome at least) where during HTML streaming if a script is
opened and not yet closed the script will be inserted into the document
but not yet executed. If the script is removed from the document before
the end tag is parsed then the script will not run. This change causes
clearContainer and clearSingleton to retain script elements. This is
generally thought to be safe because if we are calling these methods we
are no longer hydrating the container or the singleton and the scripts
execution will happen regardless.

DiffTrain build for commit https://github.com/facebook/react/commit/1cea384480a6dea80128e5e0ddb714df7bea1520.
2023-05-30 20:18:41 +00:00
sebmarkbage 67de87bc01 Compare name when hydrating hidden fields to filter out extra form action fields (#26846)
This solves an issue where if you inject a hidden field in the beginning
of the form, we might mistakenly hydrate the injected one that was part
of an action.

I'm not too happy about how specific this becomes. It's similar to Float
but in general we don't do this deep comparison.

See https://github.com/vercel/next.js/issues/50087

DiffTrain build for commit https://github.com/facebook/react/commit/a1f97589fd298cd71f97339a230f016139c7382f.
2023-05-26 16:58:39 +00:00
rickhanlonii f3bd734469 Update enableSyncDefaultUpdates for www (#26857)
If this is false, it dead code eliminates the path to use the root flag.
Will follow up to clean this up.

DiffTrain build for commit https://github.com/facebook/react/commit/0210f0b082c95f5aec08f356d796c512eab44fc4.
2023-05-26 01:37:57 +00:00
acdlite e7364586d1 Remove temporary CircleCI workaround (#26855)
There was a CircleCI bug that prevented the sizebot job from accessing
the artifacts API. I had added a temporary workaround to pull from a
mirror instead. This seems to have been fixed, so I can remove the
workaround.

DiffTrain build for commit https://github.com/facebook/react/commit/4daccade04ae54339463546e06f07db56a646bd4.
2023-05-25 17:43:38 +00:00
kassens 49e9133a4b [flow] upgrade to 0.206.0 (#26850)
Small upgrade. The one impact was deprecation of `$Shape` where it seems
like we can just use a plain object with optional key.

DiffTrain build for commit https://github.com/facebook/react/commit/18dedde6a7d63ffafd2f7e135f9edf424eee0bcd.
2023-05-25 17:43:19 +00:00
kassens eb5c467b36 run SchedulerFeatureFlags with variant flags again (#26851)
With df12d7eac4 I accidentally made it so
that tests aren't run with the 2 variant modes for most
SchedulerFeatureFlags anymore. This fixes it with the same approach as
ee4233bdbc.

Test Plan:
Run and notice the boolean flags follow the variant:
```
yarn test-www --variant=true
yarn test-www --variant=false
```

DiffTrain build for commit https://github.com/facebook/react/commit/9a72e622716f6dab714ebe8b957ee9970154664b.
2023-05-25 14:43:16 +00:00
rickhanlonii 475ee24eba Move enableSyncDefaultUpdates to test config (#26847)
DiffTrain build for commit https://github.com/facebook/react/commit/ee4233bdbc71a7e09395a613c7dde01194d2a830.
2023-05-24 22:30:45 +00:00
sammy-SC 92b9d94300 Add $FlowFixMe to fix React Native DiffTrain (#26841)
DiffTrain build for commit https://github.com/facebook/react/commit/6fc3333b685657c8e6425df9fcb4fe1ce7374d40.
2023-05-24 16:47:45 +00:00
gnoff ff94fad9a1 Update preload links to support nonce and fetchpriority (#26826)
Currently when React generates rel=preload link tags for script/stylesheet resources, it will not carryover nonce and fetchpriority values if specified on the original elements.

This change ensures that the preload links use the nonce and fetchPriority values if they were specified.

DiffTrain build for commit https://github.com/facebook/react/commit/535c038d15d21f33e678187410d658456cc0ce39.
2023-05-23 03:01:01 +00:00
sophiebits 1bffb4ba16 Updated Copyright comment from Facebook to Meta (#26833)
## Summary
Changed the comment in react/packages/react
/react.shared-subset.js saying
```
Copyright (c) Facebook, Inc. and affiliates ..
```
To
```
Copyright (c) Meta Platforms, Inc. and affiliates ..
```
as raised in the following issues:
https://github.com/facebook/react/issues/26829

Files Changed:
react/packages/react/react.shared-subset.js

## How did you test this change?

Tests Required: No

DiffTrain build for commit https://github.com/facebook/react/commit/7bd330e0b0d740e4ffda25a179a4d06081f1b8e7.
2023-05-20 00:59:09 +00:00
sophiebits 5112e9fbcf Updated copyright text to Copyright (c) Meta Platforms, Inc. and its … (#26830)
…affiliates.

## Summary

There were 8 different places where the copyright comment was wrong.
Rewrote from "Copyright (c) Facebook, Inc. and its affiliates." to
"Copyright (c) Meta Platforms, Inc. and its affiliates."

## How did you test this change?
No code was changed. Comment was still a comment after changes.

Co-authored-by: Dennis Moradkhani <denmo530@student.liu.se>

DiffTrain build for commit https://github.com/facebook/react/commit/4b877b6c661417e932056e12732e3d2697562dc8.
2023-05-20 00:58:11 +00:00
sebmarkbage 3c60dbb4dc Remove Flight Relay DOM/Native (#26828)
The bindings upstream in Relay has been removed so we don't need these
builds anymore. The idea is to revisit an FB integration of Flight but
it wouldn't use the Relay specific bindings. It's a bit unclear how it
would look but likely more like the OSS version so not worth keeping
these around.

The `dom-relay` name also included the FB specific Fizz implementation
of the streaming config so I renamed that to `dom-fb`. There's no Fizz
implementation for Native yet so I just removed `native-relay`.

We created a configurable fork for how to encode the output of Flight
and the Relay implementation encoded it as JSON objects instead of
strings/streams. The new implementation would likely be more stream-like
and just encode it directly as string/binary chunks. So I removed those
indirections so that this can just be declared inline in
ReactFlightServer/Client.

DiffTrain build for commit https://github.com/facebook/react/commit/5309f102854475030fb91ab732141411b49c1126.
2023-05-18 00:39:21 +00:00
hoxyq 7198d1e104 Fix strict mode badge URL (#26825)
## Summary
Closes https://github.com/facebook/react/issues/26821

[[Fix #26821]](https://github.com/facebook/react/issues/26821) Update
strict mode badge URL

Updated the URL in the strict mode badge to point to the correct React
documentation for StrictMode. The previous URL was outdated. Now, when a
component is not running in StrictMode, the badge links to
https://react.dev/reference/react/StrictMode for more information.

## How did you test this change?

I verified that the strict mode badge now correctly links to the updated
URL. Previously, it pointed to the outdated URL
(https://fb.me/devtools-strict-mode). After the update, it correctly
points to the React Dev documentation for StrictMode
(https://react.dev/reference/react/StrictMode).

_Since its my first contribution here, i have completed the CLA_

DiffTrain build for commit https://github.com/facebook/react/commit/d7a98a5e97c3512ba43dd809337ae1691df1ae66.
2023-05-17 12:40:14 +00:00
hoxyq 04297e11bd React DevTools 4.27.7 -> 4.27.8 (#26823)
Closes https://github.com/facebook/react/issues/26787,
https://github.com/facebook/react/issues/26793

Includes these changes:
* fix[devtools]: fixed duplicated backend activation with multiple
renderers ([hoxyq](https://github.com/hoxyq) in
[#26807](https://github.com/facebook/react/pull/26807))

DiffTrain build for commit https://github.com/facebook/react/commit/2468a87358de55137508e777846746091d7a1514.
2023-05-17 10:47:19 +00:00
acdlite 0d0ce18354 Lower Suspense throttling heuristic to 300ms (#26803)
Now that the throttling mechanism applies more often, we've decided to
lower this a tad to ensure it's not noticeable. The idea is it should be
just large enough to prevent jank when lots of different parts of the UI
load in rapid succession, but not large enough to make the UI feel
sluggish. There's no perfect number, it's just a heuristic.

DiffTrain build for commit https://github.com/facebook/react/commit/f8de255e94540f9018d8196b3a34da500707c39b.
2023-05-16 20:05:12 +00:00
acdlite c488cce876 Fix Suspense throttling mechanism (#26802)
The throttling mechanism for fallbacks should apply to both their
appearance _and_ disappearance.

This was mostly addressed by #26611. See that PR for additional context.

However, a flaw in the implementation is that we only update the the
timestamp used for throttling when the fallback initially appears. We
don't update it when the real content pops in. If lots of content in
separate Suspense trees loads around the same time, you can still get
jank.

The issue is fixed by updating the throttling timestamp whenever the
visibility of a fallback changes. Not just when it appears.

DiffTrain build for commit https://github.com/facebook/react/commit/4bfcd02b2cebcb390f5aff0d7747c60a55012d5d.
2023-05-16 19:09:29 +00:00
sophiebits 3546b414cc Fix uSES hydration in strict mode (#26791)
Previously, we'd call and use getSnapshot on the second render resulting
in `Warning: Text content did not match. Server: "Nay!" Client: "Yay!"`
and then `Error: Text content does not match server-rendered HTML.`.

Fixes #26095. Closes #26113. Closes #25650.

---------

Co-authored-by: eps1lon <silbermann.sebastian@gmail.com>

DiffTrain build for commit https://github.com/facebook/react/commit/4cd7065665ea2cf33c306265c8d817904bb401ca.
2023-05-12 21:22:47 +00:00
Pieter Vanderwerff 19188c459e Presuppress Flow errors for 0.206 in fbsource
Differential Revision: D45756542nnPull Request resolved: https://github.com/facebook/react-fbsource-import/pull/4
2023-05-12 11:15:56 -07:00
javache be012b06a3 [react-native] Always set RN$stopSurface (#26808)
## Summary
To support incremental adoption of bridgeless logic we want to default
to using these globals whenever they're available.

## How did you test this change?
https://github.com/facebook/react-native/pull/37410

DiffTrain build for commit https://github.com/facebook/react/commit/a389046a529c6d22ba5895dd7f5d4b0b8d17c345.
2023-05-12 15:21:33 +00:00
hoxyq 377d1e5b74 fix[devtools]: fixed duplicated backend activation with multiple renderers (#26807)
## Summary
Initially reported in https://github.com/facebook/react/issues/26797.
Was not able to reproduce the exact same problem, but found this case:

1. Open corresponding codepen from the issue in debug mode
2. Open components tab of the extension
3. Refresh the page

Received multiple errors:
- Warning in the Console tab: Invalid renderer id "2".
- Error in the Components tab: Uncaught Error: Cannot add node "3"
because a node with that id is already in the Store.

This problem has occurred after landing a fix in
https://github.com/facebook/react/pull/26779. Looks like Chrome is
keeping the injected scripts (the backend in this case) and we start
backend twice.

DiffTrain build for commit https://github.com/facebook/react/commit/67a05d03e38b9837e27c9fe0a673557e63ff03c5.
2023-05-12 14:04:43 +00:00
kassens 421c52f05d [www] reduce dynamic SchedulerFeatureFlags (#26617)
For these values we're not using dynamic values. We can statically
compile in the values we're running.

DiffTrain build for commit https://github.com/facebook/react/commit/df12d7eac40c87bd5fdde0aa5a739bce9e7dce27.
2023-05-10 21:31:51 +00:00
acdlite 8bd06fd0d6 Fix nightly job to publish to "canary" channel (#26799)
When I was renaming the next channel to canary, I updated the
`publish_preleases` workflow correctly, but I skipped over
`publish_preleases_nightly`. Oops.

DiffTrain build for commit https://github.com/facebook/react/commit/7cd98ef2bcbc10f164f778bade86a4daeb821011.
2023-05-10 02:32:36 +00:00
acdlite a25fa24bd9 Change yarn test to default to experimental (#26741)
The idea is that the default `yarn test` command should be the one that
includes the most bleeding edge features, because during development you
probably want as many features enabled as possible.

That used to be `www-modern` but nowadays it's `experimental` because
we've landed a bunch of async actions stuff in experimental but it isn't
yet being tested at Meta.

So this switches the default to `experimental`.

DiffTrain build for commit https://github.com/facebook/react/commit/b5810163e913e8c95a7a0a6dee039bc102e3c987.
2023-05-10 01:56:15 +00:00
kassens 6227a7fd81 Flow upgrade to 0.205.1 (#26796)
Just a small upgrade to keep us current and remove unused suppressions
(probably fixed by some upgrade since).

- `*` is no longer allowed and has been an alias for `any` for a while
now.

DiffTrain build for commit https://github.com/facebook/react/commit/fda1f0b902b527089fe5ae7b3aa573c633166ec9.
2023-05-09 14:53:10 +00:00
kassens ef06657b12 Small flowconfig fixes (#26784)
- The whole project root is included by default anyway, the include
section should be redundant and just misleading.
- The generated ignore paths ignore more than intended as they didn't
escape the `.` for regex.

Test Plan:
- wait for CI
- tested the ignore pattern change with renaming files and seeing the
expected files ignored for flow

DiffTrain build for commit https://github.com/facebook/react/commit/7ac5e9a602347f3b7d26c60a549c483d3bc88bbf.
2023-05-08 16:14:43 +00:00
acdlite 4e6ccd72ab Add useFormStatus to server rendering stub (#26788)
This was an oversight when I set up the hook in #26719.

DiffTrain build for commit https://github.com/facebook/react/commit/16d053d592673dd5565d85109f259371b23f87e8.
2023-05-07 00:43:50 +00:00
gaearon d4ffe42ab7 [Release Script] Print a hint where to get the token (#26783)
I always forget where to get it.

DiffTrain build for commit https://github.com/facebook/react/commit/efb381bbf981aedbf4eb9e1bd0e6e30abce266d1.
2023-05-05 19:13:56 +00:00
sammy-SC 2d742d3f73 Use native scheduler if defined in global scope (#26554)
Co-authored-by: Dan Abramov <dan.abramov@gmail.com>

DiffTrain build for commit https://github.com/facebook/react/commit/b00e27342d6ff0f2a3a57b8e1edf66290d27cf07.
2023-05-05 13:08:11 +00:00
hoxyq 3c532c665b React DevTools 4.27.6 -> 4.27.7 (#26780)
List of changes:
* DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in
[#26779](https://github.com/facebook/react/pull/26779))
* fix[dynamic-scripts-injection]: unregister content scripts before
registration ([hoxyq](https://github.com/hoxyq) in
[#26765](https://github.com/facebook/react/pull/26765))

DiffTrain build for commit https://github.com/facebook/react/commit/783e7fcfa3e354b3be13f5403fc2fd2260db00b4.
2023-05-04 17:28:58 +00:00
hoxyq 7216e1fc7e DevTools: fix backend activation (#26779)
## Summary
We have a case:
1. Open components tab
2. Close Chrome / Firefox devtools window completely
3. Reopen browser devtools panel
4. Open components tab

Currently, in version 4.27.6, we cannot load the components tree.

This PR contains two changes:
- non-functional refactoring in
`react-devtools-shared/src/devtools/store.js`: removed some redundant
type castings.
- fixed backend manager logic (introduced in
https://github.com/facebook/react/pull/26615) to activate already
registered backends. Looks like frontend of devtools also depends on
`renderer-attached` event, without it component tree won't load.

## How did you test this change?
This fixes the case mentioned prior. Currently in 4.27.6 version it is
not working, we need to refresh the page to make it work.

I've tested this in several environments: chrome, firefox, standalone
with RN application.

DiffTrain build for commit https://github.com/facebook/react/commit/377c5175f78e47a3f01d323ad6528a696c88b76e.
2023-05-04 16:41:51 +00:00
sebmarkbage 2ebe873ffe [Flight] Progressively Enhanced Server Actions (#26774)
This automatically exposes `$$FORM_ACTIONS` on Server References coming
from Flight. So that when they're used in a form action, we can encode
the ID for the server reference as a hidden field or as part of the name
of a button.

If the Server Action is a bound function it can have complex data
associated with it. In this case this additional data is encoded as
additional form fields.

To process a POST on the server there's now a `decodeAction` helper that
can take one of these progressive posts from FormData and give you a
function that is prebound with the correct closure and FormData so that
you can just invoke it.

I updated the fixture which now has a "Server State" that gets
automatically refreshed. This also lets us visualize form fields.
There's no "Action State" here for showing error messages that are not
thrown, that's still up to user space.

DiffTrain build for commit https://github.com/facebook/react/commit/aef7ce5547c9489dc48e31f69b002cd17206e0cb.
2023-05-03 22:42:44 +00:00
sebmarkbage 9c64b4cf2f [Fizz] Gracefully handle suspending in DOM configs (#26768)
E.g. if we suspend (throw a promise) in pushStartInstance today we might
have already pushed some chunks (or even child segments potentially). We
should revert back to where we were.

This doesn't usually happen because when we suspend in a component it
doesn't write anything itself, it'll always defer to som host instance
to do the writing.

There was a todo about this already but I'm not 100% sure it's always
safe when suspending. It should be safe when suspending just regularly
because it's just a noop. We might not even want "throwing a promise" in
this mechanism to be supported longer term but for now that's how a
suspend in internals.

DiffTrain build for commit https://github.com/facebook/react/commit/c10010a6a00911fe99452bc561dd47c3e15f4eb8.
2023-05-03 22:19:32 +00:00
acdlite 1871a4c48b Add useFormStatus to Flight fixture (#26773)
DiffTrain build for commit https://github.com/facebook/react/commit/f533cee8cb4fb54c170230741eea7902cb41ee06.
2023-05-03 19:34:11 +00:00
sebmarkbage 07d6f23a4f Reuse request so that a ReabableStream body does not become disturbed (#26771)
DiffTrain build for commit https://github.com/facebook/react/commit/2c1117a8d008e34eb77eaaf7b8ef315a38644735.
2023-05-03 19:11:51 +00:00
sebmarkbage 116a9940dd [Fizz] Check for nullish values on ReactCustomFormAction (#26770)
Usually we don't have to do this since we only set these in the loop but
the ReactCustomFormAction props are optional so they might be undefined.

Also moved it to a general type since it's a semi-public API.

DiffTrain build for commit https://github.com/facebook/react/commit/fa7a447b9ce5a4f0be592fc2946380b0fa3b29c0.
2023-05-03 18:40:13 +00:00
acdlite 4adb0ac3f8 useOptimisticState -> useOptimistic (#26772)
Drop the "state". Just "useOptimistic". It's cleaner.

This is still an experimental API. May not be the final name.

DiffTrain build for commit https://github.com/facebook/react/commit/b7972822b5887d05ae772ef757a453265b4b7aec.
2023-05-03 18:31:51 +00:00
acdlite ff0533f6fe Add "canary" to list of allowed npm dist tags (#26767)
Forgot this allowlist existed. It's an extra safeguard, in case we mess
up the configuration somehow.

DiffTrain build for commit https://github.com/facebook/react/commit/388686f291afb2362fdc813c49f75b4132bc1314.
2023-05-03 16:42:38 +00:00
hoxyq 13a44716f6 fix[dynamic-scripts-injection]: unregister content scripts before registration (#26765)
## Summary
Fixes #26756.

DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in
incognito mode. This is not happening straight-forward, but if extension
is toggled on and off, the next time I try to open it I am receiving an
error that content script was already registered.

<img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">

- Unregistering content scripts before attempting to register them
again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page,
so this should be expected behaviour.
- Fixed error logging

## How did you test this change?
Local build of extension for Chrome, trying the same steps, which
resulted in an error.
No regression in performance, tested on react.dev, still the same.

DiffTrain build for commit https://github.com/facebook/react/commit/8a25302c668d6f9a24f6680fb4947e9b388bb7d9.
2023-05-03 16:32:32 +00:00
acdlite ba4ef65899 Rename "next" prerelease channel to "canary" (#26761)
The "next" prerelease channel represents what will be published the next
time we do a stable release. We publish a new "next" release every day
using a timed CI workflow.

When we introduced this prerelease channel a few years ago, another name
we considered was "canary". But I proposed "next" instead to create a
greater distinction between this channel and the "experimental" channel
(which is published at the same cadence, but includes extra experimental
features), because some other projects use "canary" to refer to releases
that are more unstable than how we would use it.

The main downside of "next" is someone might mistakenly assume the name
refers to Next.js. We were aware of this risk at the time but didn't
think it would be an issue in practice.

However, colloquially, we've ended up referring to this as the "canary"
channel anyway to avoid precisely that confusion.

So after further discussion, we've agreed to rename to "canary".

This affects the label used in the version string (e.g.
`18.3.0-next-a1c2d3e4` becomes `18.3.0-canary-a1c2d3e4`) as well as the
npm dist tags used to publish the releases. For now, I've chosen to
publish the canaries using both `@canary` and `@next` dist tags, so that
downstream consumers who might depend on `@next` have time to adjust. We
can remove that later after the change has been communicated.

DiffTrain build for commit https://github.com/facebook/react/commit/2c2476834a7c739ca239750b73f74aa1df144a93.
2023-05-03 16:15:28 +00:00
acdlite 3e982deb44 Remove deprecated workflow key from Circle config (#26762)
This key was only valid during the 2.0 beta period so we can remove it.

DiffTrain build for commit https://github.com/facebook/react/commit/fa4314841e7fdeef6e6bc5a7722fe74dc8e9fd89.
2023-05-02 19:04:35 +00:00
sammy-SC 2ad122b5b9 Use content hash for react-native builds (#26734)
DiffTrain build for commit https://github.com/facebook/react/commit/5dd90c562354758942c833b0a46923176e92208e.
2023-05-02 11:10:03 +00:00
sebmarkbage 2d12a6b0c2 [Fizz] Allow an action provide a custom set of props to use for progressive enhancement (#26749)
Stacked on top of #26735.

This allows a framework to add a `$$FORM_ACTION` property to a function.
This lets the framework return a set of props to use in place of the
function but only during SSR. Effectively, this lets you implement
progressive enhancement of form actions using some other way instead of
relying on the replay feature.

This will be used by RSC on Server References automatically by
convention in a follow up, but this mechanism can also be used by other
frameworks/libraries.

DiffTrain build for commit https://github.com/facebook/react/commit/559e83aebb2026035d47aa0ebf842f78d4cd6757.
2023-05-01 20:05:59 +00:00
sebmarkbage d68b8069e3 Allow forms to skip hydration of hidden inputs (#26735)
This allows us to emit extra ephemeral data that will only be used on
server rendered forms.

First I refactored the shouldSkip functions to now just do that work
inside the canHydrate methods. This makes the Config bindings a little
less surface area but it also helps us optimize a bit since we now can
look at the code together and find shared paths.

canHydrate returns the instance if it matches, that used to just be
there to refine the type but it can also be used to just return a
different instance later that we find. If we don't find one, we'll bail
out and error regardless so no need to skip past anything.

DiffTrain build for commit https://github.com/facebook/react/commit/67f4fb02130b1fe1856289e3b66bb0b8cca57ff7.
2023-05-01 19:40:48 +00:00
gnoff b25979b589 [Fizz] Encode external fizz runtime into chunks eagerly (#26752)
in https://github.com/facebook/react/pull/26738 we added nonce to the
ResponseState. Initially it was used in a variety of places but the
version that got merged only included it with the external fizz runtime.
This PR updates the config for the external fizz runtime so that the
nonce is encoded into the script chunks at request creation time.

The rationale is that for live-requests, streaming is more likely than
not so doing the encoding work at the start is better than during flush.
For cases such as SSG where the runtime is not required the extra
encoding is tolerable (not a live request). Bots are an interesting case
because if you want fastest TTFB you will end up requiring the runtime
but if you are withholding until the stream is done you have already
sacrificed fastest TTFB and the marginal slowdown of the extraneous
encoding is hopefully neglibible

I'm writing this so later if we learn that this tradeoff isn't worth it
we at least understand why I made the change in the first place.

DiffTrain build for commit https://github.com/facebook/react/commit/8ea96ef84d8f08ed1846dec9e8ed20d2225db0d3.
2023-05-01 17:55:30 +00:00