Skip to content

Commit

Permalink
Upgrade React to 18.3.0-canary-aef7ce554-20230503 (#49181)
Browse files Browse the repository at this point in the history
Includes the following upstream changes:

- [aef7ce554](https://github.com/facebook/react/commits/aef7ce554)
[Flight] Progressively Enhanced Server Actions
([#26774](facebook/react#26774)) (Sebastian
Markbåge)
- [c10010a6a](https://github.com/facebook/react/commits/c10010a6a)
[Fizz] Gracefully handle suspending in DOM configs
([#26768](facebook/react#26768)) (Sebastian
Markbåge)
- [f533cee8c](https://github.com/facebook/react/commits/f533cee8c) Add
useFormStatus to Flight fixture
([#26773](facebook/react#26773)) (Andrew Clark)
- [2c1117a8d](https://github.com/facebook/react/commits/2c1117a8d) Reuse
request so that a ReabableStream body does not become disturbed
([#26771](facebook/react#26771)) (Andrew Gadzik)
- [fa7a447b9](https://github.com/facebook/react/commits/fa7a447b9)
[Fizz] Check for nullish values on ReactCustomFormAction
([#26770](facebook/react#26770)) (Sebastian
Markbåge)

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
  • Loading branch information
acdlite authored May 4, 2023
1 parent 0aac86e commit d543fd1
Show file tree
Hide file tree
Showing 84 changed files with 9,853 additions and 4,532 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:[email protected]",
"react-builtin": "npm:[email protected]b7972822b-20230503",
"react-experimental-builtin": "npm:[email protected]b7972822b-20230503",
"react-builtin": "npm:[email protected]aef7ce554-20230503",
"react-experimental-builtin": "npm:[email protected]aef7ce554-20230503",
"react-dom": "18.2.0",
"react-dom-17": "npm:[email protected]",
"react-dom-builtin": "npm:[email protected]b7972822b-20230503",
"react-dom-experimental-builtin": "npm:[email protected]b7972822b-20230503",
"react-server-dom-webpack": "18.3.0-canary-b7972822b-20230503",
"react-server-dom-webpack-experimental": "npm:[email protected]b7972822b-20230503",
"react-dom-builtin": "npm:[email protected]aef7ce554-20230503",
"react-dom-experimental-builtin": "npm:[email protected]aef7ce554-20230503",
"react-server-dom-webpack": "18.3.0-canary-aef7ce554-20230503",
"react-server-dom-webpack-experimental": "npm:[email protected]aef7ce554-20230503",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -215,8 +215,8 @@
"rimraf": "3.0.2",
"sass": "1.54.0",
"satori": "0.4.4",
"scheduler-builtin": "npm:[email protected]b7972822b-20230503",
"scheduler-experimental-builtin": "npm:[email protected]b7972822b-20230503",
"scheduler-builtin": "npm:[email protected]aef7ce554-20230503",
"scheduler-experimental-builtin": "npm:[email protected]aef7ce554-20230503",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-b7972822b-20230503';
var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -2250,7 +2250,7 @@ function makeFormFieldPrefix(responseState) {
// I'm just reusing this counter. It's not really the same namespace as "name".
// It could just be its own counter.
var id = responseState.nextSuspenseID++;
return responseState.idPrefix + '$ACTION:' + id + ':';
return responseState.idPrefix + id;
} // Since this will likely be repeated a lot in the HTML, we use a more concise message
// than on the client and hopefully it's googleable.

Expand Down Expand Up @@ -2333,23 +2333,23 @@ function pushFormActionAttribute(target, responseState, formAction, formEncType,
}
}

if (name !== null) {
if (name != null) {
pushAttribute(target, 'name', name);
}

if (formAction !== null) {
if (formAction != null) {
pushAttribute(target, 'formAction', formAction);
}

if (formEncType !== null) {
if (formEncType != null) {
pushAttribute(target, 'formEncType', formEncType);
}

if (formMethod !== null) {
if (formMethod != null) {
pushAttribute(target, 'formMethod', formMethod);
}

if (formTarget !== null) {
if (formTarget != null) {
pushAttribute(target, 'formTarget', formTarget);
}

Expand Down Expand Up @@ -2963,19 +2963,19 @@ function pushStartForm(target, props, responseState) {
}
}

if (formAction !== null) {
if (formAction != null) {
pushAttribute(target, 'action', formAction);
}

if (formEncType !== null) {
if (formEncType != null) {
pushAttribute(target, 'encType', formEncType);
}

if (formMethod !== null) {
if (formMethod != null) {
pushAttribute(target, 'method', formMethod);
}

if (formTarget !== null) {
if (formTarget != null) {
pushAttribute(target, 'target', formTarget);
}

Expand Down Expand Up @@ -9555,10 +9555,13 @@ function spawnNewSuspendedTask(request, task, thenableState, x) {


function renderNode(request, task, node) {
// TODO: Store segment.children.length here and reset it in case something
// Store how much we've pushed at this point so we can reset it in case something
// suspended partially through writing something.
// Snapshot the current context in case something throws to interrupt the
var segment = task.blockedSegment;
var childrenLength = segment.children.length;
var chunkLength = segment.chunks.length; // Snapshot the current context in case something throws to interrupt the
// process.

var previousFormatContext = task.blockedSegment.formatContext;
var previousLegacyContext = task.legacyContext;
var previousContext = task.context;
Expand All @@ -9571,7 +9574,10 @@ function renderNode(request, task, node) {
try {
return renderNodeDestructive(request, task, null, node);
} catch (thrownValue) {
resetHooksState();
resetHooksState(); // Reset the write pointers to where we started.

segment.children.length = childrenLength;
segment.chunks.length = chunkLength;
var x = thrownValue === SuspenseException ? // This is a special type of exception used for Suspense. For historical
// reasons, the rest of the Suspense implementation expects the thrown
// value to be a thenable, because before `use` existed that was the
Expand Down Expand Up @@ -9843,6 +9849,9 @@ function retryTask(request, task) {
currentTaskInDEV = task;
}

var childrenLength = segment.children.length;
var chunkLength = segment.chunks.length;

try {
// We call the destructive form that mutates this task. That way if something
// suspends again, we can reuse the same task instead of spawning a new one.
Expand All @@ -9857,7 +9866,10 @@ function retryTask(request, task) {
segment.status = COMPLETED;
finishedTask(request, task.blockedBoundary, segment);
} catch (thrownValue) {
resetHooksState();
resetHooksState(); // Reset the write pointers to where we started.

segment.children.length = childrenLength;
segment.chunks.length = chunkLength;
var x = thrownValue === SuspenseException ? // This is a special type of exception used for Suspense. For historical
// reasons, the rest of the Suspense implementation expects the thrown
// value to be a thenable, because before `use` existed that was the
Expand Down
Loading

0 comments on commit d543fd1

Please sign in to comment.