Upgrade react@beta (#65845)

Ensures `useMemoCache` is available for the React Compiler.

Required for #65804 without having to manually enable experimental React
through e.g. taint: true.

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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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 #

-->

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
This commit is contained in:
Tim Neutkens 2024-05-16 21:59:47 +02:00 committed by GitHub
parent 9f647f311f
commit e359b14881
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
117 changed files with 2530 additions and 1765 deletions

View file

@ -7,8 +7,8 @@
}, },
"dependencies": { "dependencies": {
"next": "canary", "next": "canary",
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430" "react-dom": "19.0.0-beta-04b058868c-20240508"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.4.5", "@types/node": "20.4.5",

View file

@ -7,8 +7,8 @@
}, },
"dependencies": { "dependencies": {
"next": "canary", "next": "canary",
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430" "react-dom": "19.0.0-beta-04b058868c-20240508"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.4.5", "@types/node": "20.4.5",

View file

@ -120,6 +120,7 @@
"alex": "9.1.0", "alex": "9.1.0",
"amphtml-validator": "1.0.35", "amphtml-validator": "1.0.35",
"async-sema": "3.0.1", "async-sema": "3.0.1",
"babel-plugin-react-compiler": "0.0.0-experimental-c23de8d-20240515",
"browserslist": "4.22.2", "browserslist": "4.22.2",
"buffer": "5.6.0", "buffer": "5.6.0",
"cheerio": "0.22.0", "cheerio": "0.22.0",
@ -196,17 +197,17 @@
"pretty-bytes": "5.3.0", "pretty-bytes": "5.3.0",
"pretty-ms": "7.0.0", "pretty-ms": "7.0.0",
"random-seed": "0.3.0", "random-seed": "0.3.0",
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-17": "npm:react@17.0.2", "react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@19.0.0-beta-4508873393-20240430", "react-builtin": "npm:react@19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430", "react-dom": "19.0.0-beta-04b058868c-20240508",
"react-dom-17": "npm:react-dom@17.0.2", "react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@19.0.0-beta-4508873393-20240430", "react-dom-builtin": "npm:react-dom@19.0.0-beta-04b058868c-20240508",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-4508873393-20240430", "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-4508873393-20240430",
"react-experimental-builtin": "npm:react@0.0.0-experimental-4508873393-20240430", "react-experimental-builtin": "npm:react@0.0.0-experimental-4508873393-20240430",
"react-server-dom-turbopack": "19.0.0-beta-4508873393-20240430", "react-server-dom-turbopack": "19.0.0-beta-04b058868c-20240508",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430", "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430",
"react-server-dom-webpack": "19.0.0-beta-4508873393-20240430", "react-server-dom-webpack": "19.0.0-beta-04b058868c-20240508",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-4508873393-20240430", "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-4508873393-20240430",
"react-ssr-prepass": "1.0.8", "react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3", "react-virtualized": "9.22.3",
@ -252,9 +253,9 @@
"@babel/traverse": "7.22.5", "@babel/traverse": "7.22.5",
"@types/react": "18.2.74", "@types/react": "18.2.74",
"@types/react-dom": "18.2.23", "@types/react-dom": "18.2.23",
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430", "react-dom": "19.0.0-beta-04b058868c-20240508",
"react-is": "19.0.0-beta-4508873393-20240430", "react-is": "19.0.0-beta-04b058868c-20240508",
"scheduler": "0.25.0-beta-94eed63c49-20240425" "scheduler": "0.25.0-beta-94eed63c49-20240425"
}, },
"engines": { "engines": {

View file

@ -183,8 +183,8 @@ export const installTemplate = async ({
* Default dependencies. * Default dependencies.
*/ */
dependencies: { dependencies: {
react: "19.0.0-beta-4508873393-20240430", react: "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430", "react-dom": "19.0.0-beta-04b058868c-20240508",
next: version, next: version,
}, },
devDependencies: {}, devDependencies: {},

View file

@ -104,10 +104,10 @@
"peerDependencies": { "peerDependencies": {
"@opentelemetry/api": "^1.1.0", "@opentelemetry/api": "^1.1.0",
"@playwright/test": "^1.41.2", "@playwright/test": "^1.41.2",
"babel-plugin-react-compiler": "*", "react": "^19.0.0-0",
"react": "19.0.0-beta-4508873393-20240430", "react-dom": "^19.0.0-0",
"react-dom": "19.0.0-beta-4508873393-20240430", "sass": "^1.3.0",
"sass": "^1.3.0" "babel-plugin-react-compiler": "*"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"babel-plugin-react-compiler": { "babel-plugin-react-compiler": {

View file

@ -12,10 +12,7 @@
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {
(function() { (function() {
'use strict';
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
@ -23,7 +20,7 @@ if (
) { ) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
} }
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var Scheduler = require("next/dist/compiled/scheduler"); var Scheduler = require("next/dist/compiled/scheduler");
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
@ -241,6 +238,7 @@ var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -8782,6 +8780,11 @@ function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEve
var temp = submitter.ownerDocument.createElement('input'); var temp = submitter.ownerDocument.createElement('input');
temp.name = submitter.name; temp.name = submitter.name;
temp.value = submitter.value; temp.value = submitter.value;
if (form.id) {
temp.setAttribute('form', form.id);
}
submitter.parentNode.insertBefore(temp, submitter); submitter.parentNode.insertBefore(temp, submitter);
formData = new FormData(form); formData = new FormData(form);
temp.parentNode.removeChild(temp); temp.parentNode.removeChild(temp);
@ -17386,7 +17389,8 @@ var createFunctionComponentUpdateQueue;
return { return {
lastEffect: null, lastEffect: null,
events: null, events: null,
stores: null stores: null,
memoCache: null
}; };
}; };
} }
@ -17432,6 +17436,93 @@ function use(usable) {
throw new Error('An unsupported type was passed to use(): ' + String(usable)); throw new Error('An unsupported type was passed to use(): ' + String(usable));
} }
function useMemoCache(size) {
var memoCache = null; // Fast-path, load memo cache from wip fiber if already prepared
var updateQueue = currentlyRenderingFiber$1.updateQueue;
if (updateQueue !== null) {
memoCache = updateQueue.memoCache;
} // Otherwise clone from the current fiber
if (memoCache == null) {
var current = currentlyRenderingFiber$1.alternate;
if (current !== null) {
var currentUpdateQueue = current.updateQueue;
if (currentUpdateQueue !== null) {
var currentMemoCache = currentUpdateQueue.memoCache;
if (currentMemoCache != null) {
memoCache = {
// When enableNoCloningMemoCache is enabled, instead of treating the
// cache as copy-on-write, like we do with fibers, we share the same
// cache instance across all render attempts, even if the component
// is interrupted before it commits.
//
// If an update is interrupted, either because it suspended or
// because of another update, we can reuse the memoized computations
// from the previous attempt. We can do this because the React
// Compiler performs atomic writes to the memo cache, i.e. it will
// not record the inputs to a memoization without also recording its
// output.
//
// This gives us a form of "resuming" within components and hooks.
//
// This only works when updating a component that already mounted.
// It has no impact during initial render, because the memo cache is
// stored on the fiber, and since we have not implemented resuming
// for fibers, it's always a fresh memo cache, anyway.
//
// However, this alone is pretty useful — it happens whenever you
// update the UI with fresh data after a mutation/action, which is
// extremely common in a Suspense-driven (e.g. RSC or Relay) app.
data: // Clone the memo cache before each render (copy-on-write)
currentMemoCache.data.map(function (array) {
return array.slice();
}),
index: 0
};
}
}
}
} // Finally fall back to allocating a fresh instance of the cache
if (memoCache == null) {
memoCache = {
data: [],
index: 0
};
}
if (updateQueue === null) {
updateQueue = createFunctionComponentUpdateQueue();
currentlyRenderingFiber$1.updateQueue = updateQueue;
}
updateQueue.memoCache = memoCache;
var data = memoCache.data[memoCache.index];
if (data === undefined) {
data = memoCache.data[memoCache.index] = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
} else if (data.length !== size) {
// TODO: consider warning or throwing here
{
error('Expected a constant size argument for each invocation of useMemoCache. ' + 'The previous cache was allocated with size %s but size %s was requested.', data.length, size);
}
}
memoCache.index++;
return data;
}
function basicStateReducer(state, action) { function basicStateReducer(state, action) {
// $FlowFixMe[incompatible-use]: Flow doesn't like mixed types // $FlowFixMe[incompatible-use]: Flow doesn't like mixed types
return typeof action === 'function' ? action(state) : action; return typeof action === 'function' ? action(state) : action;
@ -19230,6 +19321,10 @@ var ContextOnlyDispatcher = {
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
} }
{
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
}
{ {
ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError;
@ -19374,6 +19469,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19509,6 +19608,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19645,6 +19748,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19781,6 +19888,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19936,6 +20047,13 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
InvalidNestedHooksDispatcherOnMountInDEV.useMemoCache = function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
};
}
{ {
InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus; InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -20093,6 +20211,13 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
InvalidNestedHooksDispatcherOnUpdateInDEV.useMemoCache = function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
};
}
{ {
InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus; InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -20250,6 +20375,13 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
InvalidNestedHooksDispatcherOnRerenderInDEV.useMemoCache = function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
};
}
{ {
InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus; InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -35828,7 +35960,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root; return root;
} }
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
// Might add PROFILE later. // Might add PROFILE later.
@ -37328,7 +37460,6 @@ var foundDevTools = injectIntoDevTools({
exports.createRoot = createRoot; exports.createRoot = createRoot;
exports.hydrateRoot = hydrateRoot; exports.hydrateRoot = hydrateRoot;
exports.version = ReactVersion; exports.version = ReactVersion;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===

View file

@ -55,7 +55,8 @@ Symbol.for("react.debug_trace_mode");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
Symbol.for("react.legacy_hidden"); Symbol.for("react.legacy_hidden");
Symbol.for("react.tracing_marker"); Symbol.for("react.tracing_marker");
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
if (null === maybeIterable || "object" !== typeof maybeIterable) return null; if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
maybeIterable = maybeIterable =
@ -2289,6 +2290,8 @@ function extractEvents$1(
var temp = submitter.ownerDocument.createElement("input"); var temp = submitter.ownerDocument.createElement("input");
temp.name = submitter.name; temp.name = submitter.name;
temp.value = submitter.value; temp.value = submitter.value;
nativeEventTarget.id &&
temp.setAttribute("form", nativeEventTarget.id);
submitter.parentNode.insertBefore(temp, submitter); submitter.parentNode.insertBefore(temp, submitter);
var formData = new FormData(nativeEventTarget); var formData = new FormData(nativeEventTarget);
temp.parentNode.removeChild(temp); temp.parentNode.removeChild(temp);
@ -5601,7 +5604,7 @@ function updateWorkInProgressHook() {
} }
var createFunctionComponentUpdateQueue; var createFunctionComponentUpdateQueue;
createFunctionComponentUpdateQueue = function () { createFunctionComponentUpdateQueue = function () {
return { lastEffect: null, events: null, stores: null }; return { lastEffect: null, events: null, stores: null, memoCache: null };
}; };
function useThenable(thenable) { function useThenable(thenable) {
var index = thenableIndexCounter; var index = thenableIndexCounter;
@ -5622,6 +5625,40 @@ function use(usable) {
} }
throw Error(formatProdErrorMessage(438, String(usable))); throw Error(formatProdErrorMessage(438, String(usable)));
} }
function useMemoCache(size) {
var memoCache = null,
updateQueue = currentlyRenderingFiber$1.updateQueue;
null !== updateQueue && (memoCache = updateQueue.memoCache);
if (null == memoCache) {
var current = currentlyRenderingFiber$1.alternate;
null !== current &&
((current = current.updateQueue),
null !== current &&
((current = current.memoCache),
null != current &&
(memoCache = {
data: current.data.map(function (array) {
return array.slice();
}),
index: 0
})));
}
null == memoCache && (memoCache = { data: [], index: 0 });
null === updateQueue &&
((updateQueue = createFunctionComponentUpdateQueue()),
(currentlyRenderingFiber$1.updateQueue = updateQueue));
updateQueue.memoCache = memoCache;
updateQueue = memoCache.data[memoCache.index];
if (void 0 === updateQueue)
for (
updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
current < size;
current++
)
updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
memoCache.index++;
return updateQueue;
}
function basicStateReducer(state, action) { function basicStateReducer(state, action) {
return "function" === typeof action ? action(state) : action; return "function" === typeof action ? action(state) : action;
} }
@ -6435,6 +6472,7 @@ var ContextOnlyDispatcher = {
useId: throwInvalidHookError useId: throwInvalidHookError
}; };
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError;
ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError;
@ -6598,6 +6636,7 @@ var HooksDispatcherOnMount = {
)); ));
} }
}; };
HooksDispatcherOnMount.useMemoCache = useMemoCache;
HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus;
HooksDispatcherOnMount.useFormState = mountActionState; HooksDispatcherOnMount.useFormState = mountActionState;
HooksDispatcherOnMount.useActionState = mountActionState; HooksDispatcherOnMount.useActionState = mountActionState;
@ -6660,6 +6699,7 @@ var HooksDispatcherOnUpdate = {
useId: updateId useId: updateId
}; };
HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus;
HooksDispatcherOnUpdate.useFormState = updateActionState; HooksDispatcherOnUpdate.useFormState = updateActionState;
HooksDispatcherOnUpdate.useActionState = updateActionState; HooksDispatcherOnUpdate.useActionState = updateActionState;
@ -6708,6 +6748,7 @@ var HooksDispatcherOnRerender = {
useId: updateId useId: updateId
}; };
HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus;
HooksDispatcherOnRerender.useFormState = rerenderActionState; HooksDispatcherOnRerender.useFormState = rerenderActionState;
HooksDispatcherOnRerender.useActionState = rerenderActionState; HooksDispatcherOnRerender.useActionState = rerenderActionState;
@ -14501,7 +14542,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
var devToolsConfig$jscomp$inline_1641 = { var devToolsConfig$jscomp$inline_1641 = {
findFiberByHostInstance: getClosestInstanceFromNode, findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0, bundleType: 0,
version: "19.0.0-beta-4508873393-20240430", version: "19.0.0-beta-04b058868c-20240508",
rendererPackageName: "react-dom" rendererPackageName: "react-dom"
}; };
var internals$jscomp$inline_2019 = { var internals$jscomp$inline_2019 = {
@ -14531,7 +14572,7 @@ var internals$jscomp$inline_2019 = {
scheduleRoot: null, scheduleRoot: null,
setRefreshHandler: null, setRefreshHandler: null,
getCurrentFiber: null, getCurrentFiber: null,
reconcilerVersion: "19.0.0-beta-4508873393-20240430" reconcilerVersion: "19.0.0-beta-04b058868c-20240508"
}; };
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2020 = __REACT_DEVTOOLS_GLOBAL_HOOK__; var hook$jscomp$inline_2020 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@ -14637,4 +14678,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container); listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren); return new ReactDOMHydrationRoot(initialChildren);
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -12,10 +12,7 @@
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {
(function() { (function() {
'use strict';
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
@ -23,7 +20,7 @@ if (
) { ) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
} }
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var Scheduler = require("next/dist/compiled/scheduler"); var Scheduler = require("next/dist/compiled/scheduler");
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
@ -241,6 +238,7 @@ var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -8830,6 +8828,11 @@ function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEve
var temp = submitter.ownerDocument.createElement('input'); var temp = submitter.ownerDocument.createElement('input');
temp.name = submitter.name; temp.name = submitter.name;
temp.value = submitter.value; temp.value = submitter.value;
if (form.id) {
temp.setAttribute('form', form.id);
}
submitter.parentNode.insertBefore(temp, submitter); submitter.parentNode.insertBefore(temp, submitter);
formData = new FormData(form); formData = new FormData(form);
temp.parentNode.removeChild(temp); temp.parentNode.removeChild(temp);
@ -17434,7 +17437,8 @@ var createFunctionComponentUpdateQueue;
return { return {
lastEffect: null, lastEffect: null,
events: null, events: null,
stores: null stores: null,
memoCache: null
}; };
}; };
} }
@ -17480,6 +17484,93 @@ function use(usable) {
throw new Error('An unsupported type was passed to use(): ' + String(usable)); throw new Error('An unsupported type was passed to use(): ' + String(usable));
} }
function useMemoCache(size) {
var memoCache = null; // Fast-path, load memo cache from wip fiber if already prepared
var updateQueue = currentlyRenderingFiber$1.updateQueue;
if (updateQueue !== null) {
memoCache = updateQueue.memoCache;
} // Otherwise clone from the current fiber
if (memoCache == null) {
var current = currentlyRenderingFiber$1.alternate;
if (current !== null) {
var currentUpdateQueue = current.updateQueue;
if (currentUpdateQueue !== null) {
var currentMemoCache = currentUpdateQueue.memoCache;
if (currentMemoCache != null) {
memoCache = {
// When enableNoCloningMemoCache is enabled, instead of treating the
// cache as copy-on-write, like we do with fibers, we share the same
// cache instance across all render attempts, even if the component
// is interrupted before it commits.
//
// If an update is interrupted, either because it suspended or
// because of another update, we can reuse the memoized computations
// from the previous attempt. We can do this because the React
// Compiler performs atomic writes to the memo cache, i.e. it will
// not record the inputs to a memoization without also recording its
// output.
//
// This gives us a form of "resuming" within components and hooks.
//
// This only works when updating a component that already mounted.
// It has no impact during initial render, because the memo cache is
// stored on the fiber, and since we have not implemented resuming
// for fibers, it's always a fresh memo cache, anyway.
//
// However, this alone is pretty useful — it happens whenever you
// update the UI with fresh data after a mutation/action, which is
// extremely common in a Suspense-driven (e.g. RSC or Relay) app.
data: // Clone the memo cache before each render (copy-on-write)
currentMemoCache.data.map(function (array) {
return array.slice();
}),
index: 0
};
}
}
}
} // Finally fall back to allocating a fresh instance of the cache
if (memoCache == null) {
memoCache = {
data: [],
index: 0
};
}
if (updateQueue === null) {
updateQueue = createFunctionComponentUpdateQueue();
currentlyRenderingFiber$1.updateQueue = updateQueue;
}
updateQueue.memoCache = memoCache;
var data = memoCache.data[memoCache.index];
if (data === undefined) {
data = memoCache.data[memoCache.index] = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
} else if (data.length !== size) {
// TODO: consider warning or throwing here
{
error('Expected a constant size argument for each invocation of useMemoCache. ' + 'The previous cache was allocated with size %s but size %s was requested.', data.length, size);
}
}
memoCache.index++;
return data;
}
function basicStateReducer(state, action) { function basicStateReducer(state, action) {
// $FlowFixMe[incompatible-use]: Flow doesn't like mixed types // $FlowFixMe[incompatible-use]: Flow doesn't like mixed types
return typeof action === 'function' ? action(state) : action; return typeof action === 'function' ? action(state) : action;
@ -19278,6 +19369,10 @@ var ContextOnlyDispatcher = {
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
} }
{
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
}
{ {
ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError;
@ -19422,6 +19517,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19557,6 +19656,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19693,6 +19796,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19829,6 +19936,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache;
}
{ {
HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -19984,6 +20095,13 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
InvalidNestedHooksDispatcherOnMountInDEV.useMemoCache = function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
};
}
{ {
InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus; InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -20141,6 +20259,13 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
InvalidNestedHooksDispatcherOnUpdateInDEV.useMemoCache = function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
};
}
{ {
InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus; InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -20298,6 +20423,13 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
}; };
} }
{
InvalidNestedHooksDispatcherOnRerenderInDEV.useMemoCache = function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
};
}
{ {
InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus; InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = useHostTransitionStatus;
@ -35876,7 +36008,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root; return root;
} }
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) { implementation) {
@ -37782,7 +37914,6 @@ exports.unstable_batchedUpdates = batchedUpdates;
exports.useFormState = useFormState; exports.useFormState = useFormState;
exports.useFormStatus = useFormStatus; exports.useFormStatus = useFormStatus;
exports.version = ReactVersion; exports.version = ReactVersion;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===

View file

@ -59,7 +59,8 @@ Symbol.for("react.debug_trace_mode");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
Symbol.for("react.legacy_hidden"); Symbol.for("react.legacy_hidden");
Symbol.for("react.tracing_marker"); Symbol.for("react.tracing_marker");
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
if (null === maybeIterable || "object" !== typeof maybeIterable) return null; if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
maybeIterable = maybeIterable =
@ -2411,6 +2412,8 @@ function extractEvents$1(
var temp = submitter.ownerDocument.createElement("input"); var temp = submitter.ownerDocument.createElement("input");
temp.name = submitter.name; temp.name = submitter.name;
temp.value = submitter.value; temp.value = submitter.value;
nativeEventTarget.id &&
temp.setAttribute("form", nativeEventTarget.id);
submitter.parentNode.insertBefore(temp, submitter); submitter.parentNode.insertBefore(temp, submitter);
var formData = new FormData(nativeEventTarget); var formData = new FormData(nativeEventTarget);
temp.parentNode.removeChild(temp); temp.parentNode.removeChild(temp);
@ -5723,7 +5726,7 @@ function updateWorkInProgressHook() {
} }
var createFunctionComponentUpdateQueue; var createFunctionComponentUpdateQueue;
createFunctionComponentUpdateQueue = function () { createFunctionComponentUpdateQueue = function () {
return { lastEffect: null, events: null, stores: null }; return { lastEffect: null, events: null, stores: null, memoCache: null };
}; };
function useThenable(thenable) { function useThenable(thenable) {
var index = thenableIndexCounter; var index = thenableIndexCounter;
@ -5744,6 +5747,40 @@ function use(usable) {
} }
throw Error(formatProdErrorMessage(438, String(usable))); throw Error(formatProdErrorMessage(438, String(usable)));
} }
function useMemoCache(size) {
var memoCache = null,
updateQueue = currentlyRenderingFiber$1.updateQueue;
null !== updateQueue && (memoCache = updateQueue.memoCache);
if (null == memoCache) {
var current = currentlyRenderingFiber$1.alternate;
null !== current &&
((current = current.updateQueue),
null !== current &&
((current = current.memoCache),
null != current &&
(memoCache = {
data: current.data.map(function (array) {
return array.slice();
}),
index: 0
})));
}
null == memoCache && (memoCache = { data: [], index: 0 });
null === updateQueue &&
((updateQueue = createFunctionComponentUpdateQueue()),
(currentlyRenderingFiber$1.updateQueue = updateQueue));
updateQueue.memoCache = memoCache;
updateQueue = memoCache.data[memoCache.index];
if (void 0 === updateQueue)
for (
updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
current < size;
current++
)
updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
memoCache.index++;
return updateQueue;
}
function basicStateReducer(state, action) { function basicStateReducer(state, action) {
return "function" === typeof action ? action(state) : action; return "function" === typeof action ? action(state) : action;
} }
@ -6560,6 +6597,7 @@ var ContextOnlyDispatcher = {
useId: throwInvalidHookError useId: throwInvalidHookError
}; };
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError;
ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError;
@ -6723,6 +6761,7 @@ var HooksDispatcherOnMount = {
)); ));
} }
}; };
HooksDispatcherOnMount.useMemoCache = useMemoCache;
HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus;
HooksDispatcherOnMount.useFormState = mountActionState; HooksDispatcherOnMount.useFormState = mountActionState;
HooksDispatcherOnMount.useActionState = mountActionState; HooksDispatcherOnMount.useActionState = mountActionState;
@ -6785,6 +6824,7 @@ var HooksDispatcherOnUpdate = {
useId: updateId useId: updateId
}; };
HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus;
HooksDispatcherOnUpdate.useFormState = updateActionState; HooksDispatcherOnUpdate.useFormState = updateActionState;
HooksDispatcherOnUpdate.useActionState = updateActionState; HooksDispatcherOnUpdate.useActionState = updateActionState;
@ -6833,6 +6873,7 @@ var HooksDispatcherOnRerender = {
useId: updateId useId: updateId
}; };
HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus;
HooksDispatcherOnRerender.useFormState = rerenderActionState; HooksDispatcherOnRerender.useFormState = rerenderActionState;
HooksDispatcherOnRerender.useActionState = rerenderActionState; HooksDispatcherOnRerender.useActionState = rerenderActionState;
@ -15212,7 +15253,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
var devToolsConfig$jscomp$inline_1728 = { var devToolsConfig$jscomp$inline_1728 = {
findFiberByHostInstance: getClosestInstanceFromNode, findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0, bundleType: 0,
version: "19.0.0-beta-4508873393-20240430", version: "19.0.0-beta-04b058868c-20240508",
rendererPackageName: "react-dom" rendererPackageName: "react-dom"
}; };
(function (internals) { (function (internals) {
@ -15255,7 +15296,7 @@ var devToolsConfig$jscomp$inline_1728 = {
scheduleRoot: null, scheduleRoot: null,
setRefreshHandler: null, setRefreshHandler: null,
getCurrentFiber: null, getCurrentFiber: null,
reconcilerVersion: "19.0.0-beta-4508873393-20240430" reconcilerVersion: "19.0.0-beta-04b058868c-20240508"
}); });
function noop() {} function noop() {}
function getCrossOriginStringAs(as, input) { function getCrossOriginStringAs(as, input) {
@ -15509,7 +15550,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () { exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus(); return ReactSharedInternals.H.useHostTransitionStatus();
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" === "function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

View file

@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@ -99,6 +99,7 @@ var REACT_SCOPE_TYPE = Symbol.for('react.scope');
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -2527,11 +2528,7 @@ var startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
var target = this; var target = this;
target.push(startHiddenInputChunk); target.push(startHiddenInputChunk);
validateAdditionalFormField(value);
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'It probably means you are closing over binary data or FormData in a Server Action.');
}
pushStringAttribute(target, 'name', key); pushStringAttribute(target, 'name', key);
pushStringAttribute(target, 'value', value); pushStringAttribute(target, 'value', value);
target.push(endOfStartTagSelfClosing); target.push(endOfStartTagSelfClosing);
@ -2544,6 +2541,21 @@ function pushAdditionalFormFields(target, formData) {
} }
} }
function validateAdditionalFormField(value, key) {
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'Will fallback to client hydration.');
}
}
function validateAdditionalFormFields(formData) {
if (formData != null) {
// $FlowFixMe[prop-missing]: FormData has forEach.
formData.forEach(validateAdditionalFormField);
}
return formData;
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
var customAction = formAction.$$FORM_ACTION; var customAction = formAction.$$FORM_ACTION;
@ -2551,7 +2563,13 @@ function getCustomFormFields(resumableState, formAction) {
var prefix = makeFormFieldPrefix(resumableState); var prefix = makeFormFieldPrefix(resumableState);
try { try {
return formAction.$$FORM_ACTION(prefix); var customFields = formAction.$$FORM_ACTION(prefix);
if (customFields) {
validateAdditionalFormFields(customFields.data);
}
return customFields;
} catch (x) { } catch (x) {
if (typeof x === 'object' && x !== null && typeof x.then === 'function') { if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
// Rethrow suspense. // Rethrow suspense.
@ -8452,6 +8470,16 @@ function useCacheRefresh() {
return unsupportedRefresh; return unsupportedRefresh;
} }
function useMemoCache(size) {
var data = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
return data;
}
function noop$1() {} function noop$1() {}
var HooksDispatcher = { var HooksDispatcher = {
@ -8482,6 +8510,10 @@ var HooksDispatcher = {
HooksDispatcher.useCacheRefresh = useCacheRefresh; HooksDispatcher.useCacheRefresh = useCacheRefresh;
} }
{
HooksDispatcher.useMemoCache = useMemoCache;
}
{ {
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
} }

View file

@ -67,6 +67,7 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator, MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
isArrayImpl = Array.isArray; isArrayImpl = Array.isArray;
function murmurhash3_32_gc(key, seed) { function murmurhash3_32_gc(key, seed) {
@ -431,17 +432,25 @@ var actionJavaScriptURL = escapeTextForBrowser(
); );
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
this.push('<input type="hidden"'); this.push('<input type="hidden"');
if ("string" !== typeof value) throw Error(formatProdErrorMessage(480)); validateAdditionalFormField(value);
pushStringAttribute(this, "name", key); pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value); pushStringAttribute(this, "value", value);
this.push("/>"); this.push("/>");
} }
function validateAdditionalFormField(value) {
if ("string" !== typeof value) throw Error(formatProdErrorMessage(480));
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) { if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++; var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id; resumableState = resumableState.idPrefix + id;
try { try {
return formAction.$$FORM_ACTION(resumableState); var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) { } catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then) if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x; throw x;
@ -2515,16 +2524,16 @@ function createRenderState(resumableState, generateStaticMarkup) {
"\x3c/script>" "\x3c/script>"
); );
bootstrapScriptContent = idPrefix + "P:"; bootstrapScriptContent = idPrefix + "P:";
var JSCompiler_object_inline_segmentPrefix_1483 = idPrefix + "S:"; var JSCompiler_object_inline_segmentPrefix_1485 = idPrefix + "S:";
idPrefix += "B:"; idPrefix += "B:";
var JSCompiler_object_inline_preconnects_1497 = new Set(), var JSCompiler_object_inline_preconnects_1499 = new Set(),
JSCompiler_object_inline_fontPreloads_1498 = new Set(), JSCompiler_object_inline_fontPreloads_1500 = new Set(),
JSCompiler_object_inline_highImagePreloads_1499 = new Set(), JSCompiler_object_inline_highImagePreloads_1501 = new Set(),
JSCompiler_object_inline_styles_1500 = new Map(), JSCompiler_object_inline_styles_1502 = new Map(),
JSCompiler_object_inline_bootstrapScripts_1501 = new Set(), JSCompiler_object_inline_bootstrapScripts_1503 = new Set(),
JSCompiler_object_inline_scripts_1502 = new Set(), JSCompiler_object_inline_scripts_1504 = new Set(),
JSCompiler_object_inline_bulkPreloads_1503 = new Set(), JSCompiler_object_inline_bulkPreloads_1505 = new Set(),
JSCompiler_object_inline_preloads_1504 = { JSCompiler_object_inline_preloads_1506 = {
images: new Map(), images: new Map(),
stylesheets: new Map(), stylesheets: new Map(),
scripts: new Map(), scripts: new Map(),
@ -2561,7 +2570,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
scriptConfig.moduleScriptResources[href] = null; scriptConfig.moduleScriptResources[href] = null;
scriptConfig = []; scriptConfig = [];
pushLinkImpl(scriptConfig, props); pushLinkImpl(scriptConfig, props);
JSCompiler_object_inline_bootstrapScripts_1501.add(scriptConfig); JSCompiler_object_inline_bootstrapScripts_1503.add(scriptConfig);
bootstrapChunks.push('<script src="', escapeTextForBrowser(src)); bootstrapChunks.push('<script src="', escapeTextForBrowser(src));
"string" === typeof integrity && "string" === typeof integrity &&
bootstrapChunks.push('" integrity="', escapeTextForBrowser(integrity)); bootstrapChunks.push('" integrity="', escapeTextForBrowser(integrity));
@ -2602,7 +2611,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
(props.moduleScriptResources[scriptConfig] = null), (props.moduleScriptResources[scriptConfig] = null),
(props = []), (props = []),
pushLinkImpl(props, integrity), pushLinkImpl(props, integrity),
JSCompiler_object_inline_bootstrapScripts_1501.add(props), JSCompiler_object_inline_bootstrapScripts_1503.add(props),
bootstrapChunks.push( bootstrapChunks.push(
'<script type="module" src="', '<script type="module" src="',
escapeTextForBrowser(i) escapeTextForBrowser(i)
@ -2617,7 +2626,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
bootstrapChunks.push('" async="">\x3c/script>'); bootstrapChunks.push('" async="">\x3c/script>');
return { return {
placeholderPrefix: bootstrapScriptContent, placeholderPrefix: bootstrapScriptContent,
segmentPrefix: JSCompiler_object_inline_segmentPrefix_1483, segmentPrefix: JSCompiler_object_inline_segmentPrefix_1485,
boundaryPrefix: idPrefix, boundaryPrefix: idPrefix,
startInlineScript: "<script>", startInlineScript: "<script>",
htmlChunks: null, htmlChunks: null,
@ -2637,14 +2646,14 @@ function createRenderState(resumableState, generateStaticMarkup) {
charsetChunks: [], charsetChunks: [],
viewportChunks: [], viewportChunks: [],
hoistableChunks: [], hoistableChunks: [],
preconnects: JSCompiler_object_inline_preconnects_1497, preconnects: JSCompiler_object_inline_preconnects_1499,
fontPreloads: JSCompiler_object_inline_fontPreloads_1498, fontPreloads: JSCompiler_object_inline_fontPreloads_1500,
highImagePreloads: JSCompiler_object_inline_highImagePreloads_1499, highImagePreloads: JSCompiler_object_inline_highImagePreloads_1501,
styles: JSCompiler_object_inline_styles_1500, styles: JSCompiler_object_inline_styles_1502,
bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1501, bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1503,
scripts: JSCompiler_object_inline_scripts_1502, scripts: JSCompiler_object_inline_scripts_1504,
bulkPreloads: JSCompiler_object_inline_bulkPreloads_1503, bulkPreloads: JSCompiler_object_inline_bulkPreloads_1505,
preloads: JSCompiler_object_inline_preloads_1504, preloads: JSCompiler_object_inline_preloads_1506,
stylesToHoist: !1, stylesToHoist: !1,
generateStaticMarkup: generateStaticMarkup generateStaticMarkup: generateStaticMarkup
}; };
@ -3151,6 +3160,11 @@ var HooksDispatcher = {
useCacheRefresh: function () { useCacheRefresh: function () {
return unsupportedRefresh; return unsupportedRefresh;
}, },
useMemoCache: function (size) {
for (var data = Array(size), i = 0; i < size; i++)
data[i] = REACT_MEMO_CACHE_SENTINEL;
return data;
},
useHostTransitionStatus: function () { useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent(); resolveCurrentlyRenderingComponent();
return sharedNotPendingObject; return sharedNotPendingObject;
@ -5455,4 +5469,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
); );
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@ -99,6 +99,7 @@ var REACT_SCOPE_TYPE = Symbol.for('react.scope');
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -2527,11 +2528,7 @@ var startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
var target = this; var target = this;
target.push(startHiddenInputChunk); target.push(startHiddenInputChunk);
validateAdditionalFormField(value);
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'It probably means you are closing over binary data or FormData in a Server Action.');
}
pushStringAttribute(target, 'name', key); pushStringAttribute(target, 'name', key);
pushStringAttribute(target, 'value', value); pushStringAttribute(target, 'value', value);
target.push(endOfStartTagSelfClosing); target.push(endOfStartTagSelfClosing);
@ -2544,6 +2541,21 @@ function pushAdditionalFormFields(target, formData) {
} }
} }
function validateAdditionalFormField(value, key) {
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'Will fallback to client hydration.');
}
}
function validateAdditionalFormFields(formData) {
if (formData != null) {
// $FlowFixMe[prop-missing]: FormData has forEach.
formData.forEach(validateAdditionalFormField);
}
return formData;
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
var customAction = formAction.$$FORM_ACTION; var customAction = formAction.$$FORM_ACTION;
@ -2551,7 +2563,13 @@ function getCustomFormFields(resumableState, formAction) {
var prefix = makeFormFieldPrefix(resumableState); var prefix = makeFormFieldPrefix(resumableState);
try { try {
return formAction.$$FORM_ACTION(prefix); var customFields = formAction.$$FORM_ACTION(prefix);
if (customFields) {
validateAdditionalFormFields(customFields.data);
}
return customFields;
} catch (x) { } catch (x) {
if (typeof x === 'object' && x !== null && typeof x.then === 'function') { if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
// Rethrow suspense. // Rethrow suspense.
@ -8452,6 +8470,16 @@ function useCacheRefresh() {
return unsupportedRefresh; return unsupportedRefresh;
} }
function useMemoCache(size) {
var data = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
return data;
}
function noop$1() {} function noop$1() {}
var HooksDispatcher = { var HooksDispatcher = {
@ -8482,6 +8510,10 @@ var HooksDispatcher = {
HooksDispatcher.useCacheRefresh = useCacheRefresh; HooksDispatcher.useCacheRefresh = useCacheRefresh;
} }
{
HooksDispatcher.useMemoCache = useMemoCache;
}
{ {
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
} }

View file

@ -52,6 +52,7 @@ var React = require("next/dist/compiled/react"),
REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator, MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
isArrayImpl = Array.isArray; isArrayImpl = Array.isArray;
function murmurhash3_32_gc(key, seed) { function murmurhash3_32_gc(key, seed) {
@ -419,20 +420,28 @@ var actionJavaScriptURL = escapeTextForBrowser(
); );
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
this.push('<input type="hidden"'); this.push('<input type="hidden"');
if ("string" !== typeof value) validateAdditionalFormField(value);
throw Error(
"File/Blob fields are not yet supported in progressive forms. It probably means you are closing over binary data or FormData in a Server Action."
);
pushStringAttribute(this, "name", key); pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value); pushStringAttribute(this, "value", value);
this.push("/>"); this.push("/>");
} }
function validateAdditionalFormField(value) {
if ("string" !== typeof value)
throw Error(
"File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
);
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) { if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++; var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id; resumableState = resumableState.idPrefix + id;
try { try {
return formAction.$$FORM_ACTION(resumableState); var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) { } catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then) if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x; throw x;
@ -2534,16 +2543,16 @@ function createRenderState(resumableState, generateStaticMarkup) {
"\x3c/script>" "\x3c/script>"
); );
bootstrapScriptContent = idPrefix + "P:"; bootstrapScriptContent = idPrefix + "P:";
var JSCompiler_object_inline_segmentPrefix_1483 = idPrefix + "S:"; var JSCompiler_object_inline_segmentPrefix_1485 = idPrefix + "S:";
idPrefix += "B:"; idPrefix += "B:";
var JSCompiler_object_inline_preconnects_1497 = new Set(), var JSCompiler_object_inline_preconnects_1499 = new Set(),
JSCompiler_object_inline_fontPreloads_1498 = new Set(), JSCompiler_object_inline_fontPreloads_1500 = new Set(),
JSCompiler_object_inline_highImagePreloads_1499 = new Set(), JSCompiler_object_inline_highImagePreloads_1501 = new Set(),
JSCompiler_object_inline_styles_1500 = new Map(), JSCompiler_object_inline_styles_1502 = new Map(),
JSCompiler_object_inline_bootstrapScripts_1501 = new Set(), JSCompiler_object_inline_bootstrapScripts_1503 = new Set(),
JSCompiler_object_inline_scripts_1502 = new Set(), JSCompiler_object_inline_scripts_1504 = new Set(),
JSCompiler_object_inline_bulkPreloads_1503 = new Set(), JSCompiler_object_inline_bulkPreloads_1505 = new Set(),
JSCompiler_object_inline_preloads_1504 = { JSCompiler_object_inline_preloads_1506 = {
images: new Map(), images: new Map(),
stylesheets: new Map(), stylesheets: new Map(),
scripts: new Map(), scripts: new Map(),
@ -2580,7 +2589,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
scriptConfig.moduleScriptResources[href] = null; scriptConfig.moduleScriptResources[href] = null;
scriptConfig = []; scriptConfig = [];
pushLinkImpl(scriptConfig, props); pushLinkImpl(scriptConfig, props);
JSCompiler_object_inline_bootstrapScripts_1501.add(scriptConfig); JSCompiler_object_inline_bootstrapScripts_1503.add(scriptConfig);
bootstrapChunks.push('<script src="', escapeTextForBrowser(src)); bootstrapChunks.push('<script src="', escapeTextForBrowser(src));
"string" === typeof integrity && "string" === typeof integrity &&
bootstrapChunks.push('" integrity="', escapeTextForBrowser(integrity)); bootstrapChunks.push('" integrity="', escapeTextForBrowser(integrity));
@ -2621,7 +2630,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
(props.moduleScriptResources[scriptConfig] = null), (props.moduleScriptResources[scriptConfig] = null),
(props = []), (props = []),
pushLinkImpl(props, integrity), pushLinkImpl(props, integrity),
JSCompiler_object_inline_bootstrapScripts_1501.add(props), JSCompiler_object_inline_bootstrapScripts_1503.add(props),
bootstrapChunks.push( bootstrapChunks.push(
'<script type="module" src="', '<script type="module" src="',
escapeTextForBrowser(i) escapeTextForBrowser(i)
@ -2636,7 +2645,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
bootstrapChunks.push('" async="">\x3c/script>'); bootstrapChunks.push('" async="">\x3c/script>');
return { return {
placeholderPrefix: bootstrapScriptContent, placeholderPrefix: bootstrapScriptContent,
segmentPrefix: JSCompiler_object_inline_segmentPrefix_1483, segmentPrefix: JSCompiler_object_inline_segmentPrefix_1485,
boundaryPrefix: idPrefix, boundaryPrefix: idPrefix,
startInlineScript: "<script>", startInlineScript: "<script>",
htmlChunks: null, htmlChunks: null,
@ -2656,14 +2665,14 @@ function createRenderState(resumableState, generateStaticMarkup) {
charsetChunks: [], charsetChunks: [],
viewportChunks: [], viewportChunks: [],
hoistableChunks: [], hoistableChunks: [],
preconnects: JSCompiler_object_inline_preconnects_1497, preconnects: JSCompiler_object_inline_preconnects_1499,
fontPreloads: JSCompiler_object_inline_fontPreloads_1498, fontPreloads: JSCompiler_object_inline_fontPreloads_1500,
highImagePreloads: JSCompiler_object_inline_highImagePreloads_1499, highImagePreloads: JSCompiler_object_inline_highImagePreloads_1501,
styles: JSCompiler_object_inline_styles_1500, styles: JSCompiler_object_inline_styles_1502,
bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1501, bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1503,
scripts: JSCompiler_object_inline_scripts_1502, scripts: JSCompiler_object_inline_scripts_1504,
bulkPreloads: JSCompiler_object_inline_bulkPreloads_1503, bulkPreloads: JSCompiler_object_inline_bulkPreloads_1505,
preloads: JSCompiler_object_inline_preloads_1504, preloads: JSCompiler_object_inline_preloads_1506,
stylesToHoist: !1, stylesToHoist: !1,
generateStaticMarkup: generateStaticMarkup generateStaticMarkup: generateStaticMarkup
}; };
@ -3199,6 +3208,11 @@ var HooksDispatcher = {
useCacheRefresh: function () { useCacheRefresh: function () {
return unsupportedRefresh; return unsupportedRefresh;
}, },
useMemoCache: function (size) {
for (var data = Array(size), i = 0; i < size; i++)
data[i] = REACT_MEMO_CACHE_SENTINEL;
return data;
},
useHostTransitionStatus: function () { useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent(); resolveCurrentlyRenderingComponent();
return sharedNotPendingObject; return sharedNotPendingObject;
@ -5537,4 +5551,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server'
); );
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@ -99,6 +99,7 @@ var REACT_SCOPE_TYPE = Symbol.for('react.scope');
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -2606,11 +2607,7 @@ var startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
var target = this; var target = this;
target.push(startHiddenInputChunk); target.push(startHiddenInputChunk);
validateAdditionalFormField(value);
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'It probably means you are closing over binary data or FormData in a Server Action.');
}
pushStringAttribute(target, 'name', key); pushStringAttribute(target, 'name', key);
pushStringAttribute(target, 'value', value); pushStringAttribute(target, 'value', value);
target.push(endOfStartTagSelfClosing); target.push(endOfStartTagSelfClosing);
@ -2623,6 +2620,21 @@ function pushAdditionalFormFields(target, formData) {
} }
} }
function validateAdditionalFormField(value, key) {
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'Will fallback to client hydration.');
}
}
function validateAdditionalFormFields(formData) {
if (formData != null) {
// $FlowFixMe[prop-missing]: FormData has forEach.
formData.forEach(validateAdditionalFormField);
}
return formData;
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
var customAction = formAction.$$FORM_ACTION; var customAction = formAction.$$FORM_ACTION;
@ -2630,7 +2642,13 @@ function getCustomFormFields(resumableState, formAction) {
var prefix = makeFormFieldPrefix(resumableState); var prefix = makeFormFieldPrefix(resumableState);
try { try {
return formAction.$$FORM_ACTION(prefix); var customFields = formAction.$$FORM_ACTION(prefix);
if (customFields) {
validateAdditionalFormFields(customFields.data);
}
return customFields;
} catch (x) { } catch (x) {
if (typeof x === 'object' && x !== null && typeof x.then === 'function') { if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
// Rethrow suspense. // Rethrow suspense.
@ -8460,6 +8478,16 @@ function useCacheRefresh() {
return unsupportedRefresh; return unsupportedRefresh;
} }
function useMemoCache(size) {
var data = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
return data;
}
function noop$1() {} function noop$1() {}
var HooksDispatcher = { var HooksDispatcher = {
@ -8490,6 +8518,10 @@ var HooksDispatcher = {
HooksDispatcher.useCacheRefresh = useCacheRefresh; HooksDispatcher.useCacheRefresh = useCacheRefresh;
} }
{
HooksDispatcher.useMemoCache = useMemoCache;
}
{ {
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
} }

View file

@ -67,6 +67,7 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator, MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
isArrayImpl = Array.isArray; isArrayImpl = Array.isArray;
function murmurhash3_32_gc(key, seed) { function murmurhash3_32_gc(key, seed) {
@ -729,17 +730,25 @@ var actionJavaScriptURL = stringToPrecomputedChunk(
startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"'); startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
this.push(startHiddenInputChunk); this.push(startHiddenInputChunk);
if ("string" !== typeof value) throw Error(formatProdErrorMessage(480)); validateAdditionalFormField(value);
pushStringAttribute(this, "name", key); pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value); pushStringAttribute(this, "value", value);
this.push(endOfStartTagSelfClosing); this.push(endOfStartTagSelfClosing);
} }
function validateAdditionalFormField(value) {
if ("string" !== typeof value) throw Error(formatProdErrorMessage(480));
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) { if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++; var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id; resumableState = resumableState.idPrefix + id;
try { try {
return formAction.$$FORM_ACTION(resumableState); var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) { } catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then) if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x; throw x;
@ -3486,6 +3495,11 @@ var HooksDispatcher = {
useCacheRefresh: function () { useCacheRefresh: function () {
return unsupportedRefresh; return unsupportedRefresh;
}, },
useMemoCache: function (size) {
for (var data = Array(size), i = 0; i < size; i++)
data[i] = REACT_MEMO_CACHE_SENTINEL;
return data;
},
useHostTransitionStatus: function () { useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent(); resolveCurrentlyRenderingComponent();
return sharedNotPendingObject; return sharedNotPendingObject;
@ -5790,4 +5804,4 @@ exports.renderToReadableStream = function (children, options) {
safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);
}); });
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -28,6 +28,7 @@ var React = require("next/dist/compiled/react"),
REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator, MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
isArrayImpl = Array.isArray; isArrayImpl = Array.isArray;
function flushBuffered(destination) { function flushBuffered(destination) {
@ -548,20 +549,28 @@ var actionJavaScriptURL = escapeTextForBrowser(
); );
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
this.push('<input type="hidden"'); this.push('<input type="hidden"');
if ("string" !== typeof value) validateAdditionalFormField(value);
throw Error(
"File/Blob fields are not yet supported in progressive forms. It probably means you are closing over binary data or FormData in a Server Action."
);
pushStringAttribute(this, "name", key); pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value); pushStringAttribute(this, "value", value);
this.push("/>"); this.push("/>");
} }
function validateAdditionalFormField(value) {
if ("string" !== typeof value)
throw Error(
"File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
);
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) { if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++; var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id; resumableState = resumableState.idPrefix + id;
try { try {
return formAction.$$FORM_ACTION(resumableState); var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) { } catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then) if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x; throw x;
@ -3169,6 +3178,11 @@ var HooksDispatcher = {
useCacheRefresh: function () { useCacheRefresh: function () {
return unsupportedRefresh; return unsupportedRefresh;
}, },
useMemoCache: function (size) {
for (var data = Array(size), i = 0; i < size; i++)
data[i] = REACT_MEMO_CACHE_SENTINEL;
return data;
},
useHostTransitionStatus: function () { useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent(); resolveCurrentlyRenderingComponent();
return sharedNotPendingObject; return sharedNotPendingObject;
@ -5503,4 +5517,4 @@ exports.renderToReadableStream = function (children, options) {
safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);
}); });
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@ -99,6 +99,7 @@ var REACT_SCOPE_TYPE = Symbol.for('react.scope');
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -2606,11 +2607,7 @@ var startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
var target = this; var target = this;
target.push(startHiddenInputChunk); target.push(startHiddenInputChunk);
validateAdditionalFormField(value);
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'It probably means you are closing over binary data or FormData in a Server Action.');
}
pushStringAttribute(target, 'name', key); pushStringAttribute(target, 'name', key);
pushStringAttribute(target, 'value', value); pushStringAttribute(target, 'value', value);
target.push(endOfStartTagSelfClosing); target.push(endOfStartTagSelfClosing);
@ -2623,6 +2620,21 @@ function pushAdditionalFormFields(target, formData) {
} }
} }
function validateAdditionalFormField(value, key) {
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'Will fallback to client hydration.');
}
}
function validateAdditionalFormFields(formData) {
if (formData != null) {
// $FlowFixMe[prop-missing]: FormData has forEach.
formData.forEach(validateAdditionalFormField);
}
return formData;
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
var customAction = formAction.$$FORM_ACTION; var customAction = formAction.$$FORM_ACTION;
@ -2630,7 +2642,13 @@ function getCustomFormFields(resumableState, formAction) {
var prefix = makeFormFieldPrefix(resumableState); var prefix = makeFormFieldPrefix(resumableState);
try { try {
return formAction.$$FORM_ACTION(prefix); var customFields = formAction.$$FORM_ACTION(prefix);
if (customFields) {
validateAdditionalFormFields(customFields.data);
}
return customFields;
} catch (x) { } catch (x) {
if (typeof x === 'object' && x !== null && typeof x.then === 'function') { if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
// Rethrow suspense. // Rethrow suspense.
@ -8463,6 +8481,16 @@ function useCacheRefresh() {
return unsupportedRefresh; return unsupportedRefresh;
} }
function useMemoCache(size) {
var data = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
return data;
}
function noop$1() {} function noop$1() {}
var HooksDispatcher = { var HooksDispatcher = {
@ -8493,6 +8521,10 @@ var HooksDispatcher = {
HooksDispatcher.useCacheRefresh = useCacheRefresh; HooksDispatcher.useCacheRefresh = useCacheRefresh;
} }
{
HooksDispatcher.useMemoCache = useMemoCache;
}
{ {
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
} }

View file

@ -52,6 +52,7 @@ var React = require("next/dist/compiled/react"),
REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator, MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
isArrayImpl = Array.isArray; isArrayImpl = Array.isArray;
function murmurhash3_32_gc(key, seed) { function murmurhash3_32_gc(key, seed) {
@ -717,20 +718,28 @@ var actionJavaScriptURL = stringToPrecomputedChunk(
startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"'); startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
this.push(startHiddenInputChunk); this.push(startHiddenInputChunk);
if ("string" !== typeof value) validateAdditionalFormField(value);
throw Error(
"File/Blob fields are not yet supported in progressive forms. It probably means you are closing over binary data or FormData in a Server Action."
);
pushStringAttribute(this, "name", key); pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value); pushStringAttribute(this, "value", value);
this.push(endOfStartTagSelfClosing); this.push(endOfStartTagSelfClosing);
} }
function validateAdditionalFormField(value) {
if ("string" !== typeof value)
throw Error(
"File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
);
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) { if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++; var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id; resumableState = resumableState.idPrefix + id;
try { try {
return formAction.$$FORM_ACTION(resumableState); var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) { } catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then) if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x; throw x;
@ -3536,6 +3545,11 @@ var HooksDispatcher = {
useCacheRefresh: function () { useCacheRefresh: function () {
return unsupportedRefresh; return unsupportedRefresh;
}, },
useMemoCache: function (size) {
for (var data = Array(size), i = 0; i < size; i++)
data[i] = REACT_MEMO_CACHE_SENTINEL;
return data;
},
useHostTransitionStatus: function () { useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent(); resolveCurrentlyRenderingComponent();
return sharedNotPendingObject; return sharedNotPendingObject;
@ -5902,4 +5916,4 @@ exports.renderToReadableStream = function (children, options) {
startWork(request); startWork(request);
}); });
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -20,7 +20,7 @@ var crypto = require('crypto');
var async_hooks = require('async_hooks'); var async_hooks = require('async_hooks');
var ReactDOM = require('react-dom'); var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@ -102,6 +102,7 @@ var REACT_SCOPE_TYPE = Symbol.for('react.scope');
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) { function getIteratorFn(maybeIterable) {
@ -2586,11 +2587,7 @@ var startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
var target = this; var target = this;
target.push(startHiddenInputChunk); target.push(startHiddenInputChunk);
validateAdditionalFormField(value);
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'It probably means you are closing over binary data or FormData in a Server Action.');
}
pushStringAttribute(target, 'name', key); pushStringAttribute(target, 'name', key);
pushStringAttribute(target, 'value', value); pushStringAttribute(target, 'value', value);
target.push(endOfStartTagSelfClosing); target.push(endOfStartTagSelfClosing);
@ -2603,6 +2600,21 @@ function pushAdditionalFormFields(target, formData) {
} }
} }
function validateAdditionalFormField(value, key) {
if (typeof value !== 'string') {
throw new Error('File/Blob fields are not yet supported in progressive forms. ' + 'Will fallback to client hydration.');
}
}
function validateAdditionalFormFields(formData) {
if (formData != null) {
// $FlowFixMe[prop-missing]: FormData has forEach.
formData.forEach(validateAdditionalFormField);
}
return formData;
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
var customAction = formAction.$$FORM_ACTION; var customAction = formAction.$$FORM_ACTION;
@ -2610,7 +2622,13 @@ function getCustomFormFields(resumableState, formAction) {
var prefix = makeFormFieldPrefix(resumableState); var prefix = makeFormFieldPrefix(resumableState);
try { try {
return formAction.$$FORM_ACTION(prefix); var customFields = formAction.$$FORM_ACTION(prefix);
if (customFields) {
validateAdditionalFormFields(customFields.data);
}
return customFields;
} catch (x) { } catch (x) {
if (typeof x === 'object' && x !== null && typeof x.then === 'function') { if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
// Rethrow suspense. // Rethrow suspense.
@ -8442,6 +8460,16 @@ function useCacheRefresh() {
return unsupportedRefresh; return unsupportedRefresh;
} }
function useMemoCache(size) {
var data = new Array(size);
for (var i = 0; i < size; i++) {
data[i] = REACT_MEMO_CACHE_SENTINEL;
}
return data;
}
function noop$1() {} function noop$1() {}
var HooksDispatcher = { var HooksDispatcher = {
@ -8472,6 +8500,10 @@ var HooksDispatcher = {
HooksDispatcher.useCacheRefresh = useCacheRefresh; HooksDispatcher.useCacheRefresh = useCacheRefresh;
} }
{
HooksDispatcher.useMemoCache = useMemoCache;
}
{ {
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus; HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
} }

View file

@ -31,6 +31,7 @@ var util = require("util"),
REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator, MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
isArrayImpl = Array.isArray; isArrayImpl = Array.isArray;
function flushBuffered(destination) { function flushBuffered(destination) {
@ -448,20 +449,28 @@ var actionJavaScriptURL = stringToPrecomputedChunk(
startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"'); startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
function pushAdditionalFormField(value, key) { function pushAdditionalFormField(value, key) {
this.push(startHiddenInputChunk); this.push(startHiddenInputChunk);
if ("string" !== typeof value) validateAdditionalFormField(value);
throw Error(
"File/Blob fields are not yet supported in progressive forms. It probably means you are closing over binary data or FormData in a Server Action."
);
pushStringAttribute(this, "name", key); pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value); pushStringAttribute(this, "value", value);
this.push(endOfStartTagSelfClosing); this.push(endOfStartTagSelfClosing);
} }
function validateAdditionalFormField(value) {
if ("string" !== typeof value)
throw Error(
"File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
);
}
function getCustomFormFields(resumableState, formAction) { function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) { if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++; var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id; resumableState = resumableState.idPrefix + id;
try { try {
return formAction.$$FORM_ACTION(resumableState); var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) { } catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then) if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x; throw x;
@ -3231,6 +3240,11 @@ var HooksDispatcher = {
useCacheRefresh: function () { useCacheRefresh: function () {
return unsupportedRefresh; return unsupportedRefresh;
}, },
useMemoCache: function (size) {
for (var data = Array(size), i = 0; i < size; i++)
data[i] = REACT_MEMO_CACHE_SENTINEL;
return data;
},
useHostTransitionStatus: function () { useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent(); resolveCurrentlyRenderingComponent();
return sharedNotPendingObject; return sharedNotPendingObject;
@ -5765,4 +5779,4 @@ exports.renderToPipeableStream = function (children, options) {
} }
}; };
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -12,10 +12,7 @@
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {
(function() { (function() {
'use strict';
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
@ -23,7 +20,7 @@ if (
) { ) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
} }
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@ -129,7 +126,7 @@ var Internals = {
findDOMNode: null findDOMNode: null
}; };
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
/** /**
* HTML nodeType values that represent the type of the node * HTML nodeType values that represent the type of the node
@ -613,7 +610,6 @@ exports.unstable_batchedUpdates = batchedUpdates;
exports.useFormState = useFormState; exports.useFormState = useFormState;
exports.useFormStatus = useFormStatus; exports.useFormStatus = useFormStatus;
exports.version = ReactVersion; exports.version = ReactVersion;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===

View file

@ -206,4 +206,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () { exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus(); return ReactSharedInternals.H.useHostTransitionStatus();
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -67,10 +67,10 @@
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"dependencies": { "dependencies": {
"scheduler": "0.25.0-beta-4508873393-20240430" "scheduler": "0.25.0-beta-04b058868c-20240508"
}, },
"peerDependencies": { "peerDependencies": {
"react": "19.0.0-beta-4508873393-20240430" "react": "19.0.0-beta-04b058868c-20240508"
}, },
"browser": { "browser": {
"./server.js": "./server.browser.js", "./server.js": "./server.browser.js",

View file

@ -1,6 +1,6 @@
{ {
"name": "react-is", "name": "react-is",
"version": "19.0.0-beta-4508873393-20240430", "version": "19.0.0-beta-04b058868c-20240508",
"description": "Brand checking of React Elements.", "description": "Brand checking of React Elements.",
"main": "index.js", "main": "index.js",
"sideEffects": false, "sideEffects": false,

View file

@ -944,12 +944,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -990,12 +990,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -1005,11 +1005,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1040,26 +1038,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1070,19 +1068,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -167,8 +167,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -178,11 +177,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -982,12 +982,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -1028,12 +1028,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -1043,11 +1043,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1078,26 +1076,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1108,19 +1106,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -188,8 +188,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -199,11 +198,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -980,12 +980,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -1026,12 +1026,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -1041,11 +1041,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1076,26 +1074,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1106,19 +1104,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -189,8 +189,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -200,11 +199,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -935,12 +935,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -981,12 +981,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -996,11 +996,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1031,26 +1029,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1061,19 +1059,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -173,8 +173,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -184,11 +183,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -757,6 +757,8 @@ function createHints() {
var supportsRequestStorage = false; var supportsRequestStorage = false;
var requestStorage = null; var requestStorage = null;
var supportsComponentStorage = false;
var componentStorage = null;
var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars
@ -1103,6 +1105,16 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1127,16 +1139,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1714,8 +1719,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1743,18 +1751,14 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
if (supportsComponentStorage) ; else {
result = Component(props, secondArg); result = Component(props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1893,9 +1897,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2039,7 +2042,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2381,7 +2384,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2486,7 +2489,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3503,7 +3506,6 @@ function loadChunk(filename) {
return __turbopack_load__(filename); return __turbopack_load__(filename);
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3581,7 +3583,7 @@ function wakeChunk(listeners, value) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3628,7 +3630,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3705,21 +3707,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3745,19 +3756,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3774,9 +3812,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3785,7 +3822,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3800,8 +3837,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3809,9 +3845,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3819,9 +3853,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3829,10 +3861,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3840,9 +3872,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -3889,28 +3919,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1587,20 +1587,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1645,13 +1652,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1666,11 +1678,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1682,7 +1721,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1696,29 +1735,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1734,27 +1771,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }

View file

@ -756,7 +756,9 @@ function createHints() {
} }
var supportsRequestStorage = typeof AsyncLocalStorage === 'function'; var supportsRequestStorage = typeof AsyncLocalStorage === 'function';
var requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null; // We use the Node version but get access to async_hooks from a global. var requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null;
var supportsComponentStorage = supportsRequestStorage;
var componentStorage = supportsComponentStorage ? new AsyncLocalStorage() : null; // We use the Node version but get access to async_hooks from a global.
typeof async_hooks === 'object' ? async_hooks.createHook : function () { typeof async_hooks === 'object' ? async_hooks.createHook : function () {
return { return {
@ -1111,6 +1113,21 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
if (supportsComponentStorage) {
var owner = componentStorage.getStore();
if (owner) return owner;
}
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1135,16 +1152,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1727,8 +1737,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1756,18 +1769,17 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
if (supportsComponentStorage) {
// Run the component in an Async Context that tracks the current owner.
result = componentStorage.run(componentDebugInfo, Component, props, secondArg);
} else {
result = Component(props, secondArg); result = Component(props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1906,9 +1918,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2052,7 +2063,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2394,7 +2405,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2499,7 +2510,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3526,7 +3537,6 @@ function loadChunk(filename) {
return globalThis.__next_chunk_load__(filename); return globalThis.__next_chunk_load__(filename);
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3604,7 +3614,7 @@ function wakeChunk(listeners, value) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3651,7 +3661,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3728,21 +3738,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3768,19 +3787,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3797,9 +3843,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3808,7 +3853,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3823,8 +3868,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3832,9 +3876,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3842,9 +3884,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3852,10 +3892,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3863,9 +3903,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -3912,28 +3950,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1618,20 +1618,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1676,13 +1683,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1697,11 +1709,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1713,7 +1752,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1727,29 +1766,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1765,27 +1802,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }

View file

@ -824,6 +824,8 @@ function createHints() {
var supportsRequestStorage = true; var supportsRequestStorage = true;
var requestStorage = new async_hooks.AsyncLocalStorage(); var requestStorage = new async_hooks.AsyncLocalStorage();
var supportsComponentStorage = true;
var componentStorage = new async_hooks.AsyncLocalStorage() ;
var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars
@ -1170,6 +1172,21 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
{
var owner = componentStorage.getStore();
if (owner) return owner;
}
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1194,16 +1211,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1786,8 +1796,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1815,18 +1828,15 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
result = Component(props, secondArg); if (supportsComponentStorage) {
// Run the component in an Async Context that tracks the current owner.
result = componentStorage.run(componentDebugInfo, Component, props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1965,9 +1975,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2111,7 +2120,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2453,7 +2462,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2558,7 +2567,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3579,7 +3588,6 @@ function loadChunk(filename) {
return globalThis.__next_chunk_load__(filename); return globalThis.__next_chunk_load__(filename);
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3678,7 +3686,7 @@ function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3699,7 +3707,7 @@ function createResolvedModelChunk(response, value) {
function resolveModelChunk(chunk, value) { function resolveModelChunk(chunk, value) {
if (chunk.status !== PENDING) { if (chunk.status !== PENDING) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3747,7 +3755,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3824,21 +3832,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3864,19 +3881,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3893,9 +3937,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3904,7 +3947,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3919,8 +3962,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3928,9 +3970,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3938,9 +3978,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3948,10 +3986,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3959,9 +3997,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -4008,28 +4044,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1672,20 +1672,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1730,13 +1737,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1751,11 +1763,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1767,7 +1806,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1781,29 +1820,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1819,27 +1856,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }
@ -1973,12 +1990,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, turbopackMap) {
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
); );
pendingFiles++; pendingFiles++;
var JSCompiler_object_inline_chunks_207 = []; var JSCompiler_object_inline_chunks_203 = [];
value.on("data", function (chunk) { value.on("data", function (chunk) {
JSCompiler_object_inline_chunks_207.push(chunk); JSCompiler_object_inline_chunks_203.push(chunk);
}); });
value.on("end", function () { value.on("end", function () {
var blob = new Blob(JSCompiler_object_inline_chunks_207, { var blob = new Blob(JSCompiler_object_inline_chunks_203, {
type: mimeType type: mimeType
}); });
response._formData.append(name, blob, filename); response._formData.append(name, blob, filename);

View file

@ -824,6 +824,8 @@ function createHints() {
var supportsRequestStorage = true; var supportsRequestStorage = true;
var requestStorage = new async_hooks.AsyncLocalStorage(); var requestStorage = new async_hooks.AsyncLocalStorage();
var supportsComponentStorage = true;
var componentStorage = new async_hooks.AsyncLocalStorage() ;
var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars
@ -1170,6 +1172,21 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
{
var owner = componentStorage.getStore();
if (owner) return owner;
}
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1194,16 +1211,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1786,8 +1796,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1815,18 +1828,15 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
result = Component(props, secondArg); if (supportsComponentStorage) {
// Run the component in an Async Context that tracks the current owner.
result = componentStorage.run(componentDebugInfo, Component, props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1965,9 +1975,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2111,7 +2120,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2453,7 +2462,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2558,7 +2567,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3508,7 +3517,6 @@ function requireModule(metadata) {
return moduleExports[metadata.name]; return moduleExports[metadata.name];
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3607,7 +3615,7 @@ function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3628,7 +3636,7 @@ function createResolvedModelChunk(response, value) {
function resolveModelChunk(chunk, value) { function resolveModelChunk(chunk, value) {
if (chunk.status !== PENDING) { if (chunk.status !== PENDING) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3676,7 +3684,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3753,21 +3761,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3793,19 +3810,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3822,9 +3866,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3833,7 +3876,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3848,8 +3891,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3857,9 +3899,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3867,9 +3907,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3877,10 +3915,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3888,9 +3926,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -3937,28 +3973,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1641,20 +1641,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1699,13 +1706,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1720,11 +1732,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1736,7 +1775,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1750,29 +1789,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1788,27 +1825,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }
@ -1942,12 +1959,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, turbopackMap) {
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
); );
pendingFiles++; pendingFiles++;
var JSCompiler_object_inline_chunks_207 = []; var JSCompiler_object_inline_chunks_203 = [];
value.on("data", function (chunk) { value.on("data", function (chunk) {
JSCompiler_object_inline_chunks_207.push(chunk); JSCompiler_object_inline_chunks_203.push(chunk);
}); });
value.on("end", function () { value.on("end", function () {
var blob = new Blob(JSCompiler_object_inline_chunks_207, { var blob = new Blob(JSCompiler_object_inline_chunks_203, {
type: mimeType type: mimeType
}); });
response._formData.append(name, blob, filename); response._formData.append(name, blob, filename);

View file

@ -47,7 +47,7 @@
"neo-async": "^2.6.1" "neo-async": "^2.6.1"
}, },
"peerDependencies": { "peerDependencies": {
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430" "react-dom": "19.0.0-beta-04b058868c-20240508"
} }
} }

View file

@ -965,12 +965,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -1011,12 +1011,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -1026,11 +1026,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1061,26 +1059,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1091,19 +1089,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -177,8 +177,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -188,11 +187,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -984,12 +984,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -1030,12 +1030,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -1045,11 +1045,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1080,26 +1078,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1110,19 +1108,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -189,8 +189,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -200,11 +199,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -982,12 +982,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -1028,12 +1028,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -1043,11 +1043,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1078,26 +1076,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1108,19 +1106,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -190,8 +190,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -201,11 +200,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -935,12 +935,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
// While the first promise resolved, its value isn't necessarily what we'll // While the first promise resolved, its value isn't necessarily what we'll
// resolve into because we might suspend again. // resolve into because we might suspend again.
try { try {
var _partJSON = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON2 = JSON.stringify(value, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data.append(formFieldPrefix + _lazyId, _partJSON); _data.append(formFieldPrefix + _lazyId, _partJSON2);
pendingParts--; pendingParts--;
@ -981,12 +981,12 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
_thenable.then(function (partValue) { _thenable.then(function (partValue) {
try { try {
var _partJSON2 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above. var _partJSON3 = JSON.stringify(partValue, resolveToJSON); // $FlowFixMe[incompatible-type] We know it's not null because we assigned it above.
var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion var _data2 = formData; // eslint-disable-next-line react-internal/safe-string-coercion
_data2.append(formFieldPrefix + promiseId, _partJSON2); _data2.append(formFieldPrefix + promiseId, _partJSON3);
pendingParts--; pendingParts--;
@ -996,11 +996,9 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, function (reason) { }, // In the future we could consider serializing this as an error
// In the future we could consider serializing this as an error
// that throws on the server instead. // that throws on the server instead.
reject(reason); reject);
});
return serializePromiseID(promiseId); return serializePromiseID(promiseId);
} }
@ -1031,26 +1029,26 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
} }
if (value instanceof Map) { if (value instanceof Map) {
var _partJSON3 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON3);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON); var _partJSON4 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var mapId = nextPartId++;
formData.append(formFieldPrefix + mapId, _partJSON4);
return serializeMapID(mapId);
}
if (value instanceof Set) {
var _partJSON5 = JSON.stringify(Array.from(value), resolveToJSON);
if (formData === null) {
formData = new FormData();
}
var setId = nextPartId++; var setId = nextPartId++;
formData.append(formFieldPrefix + setId, _partJSON4); formData.append(formFieldPrefix + setId, _partJSON5);
return serializeSetID(setId); return serializeSetID(setId);
} }
@ -1061,19 +1059,19 @@ function processReply(root, formFieldPrefix, temporaryReferences, resolve, rejec
if (iterator === value) { if (iterator === value) {
// Iterator, not Iterable // Iterator, not Iterable
var _partJSON5 = JSON.stringify(Array.from(iterator), resolveToJSON); var _partJSON6 = JSON.stringify(Array.from(iterator), resolveToJSON);
if (formData === null) { if (formData === null) {
formData = new FormData(); formData = new FormData();
} }
var iteratorId = nextPartId++; var iteratorId = nextPartId++;
formData.append(formFieldPrefix + iteratorId, _partJSON5); formData.append(formFieldPrefix + iteratorId, _partJSON6);
return serializeIteratorID(iteratorId); return serializeIteratorID(iteratorId);
} }
return Array.from(iterator); return Array.from(iterator);
} // Verify that this is a simple plain object. }
var proto = getPrototypeOf(value); var proto = getPrototypeOf(value);

View file

@ -173,8 +173,7 @@ function processReply(
null === formData && (formData = new FormData()); null === formData && (formData = new FormData());
pendingParts++; pendingParts++;
var promiseId = nextPartId++; var promiseId = nextPartId++;
value.then( value.then(function (partValue) {
function (partValue) {
try { try {
var partJSON$25 = JSON.stringify(partValue, resolveToJSON); var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
partValue = formData; partValue = formData;
@ -184,11 +183,7 @@ function processReply(
} catch (reason) { } catch (reason) {
reject(reason); reject(reason);
} }
}, }, reject);
function (reason) {
reject(reason);
}
);
return "$@" + promiseId.toString(16); return "$@" + promiseId.toString(16);
} }
if (isArrayImpl(value)) return value; if (isArrayImpl(value)) return value;

View file

@ -765,6 +765,8 @@ function createHints() {
var supportsRequestStorage = false; var supportsRequestStorage = false;
var requestStorage = null; var requestStorage = null;
var supportsComponentStorage = false;
var componentStorage = null;
var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars
@ -1111,6 +1113,16 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1135,16 +1147,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1722,8 +1727,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1751,18 +1759,14 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
if (supportsComponentStorage) ; else {
result = Component(props, secondArg); result = Component(props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1901,9 +1905,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2047,7 +2050,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2389,7 +2392,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2494,7 +2497,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3535,7 +3538,6 @@ function loadChunk(chunkId, filename) {
return __webpack_chunk_load__(chunkId); return __webpack_chunk_load__(chunkId);
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3613,7 +3615,7 @@ function wakeChunk(listeners, value) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3660,7 +3662,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3737,21 +3739,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3777,19 +3788,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3806,9 +3844,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3817,7 +3854,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3832,8 +3869,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3841,9 +3877,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3851,9 +3885,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3861,10 +3893,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3872,9 +3904,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -3921,28 +3951,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1597,20 +1597,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1655,13 +1662,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1676,11 +1688,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1692,7 +1731,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1706,29 +1745,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1744,27 +1781,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }

View file

@ -764,7 +764,9 @@ function createHints() {
} }
var supportsRequestStorage = typeof AsyncLocalStorage === 'function'; var supportsRequestStorage = typeof AsyncLocalStorage === 'function';
var requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null; // We use the Node version but get access to async_hooks from a global. var requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null;
var supportsComponentStorage = supportsRequestStorage;
var componentStorage = supportsComponentStorage ? new AsyncLocalStorage() : null; // We use the Node version but get access to async_hooks from a global.
typeof async_hooks === 'object' ? async_hooks.createHook : function () { typeof async_hooks === 'object' ? async_hooks.createHook : function () {
return { return {
@ -1119,6 +1121,21 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
if (supportsComponentStorage) {
var owner = componentStorage.getStore();
if (owner) return owner;
}
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1143,16 +1160,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1735,8 +1745,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1764,18 +1777,17 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
if (supportsComponentStorage) {
// Run the component in an Async Context that tracks the current owner.
result = componentStorage.run(componentDebugInfo, Component, props, secondArg);
} else {
result = Component(props, secondArg); result = Component(props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1914,9 +1926,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2060,7 +2071,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2402,7 +2413,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2507,7 +2518,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3539,7 +3550,6 @@ function loadChunk(chunkId, filename) {
return __webpack_chunk_load__(chunkId); return __webpack_chunk_load__(chunkId);
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3617,7 +3627,7 @@ function wakeChunk(listeners, value) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3664,7 +3674,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3741,21 +3751,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3781,19 +3800,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3810,9 +3856,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3821,7 +3866,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3836,8 +3881,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3845,9 +3889,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3855,9 +3897,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3865,10 +3905,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3876,9 +3916,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -3925,28 +3963,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1619,20 +1619,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1677,13 +1684,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1698,11 +1710,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1714,7 +1753,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1728,29 +1767,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1766,27 +1803,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }

View file

@ -832,6 +832,8 @@ function createHints() {
var supportsRequestStorage = true; var supportsRequestStorage = true;
var requestStorage = new async_hooks.AsyncLocalStorage(); var requestStorage = new async_hooks.AsyncLocalStorage();
var supportsComponentStorage = true;
var componentStorage = new async_hooks.AsyncLocalStorage() ;
var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars
@ -1178,6 +1180,21 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
{
var owner = componentStorage.getStore();
if (owner) return owner;
}
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1202,16 +1219,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1794,8 +1804,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1823,18 +1836,15 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
result = Component(props, secondArg); if (supportsComponentStorage) {
// Run the component in an Async Context that tracks the current owner.
result = componentStorage.run(componentDebugInfo, Component, props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1973,9 +1983,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2119,7 +2128,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2461,7 +2470,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2566,7 +2575,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3592,7 +3601,6 @@ function loadChunk(chunkId, filename) {
return __webpack_chunk_load__(chunkId); return __webpack_chunk_load__(chunkId);
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3691,7 +3699,7 @@ function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3712,7 +3720,7 @@ function createResolvedModelChunk(response, value) {
function resolveModelChunk(chunk, value) { function resolveModelChunk(chunk, value) {
if (chunk.status !== PENDING) { if (chunk.status !== PENDING) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3760,7 +3768,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3837,21 +3845,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3877,19 +3894,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3906,9 +3950,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3917,7 +3960,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3932,8 +3975,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3941,9 +3983,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3951,9 +3991,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3961,10 +3999,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3972,9 +4010,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -4021,28 +4057,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1673,20 +1673,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1731,13 +1738,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1752,11 +1764,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1768,7 +1807,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1782,29 +1821,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1820,27 +1857,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }
@ -1997,12 +2014,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap) {
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
); );
pendingFiles++; pendingFiles++;
var JSCompiler_object_inline_chunks_209 = []; var JSCompiler_object_inline_chunks_205 = [];
value.on("data", function (chunk) { value.on("data", function (chunk) {
JSCompiler_object_inline_chunks_209.push(chunk); JSCompiler_object_inline_chunks_205.push(chunk);
}); });
value.on("end", function () { value.on("end", function () {
var blob = new Blob(JSCompiler_object_inline_chunks_209, { var blob = new Blob(JSCompiler_object_inline_chunks_205, {
type: mimeType type: mimeType
}); });
response._formData.append(name, blob, filename); response._formData.append(name, blob, filename);

View file

@ -832,6 +832,8 @@ function createHints() {
var supportsRequestStorage = true; var supportsRequestStorage = true;
var requestStorage = new async_hooks.AsyncLocalStorage(); var requestStorage = new async_hooks.AsyncLocalStorage();
var supportsComponentStorage = true;
var componentStorage = new async_hooks.AsyncLocalStorage() ;
var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars var TEMPORARY_REFERENCE_TAG = Symbol.for('react.temporary.reference'); // eslint-disable-next-line no-unused-vars
@ -1178,6 +1180,21 @@ function use(usable) {
} }
} }
var currentOwner = null;
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
}
function resolveOwner() {
if (currentOwner) return currentOwner;
{
var owner = componentStorage.getStore();
if (owner) return owner;
}
return null;
}
function resolveCache() { function resolveCache() {
var request = resolveRequest(); var request = resolveRequest();
@ -1202,16 +1219,9 @@ var DefaultAsyncDispatcher = {
return entry; return entry;
} }
}; };
var currentOwner = null;
{ {
DefaultAsyncDispatcher.getOwner = function () { DefaultAsyncDispatcher.getOwner = resolveOwner;
return currentOwner;
};
}
function setCurrentOwner(componentInfo) {
currentOwner = componentInfo;
} }
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
@ -1794,8 +1804,11 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
// component suspends we can reuse the same task object. If the same // component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored. // component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState; var prevThenableState = task.thenableState;
task.thenableState = null; task.thenableState = null; // The secondArg is always undefined in Server Components since refs error early.
var componentDebugInfo = null;
var secondArg = undefined;
var result;
var componentDebugInfo;
{ {
if (debugID === null) { if (debugID === null) {
@ -1823,18 +1836,15 @@ function renderFunctionComponent(request, task, key, Component, props, owner) {
outlineModel(request, componentDebugInfo); outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo);
} }
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early. prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
var secondArg = undefined;
var result;
{
setCurrentOwner(componentDebugInfo); setCurrentOwner(componentDebugInfo);
try { try {
result = Component(props, secondArg); if (supportsComponentStorage) {
// Run the component in an Async Context that tracks the current owner.
result = componentStorage.run(componentDebugInfo, Component, props, secondArg);
}
} finally { } finally {
setCurrentOwner(null); setCurrentOwner(null);
} }
@ -1973,9 +1983,8 @@ function renderFragment(request, task, children) {
function renderClientElement(task, type, key, props, owner) // DEV-only function renderClientElement(task, type, key, props, owner) // DEV-only
{ {
// We prepend the terminal client element that actually gets serialized with
// the keys of any Server Components which are not serialized. // the keys of any Server Components which are not serialized.
var keyPath = task.keyPath; var keyPath = task.keyPath;
if (key === null) { if (key === null) {
@ -2119,7 +2128,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
if (typeof model === 'object' && model !== null) { if (typeof model === 'object' && model !== null) {
// If we're about to write this into a new task we can assign it an ID early so that // If we're about to write this into a new task we can assign it an ID early so that
// any other references can refer to the value we're about to write. // any other references can refer to the value we're about to write.
if ((keyPath !== null || implicitSlot)) ; else { if (keyPath !== null || implicitSlot) ; else {
request.writtenObjects.set(model, id); request.writtenObjects.set(model, id);
} }
} }
@ -2461,7 +2470,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
var _existingId = _writtenObjects.get(value); var _existingId = _writtenObjects.get(value);
if (_existingId !== undefined) { if (_existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) ; else if (modelRoot === value) { if (task.keyPath !== null || task.implicitSlot) ; else if (modelRoot === value) {
// This is the ID we're currently emitting so we need to write it // This is the ID we're currently emitting so we need to write it
// once but if we discover it again, we refer to it by id. // once but if we discover it again, we refer to it by id.
modelRoot = null; modelRoot = null;
@ -2566,7 +2575,7 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
if (typeof value.then === 'function') { if (typeof value.then === 'function') {
if (existingId !== undefined) { if (existingId !== undefined) {
if ((task.keyPath !== null || task.implicitSlot)) { if (task.keyPath !== null || task.implicitSlot) {
// If we're in some kind of context we can't reuse the result of this render or // If we're in some kind of context we can't reuse the result of this render or
// previous renders of this element. We only reuse Promises if they're not wrapped // previous renders of this element. We only reuse Promises if they're not wrapped
// by another Server Component. // by another Server Component.
@ -3519,7 +3528,6 @@ function requireModule(metadata) {
return moduleExports[metadata.name]; return moduleExports[metadata.name];
} }
// The server acts as a Client of itself when resolving Server References.
var PENDING = 'pending'; var PENDING = 'pending';
var BLOCKED = 'blocked'; var BLOCKED = 'blocked';
var RESOLVED_MODEL = 'resolved_model'; var RESOLVED_MODEL = 'resolved_model';
@ -3618,7 +3626,7 @@ function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
function triggerErrorOnChunk(chunk, error) { function triggerErrorOnChunk(chunk, error) {
if (chunk.status !== PENDING && chunk.status !== BLOCKED) { if (chunk.status !== PENDING && chunk.status !== BLOCKED) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3639,7 +3647,7 @@ function createResolvedModelChunk(response, value) {
function resolveModelChunk(chunk, value) { function resolveModelChunk(chunk, value) {
if (chunk.status !== PENDING) { if (chunk.status !== PENDING) {
// We already resolved. We didn't expect to see this.
return; return;
} }
@ -3687,7 +3695,7 @@ function loadServerReference$1(response, id, bound, parentChunk, parentObject, k
} }
} }
promise.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later. promise.then(createModelResolver(parentChunk, parentObject, key, false, response, createModel), createModelReject(parentChunk)); // We need a placeholder value that will be replaced later.
return null; return null;
} }
@ -3764,21 +3772,30 @@ function getChunk(response, id) {
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
var blocked; var blocked;
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
blocked = initializingChunkBlockedModel; blocked = initializingChunkBlockedModel;
if (!cyclic) {
blocked.deps++; blocked.deps++;
}
} else { } else {
blocked = initializingChunkBlockedModel = { blocked = initializingChunkBlockedModel = {
deps: 1, deps: cyclic ? 0 : 1,
value: null value: null
}; };
} }
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
blocked.value = parentObject[key];
}
blocked.deps--; blocked.deps--;
if (blocked.deps === 0) { if (blocked.deps === 0) {
@ -3804,19 +3821,46 @@ function createModelReject(chunk) {
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
var chunk = getChunk(response, id); var chunk = getChunk(response, id);
if (chunk.status === RESOLVED_MODEL) { switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk); initializeModelChunk(chunk);
} break;
} // The status might have changed after initialization.
if (chunk.status !== INITIALIZED) {
// We know that this is emitted earlier so otherwise it's an error. switch (chunk.status) {
case INITIALIZED:
return map(response, chunk.value);
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, parentObject, key, false, response, map), createModelReject(parentChunk));
return null;
default:
throw chunk.reason; throw chunk.reason;
} }
}
return chunk.value; function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
// $FlowFixMe[incompatible-use]: This uses raw Symbols because we're extracting from a native array.
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
@ -3833,9 +3877,8 @@ function parseModelString(response, obj, key, value) {
// Promise // Promise
var _id = parseInt(value.slice(2), 16); var _id = parseInt(value.slice(2), 16);
var _chunk = getChunk(response, _id); var chunk = getChunk(response, _id);
return chunk;
return _chunk;
} }
case 'F': case 'F':
@ -3844,7 +3887,7 @@ function parseModelString(response, obj, key, value) {
var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model. var _id2 = parseInt(value.slice(2), 16); // TODO: Just encode this in the reference inline instead of as a model.
var metaData = getOutlinedModel(response, _id2); var metaData = getOutlinedModel(response, _id2, obj, key, createModel);
return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key); return loadServerReference$1(response, metaData.id, metaData.bound, initializingChunk, obj, key);
} }
@ -3859,8 +3902,7 @@ function parseModelString(response, obj, key, value) {
// Map // Map
var _id3 = parseInt(value.slice(2), 16); var _id3 = parseInt(value.slice(2), 16);
var data = getOutlinedModel(response, _id3); return getOutlinedModel(response, _id3, obj, key, createMap);
return new Map(data);
} }
case 'W': case 'W':
@ -3868,9 +3910,7 @@ function parseModelString(response, obj, key, value) {
// Set // Set
var _id4 = parseInt(value.slice(2), 16); var _id4 = parseInt(value.slice(2), 16);
var _data = getOutlinedModel(response, _id4); return getOutlinedModel(response, _id4, obj, key, createSet);
return new Set(_data);
} }
case 'K': case 'K':
@ -3878,9 +3918,7 @@ function parseModelString(response, obj, key, value) {
// FormData // FormData
var stringId = value.slice(2); var stringId = value.slice(2);
var formPrefix = response._prefix + stringId + '_'; var formPrefix = response._prefix + stringId + '_';
var data = new FormData();
var _data2 = new FormData();
var backingFormData = response._formData; // We assume that the reference to FormData always comes after each var backingFormData = response._formData; // We assume that the reference to FormData always comes after each
// entry that it references so we can assume they all exist in the // entry that it references so we can assume they all exist in the
// backing store already. // backing store already.
@ -3888,10 +3926,10 @@ function parseModelString(response, obj, key, value) {
backingFormData.forEach(function (entry, entryKey) { backingFormData.forEach(function (entry, entryKey) {
if (entryKey.startsWith(formPrefix)) { if (entryKey.startsWith(formPrefix)) {
_data2.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
} }
}); });
return _data2; return data;
} }
case 'i': case 'i':
@ -3899,9 +3937,7 @@ function parseModelString(response, obj, key, value) {
// Iterator // Iterator
var _id5 = parseInt(value.slice(2), 16); var _id5 = parseInt(value.slice(2), 16);
var _data3 = getOutlinedModel(response, _id5); return getOutlinedModel(response, _id5, obj, key, extractIterator);
return _data3[Symbol.iterator]();
} }
case 'I': case 'I':
@ -3948,28 +3984,7 @@ function parseModelString(response, obj, key, value) {
var id = parseInt(value.slice(1), 16); var id = parseInt(value.slice(1), 16);
var chunk = getChunk(response, id); return getOutlinedModel(response, id, obj, key, createModel);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
return chunk.value;
case PENDING:
case BLOCKED:
var parentChunk = initializingChunk;
chunk.then(createModelResolver(parentChunk, obj, key), createModelReject(parentChunk));
return null;
default:
throw chunk.reason;
}
} }
return value; return value;

View file

@ -1641,20 +1641,27 @@ function loadServerReference$1(
key key
) { ) {
var serverReference = resolveServerReference(response._bundlerConfig, id); var serverReference = resolveServerReference(response._bundlerConfig, id);
response = preloadModule(serverReference); id = preloadModule(serverReference);
if (bound) if (bound)
bound = Promise.all([bound, response]).then(function (_ref) { bound = Promise.all([bound, id]).then(function (_ref) {
_ref = _ref[0]; _ref = _ref[0];
var fn = requireModule(serverReference); var fn = requireModule(serverReference);
return fn.bind.apply(fn, [null].concat(_ref)); return fn.bind.apply(fn, [null].concat(_ref));
}); });
else if (response) else if (id)
bound = Promise.resolve(response).then(function () { bound = Promise.resolve(id).then(function () {
return requireModule(serverReference); return requireModule(serverReference);
}); });
else return requireModule(serverReference); else return requireModule(serverReference);
bound.then( bound.then(
createModelResolver(parentChunk, parentObject, key), createModelResolver(
parentChunk,
parentObject,
key,
!1,
response,
createModel
),
createModelReject(parentChunk) createModelReject(parentChunk)
); );
return null; return null;
@ -1699,13 +1706,18 @@ function getChunk(response, id) {
chunks.set(id, chunk)); chunks.set(id, chunk));
return chunk; return chunk;
} }
function createModelResolver(chunk, parentObject, key) { function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
if (initializingChunkBlockedModel) { if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel; var blocked = initializingChunkBlockedModel;
blocked.deps++; cyclic || blocked.deps++;
} else blocked = initializingChunkBlockedModel = { deps: 1, value: null }; } else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
};
return function (value) { return function (value) {
parentObject[key] = value; parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--; blocked.deps--;
0 === blocked.deps && 0 === blocked.deps &&
"blocked" === chunk.status && "blocked" === chunk.status &&
@ -1720,11 +1732,38 @@ function createModelReject(chunk) {
return triggerErrorOnChunk(chunk, error); return triggerErrorOnChunk(chunk, error);
}; };
} }
function getOutlinedModel(response, id) { function getOutlinedModel(response, id, parentObject, key, map) {
response = getChunk(response, id); id = getChunk(response, id);
"resolved_model" === response.status && initializeModelChunk(response); switch (id.status) {
if ("fulfilled" !== response.status) throw response.reason; case "resolved_model":
return response.value; initializeModelChunk(id);
}
switch (id.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
var parentChunk = initializingChunk;
id.then(
createModelResolver(parentChunk, parentObject, key, !1, response, map),
createModelReject(parentChunk)
);
return null;
default:
throw id.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function extractIterator(response, model) {
return model[Symbol.iterator]();
}
function createModel(response, model) {
return model;
} }
function parseModelString(response, obj, key, value) { function parseModelString(response, obj, key, value) {
if ("$" === value[0]) { if ("$" === value[0]) {
@ -1736,7 +1775,7 @@ function parseModelString(response, obj, key, value) {
case "F": case "F":
return ( return (
(value = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(value = getOutlinedModel(response, value)), (value = getOutlinedModel(response, value, obj, key, createModel)),
loadServerReference$1( loadServerReference$1(
response, response,
value.id, value.id,
@ -1750,29 +1789,27 @@ function parseModelString(response, obj, key, value) {
return createTemporaryReference(value.slice(2)); return createTemporaryReference(value.slice(2));
case "Q": case "Q":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createMap)
new Map(response)
); );
case "W": case "W":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, obj)), getOutlinedModel(response, value, obj, key, createSet)
new Set(response)
); );
case "K": case "K":
obj = value.slice(2); obj = value.slice(2);
var formPrefix = response._prefix + obj + "_", var formPrefix = response._prefix + obj + "_",
data$23 = new FormData(); data = new FormData();
response._formData.forEach(function (entry, entryKey) { response._formData.forEach(function (entry, entryKey) {
entryKey.startsWith(formPrefix) && entryKey.startsWith(formPrefix) &&
data$23.append(entryKey.slice(formPrefix.length), entry); data.append(entryKey.slice(formPrefix.length), entry);
}); });
return data$23; return data;
case "i": case "i":
return ( return (
(obj = parseInt(value.slice(2), 16)), (value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, obj)[Symbol.iterator]() getOutlinedModel(response, value, obj, key, extractIterator)
); );
case "I": case "I":
return Infinity; return Infinity;
@ -1788,27 +1825,7 @@ function parseModelString(response, obj, key, value) {
return BigInt(value.slice(2)); return BigInt(value.slice(2));
} }
value = parseInt(value.slice(1), 16); value = parseInt(value.slice(1), 16);
response = getChunk(response, value); return getOutlinedModel(response, value, obj, key, createModel);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
return (
(value = initializingChunk),
response.then(
createModelResolver(value, obj, key),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
} }
return value; return value;
} }
@ -1965,12 +1982,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap) {
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
); );
pendingFiles++; pendingFiles++;
var JSCompiler_object_inline_chunks_209 = []; var JSCompiler_object_inline_chunks_205 = [];
value.on("data", function (chunk) { value.on("data", function (chunk) {
JSCompiler_object_inline_chunks_209.push(chunk); JSCompiler_object_inline_chunks_205.push(chunk);
}); });
value.on("end", function () { value.on("end", function () {
var blob = new Blob(JSCompiler_object_inline_chunks_209, { var blob = new Blob(JSCompiler_object_inline_chunks_205, {
type: mimeType type: mimeType
}); });
response._formData.append(name, blob, filename); response._formData.append(name, blob, filename);

View file

@ -46,8 +46,8 @@
"neo-async": "^2.6.1" "neo-async": "^2.6.1"
}, },
"peerDependencies": { "peerDependencies": {
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430", "react-dom": "19.0.0-beta-04b058868c-20240508",
"webpack": "^5.59.0" "webpack": "^5.59.0"
} }
} }

View file

@ -12,10 +12,7 @@
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {
(function() { (function() {
'use strict';
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
@ -23,7 +20,7 @@ if (
) { ) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
} }
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -2804,7 +2801,6 @@ exports.useState = useState;
exports.useSyncExternalStore = useSyncExternalStore; exports.useSyncExternalStore = useSyncExternalStore;
exports.useTransition = useTransition; exports.useTransition = useTransition;
exports.version = ReactVersion; exports.version = ReactVersion;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if ( if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===

View file

@ -536,4 +536,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () { exports.useTransition = function () {
return ReactSharedInternals.H.useTransition(); return ReactSharedInternals.H.useTransition();
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -2158,7 +2158,7 @@ function warnAboutTransitionSubscriptions(prevTransition, currentTransition) {
function noop() {} function noop() {}
var ReactVersion = '19.0.0-beta-4508873393-20240430'; var ReactVersion = '19.0.0-beta-04b058868c-20240508';
var Children = { var Children = {
map: mapChildren, map: mapChildren,

View file

@ -476,4 +476,4 @@ exports.useId = function () {
exports.useMemo = function (create, deps) { exports.useMemo = function (create, deps) {
return ReactSharedInternals.H.useMemo(create, deps); return ReactSharedInternals.H.useMemo(create, deps);
}; };
exports.version = "19.0.0-beta-4508873393-20240430"; exports.version = "19.0.0-beta-04b058868c-20240508";

View file

@ -1 +1 @@
(()=>{var t={444:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a<i.length;a++)i[a]===t?t=null:_.push(i[a]);i=_}function e(_,a,f){t=a?_:n(n({},t),_);for(var o=i,c=0;c<o.length;c++)o[c](t,f)}return t=t||{},{action:function(i){function r(t){e(t,!1,i)}return function(){for(var _=arguments,a=[t],f=0;f<arguments.length;f++)a.push(_[f]);var o=i.apply(this,a);if(null!=o)return o.then?o.then(r):r(o)}},setState:e,subscribe:function(t){return i.push(t),function(){u(t)}},unsubscribe:u,getState:function(){return t}}}}};var i={};function __nccwpck_require__(_){var a=i[_];if(a!==undefined){return a.exports}var f=i[_]={exports:{}};var o=true;try{t[_](f,f.exports,__nccwpck_require__);o=false}finally{if(o)delete i[_]}return f.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var _=__nccwpck_require__(444);module.exports=_})(); (()=>{var t={7:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a<i.length;a++)i[a]===t?t=null:_.push(i[a]);i=_}function e(_,a,f){t=a?_:n(n({},t),_);for(var o=i,c=0;c<o.length;c++)o[c](t,f)}return t=t||{},{action:function(i){function r(t){e(t,!1,i)}return function(){for(var _=arguments,a=[t],f=0;f<arguments.length;f++)a.push(_[f]);var o=i.apply(this,a);if(null!=o)return o.then?o.then(r):r(o)}},setState:e,subscribe:function(t){return i.push(t),function(){u(t)}},unsubscribe:u,getState:function(){return t}}}}};var i={};function __nccwpck_require__(_){var a=i[_];if(a!==undefined){return a.exports}var f=i[_]={exports:{}};var o=true;try{t[_](f,f.exports,__nccwpck_require__);o=false}finally{if(o)delete i[_]}return f.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var _=__nccwpck_require__(7);module.exports=_})();

View file

@ -15,9 +15,9 @@ overrides:
'@babel/traverse': 7.22.5 '@babel/traverse': 7.22.5
'@types/react': 18.2.74 '@types/react': 18.2.74
'@types/react-dom': 18.2.23 '@types/react-dom': 18.2.23
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
scheduler: 0.25.0-beta-94eed63c49-20240425 scheduler: 0.25.0-beta-94eed63c49-20240425
importers: importers:
@ -56,7 +56,7 @@ importers:
version: 11.11.0 version: 11.11.0
'@emotion/react': '@emotion/react':
specifier: 11.11.1 specifier: 11.11.1
version: 11.11.1(@types/react@18.2.74)(react@19.0.0-beta-4508873393-20240430) version: 11.11.1(@types/react@18.2.74)(react@19.0.0-beta-04b058868c-20240508)
'@fullhuman/postcss-purgecss': '@fullhuman/postcss-purgecss':
specifier: 1.3.0 specifier: 1.3.0
version: 1.3.0 version: 1.3.0
@ -65,7 +65,7 @@ importers:
version: 2.2.1(webpack@5.90.0) version: 2.2.1(webpack@5.90.0)
'@mdx-js/react': '@mdx-js/react':
specifier: 2.2.1 specifier: 2.2.1
version: 2.2.1(react@19.0.0-beta-4508873393-20240430) version: 2.2.1(react@19.0.0-beta-04b058868c-20240508)
'@next/bundle-analyzer': '@next/bundle-analyzer':
specifier: workspace:* specifier: workspace:*
version: link:packages/next-bundle-analyzer version: link:packages/next-bundle-analyzer
@ -131,7 +131,7 @@ importers:
version: 6.1.2(@types/jest@29.5.5)(jest@29.7.0) version: 6.1.2(@types/jest@29.5.5)(jest@29.7.0)
'@testing-library/react': '@testing-library/react':
specifier: ^15.0.5 specifier: ^15.0.5
version: 15.0.7(@types/react@18.2.74)(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430) version: 15.0.7(@types/react@18.2.74)(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)
'@types/busboy': '@types/busboy':
specifier: 1.5.3 specifier: 1.5.3
version: 1.5.3 version: 1.5.3
@ -204,6 +204,9 @@ importers:
async-sema: async-sema:
specifier: 3.0.1 specifier: 3.0.1
version: 3.0.1 version: 3.0.1
babel-plugin-react-compiler:
specifier: 0.0.0-experimental-c23de8d-20240515
version: 0.0.0-experimental-c23de8d-20240515
browserslist: browserslist:
specifier: 4.22.2 specifier: 4.22.2
version: 4.22.2 version: 4.22.2
@ -433,47 +436,47 @@ importers:
specifier: 0.3.0 specifier: 0.3.0
version: 0.3.0 version: 0.3.0
react: react:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430 version: 19.0.0-beta-04b058868c-20240508
react-17: react-17:
specifier: npm:react@17.0.2 specifier: npm:react@17.0.2
version: /react@17.0.2 version: /react@17.0.2
react-builtin: react-builtin:
specifier: npm:react@19.0.0-beta-4508873393-20240430 specifier: npm:react@19.0.0-beta-04b058868c-20240508
version: /react@19.0.0-beta-4508873393-20240430 version: /react@19.0.0-beta-04b058868c-20240508
react-dom: react-dom:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) version: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
react-dom-17: react-dom-17:
specifier: npm:react-dom@17.0.2 specifier: npm:react-dom@17.0.2
version: /react-dom@17.0.2(react@19.0.0-beta-4508873393-20240430) version: /react-dom@17.0.2(react@19.0.0-beta-04b058868c-20240508)
react-dom-builtin: react-dom-builtin:
specifier: npm:react-dom@19.0.0-beta-4508873393-20240430 specifier: npm:react-dom@19.0.0-beta-04b058868c-20240508
version: /react-dom@19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) version: /react-dom@19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
react-dom-experimental-builtin: react-dom-experimental-builtin:
specifier: npm:react-dom@0.0.0-experimental-4508873393-20240430 specifier: npm:react-dom@0.0.0-experimental-4508873393-20240430
version: /react-dom@0.0.0-experimental-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) version: /react-dom@0.0.0-experimental-4508873393-20240430(react@19.0.0-beta-04b058868c-20240508)
react-experimental-builtin: react-experimental-builtin:
specifier: npm:react@0.0.0-experimental-4508873393-20240430 specifier: npm:react@0.0.0-experimental-4508873393-20240430
version: /react@0.0.0-experimental-4508873393-20240430 version: /react@0.0.0-experimental-4508873393-20240430
react-server-dom-turbopack: react-server-dom-turbopack:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430) version: 19.0.0-beta-04b058868c-20240508(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)
react-server-dom-turbopack-experimental: react-server-dom-turbopack-experimental:
specifier: npm:react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430 specifier: npm:react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430
version: /react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430) version: /react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)
react-server-dom-webpack: react-server-dom-webpack:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430)(webpack@5.90.0) version: 19.0.0-beta-04b058868c-20240508(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)(webpack@5.90.0)
react-server-dom-webpack-experimental: react-server-dom-webpack-experimental:
specifier: npm:react-server-dom-webpack@0.0.0-experimental-4508873393-20240430 specifier: npm:react-server-dom-webpack@0.0.0-experimental-4508873393-20240430
version: /react-server-dom-webpack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430)(webpack@5.90.0) version: /react-server-dom-webpack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)(webpack@5.90.0)
react-ssr-prepass: react-ssr-prepass:
specifier: 1.0.8 specifier: 1.0.8
version: 1.0.8(react-is@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430) version: 1.0.8(react-is@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)
react-virtualized: react-virtualized:
specifier: 9.22.3 specifier: 9.22.3
version: 9.22.3(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430) version: 9.22.3(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)
relay-compiler: relay-compiler:
specifier: 13.0.2 specifier: 13.0.2
version: 13.0.2 version: 13.0.2
@ -515,16 +518,16 @@ importers:
version: 6.0.0 version: 6.0.0
styled-components: styled-components:
specifier: 6.0.0-rc.3 specifier: 6.0.0-rc.3
version: 6.0.0-rc.3(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430) version: 6.0.0-rc.3(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)
styled-jsx: styled-jsx:
specifier: 5.1.3 specifier: 5.1.3
version: 5.1.3(@babel/core@7.22.5)(react@19.0.0-beta-4508873393-20240430) version: 5.1.3(@babel/core@7.22.5)(react@19.0.0-beta-04b058868c-20240508)
styled-jsx-plugin-postcss: styled-jsx-plugin-postcss:
specifier: 3.0.2 specifier: 3.0.2
version: 3.0.2 version: 3.0.2
swr: swr:
specifier: ^2.2.4 specifier: ^2.2.4
version: 2.2.4(react@19.0.0-beta-4508873393-20240430) version: 2.2.4(react@19.0.0-beta-04b058868c-20240508)
tailwindcss: tailwindcss:
specifier: 3.2.7 specifier: 3.2.7
version: 3.2.7(postcss@8.4.31) version: 3.2.7(postcss@8.4.31)
@ -792,7 +795,7 @@ importers:
dependencies: dependencies:
next: next:
specifier: 14.3.0-canary.15 specifier: 14.3.0-canary.15
version: 14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430)(sass@1.54.0) version: 14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)(sass@1.54.0)
devDependencies: devDependencies:
'@types/fontkit': '@types/fontkit':
specifier: 2.0.0 specifier: 2.0.0
@ -828,17 +831,17 @@ importers:
specifier: 8.4.31 specifier: 8.4.31
version: 8.4.31 version: 8.4.31
react: react:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430 version: 19.0.0-beta-04b058868c-20240508
react-dom: react-dom:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) version: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
sass: sass:
specifier: ^1.3.0 specifier: ^1.3.0
version: 1.54.0 version: 1.54.0
styled-jsx: styled-jsx:
specifier: 5.1.3 specifier: 5.1.3
version: 5.1.3(@babel/core@7.22.5)(react@19.0.0-beta-4508873393-20240430) version: 5.1.3(@babel/core@7.22.5)(react@19.0.0-beta-04b058868c-20240508)
optionalDependencies: optionalDependencies:
sharp: sharp:
specifier: ^0.33.3 specifier: ^0.33.3
@ -1328,8 +1331,8 @@ importers:
specifier: 2.4.1 specifier: 2.4.1
version: 2.4.1 version: 2.4.1
react-is: react-is:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430 version: 19.0.0-beta-04b058868c-20240508
react-refresh: react-refresh:
specifier: 0.12.0 specifier: 0.12.0
version: 0.12.0 version: 0.12.0
@ -1419,7 +1422,7 @@ importers:
version: 1.0.35 version: 1.0.35
unistore: unistore:
specifier: 3.4.1 specifier: 3.4.1
version: 3.4.1(react@19.0.0-beta-4508873393-20240430) version: 3.4.1(react@19.0.0-beta-04b058868c-20240508)
util: util:
specifier: 0.12.4 specifier: 0.12.4
version: 0.12.4 version: 0.12.4
@ -1507,7 +1510,7 @@ importers:
version: 2.2.1(webpack@5.90.0) version: 2.2.1(webpack@5.90.0)
'@mdx-js/react': '@mdx-js/react':
specifier: '>=0.15.0' specifier: '>=0.15.0'
version: 2.2.1(react@19.0.0-beta-4508873393-20240430) version: 2.2.1(react@19.0.0-beta-04b058868c-20240508)
source-map: source-map:
specifier: ^0.7.0 specifier: ^0.7.0
version: 0.7.3 version: 0.7.3
@ -1558,8 +1561,8 @@ importers:
packages/third-parties: packages/third-parties:
dependencies: dependencies:
react: react:
specifier: 19.0.0-beta-4508873393-20240430 specifier: 19.0.0-beta-04b058868c-20240508
version: 19.0.0-beta-4508873393-20240430 version: 19.0.0-beta-04b058868c-20240508
third-party-capital: third-party-capital:
specifier: 1.0.20 specifier: 1.0.20
version: 1.0.20 version: 1.0.20
@ -1767,7 +1770,6 @@ packages:
lodash: 4.17.20 lodash: 4.17.20
source-map: 0.5.7 source-map: 0.5.7
trim-right: 1.0.1 trim-right: 1.0.1
dev: false
/@babel/generator@7.22.5: /@babel/generator@7.22.5:
resolution: {integrity: sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==} resolution: {integrity: sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==}
@ -3640,11 +3642,11 @@ packages:
resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==}
dev: true dev: true
/@emotion/react@11.11.1(@types/react@18.2.74)(react@19.0.0-beta-4508873393-20240430): /@emotion/react@11.11.1(@types/react@18.2.74)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==}
peerDependencies: peerDependencies:
'@types/react': '*' '@types/react': '*'
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
peerDependenciesMeta: peerDependenciesMeta:
'@types/react': '@types/react':
optional: true optional: true
@ -3653,12 +3655,12 @@ packages:
'@emotion/babel-plugin': 11.11.0 '@emotion/babel-plugin': 11.11.0
'@emotion/cache': 11.11.0 '@emotion/cache': 11.11.0
'@emotion/serialize': 1.1.2 '@emotion/serialize': 1.1.2
'@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-beta-4508873393-20240430) '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-beta-04b058868c-20240508)
'@emotion/utils': 1.2.1 '@emotion/utils': 1.2.1
'@emotion/weak-memoize': 0.3.1 '@emotion/weak-memoize': 0.3.1
'@types/react': 18.2.74 '@types/react': 18.2.74
hoist-non-react-statics: 3.3.2 hoist-non-react-statics: 3.3.2
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/@emotion/serialize@1.1.2: /@emotion/serialize@1.1.2:
@ -3679,12 +3681,12 @@ packages:
resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==}
dev: true dev: true
/@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-beta-4508873393-20240430): /@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/@emotion/utils@1.2.1: /@emotion/utils@1.2.1:
@ -4697,7 +4699,6 @@ packages:
'@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-lib-coverage': 2.0.4
'@types/istanbul-reports': 1.1.2 '@types/istanbul-reports': 1.1.2
'@types/yargs': 13.0.12 '@types/yargs': 13.0.12
dev: false
/@jest/types@27.5.1: /@jest/types@27.5.1:
resolution: {integrity: sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==} resolution: {integrity: sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==}
@ -5529,14 +5530,14 @@ packages:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
/@mdx-js/react@2.2.1(react@19.0.0-beta-4508873393-20240430): /@mdx-js/react@2.2.1(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-YdXcMcEnqZhzql98RNrqYo9cEhTTesBiCclEtoiQUbJwx87q9453GTapYU6kJ8ZZ2ek1Vp25SiAXEFy5O/eAPw==} resolution: {integrity: sha512-YdXcMcEnqZhzql98RNrqYo9cEhTTesBiCclEtoiQUbJwx87q9453GTapYU6kJ8ZZ2ek1Vp25SiAXEFy5O/eAPw==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
'@types/mdx': 2.0.3 '@types/mdx': 2.0.3
'@types/react': 18.2.74 '@types/react': 18.2.74
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
/@mswjs/cookies@0.2.2: /@mswjs/cookies@0.2.2:
resolution: {integrity: sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==} resolution: {integrity: sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==}
@ -6904,13 +6905,13 @@ packages:
redent: 3.0.0 redent: 3.0.0
dev: true dev: true
/@testing-library/react@15.0.7(@types/react@18.2.74)(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430): /@testing-library/react@15.0.7(@types/react@18.2.74)(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==} resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==}
engines: {node: '>=18'} engines: {node: '>=18'}
peerDependencies: peerDependencies:
'@types/react': 18.2.74 '@types/react': 18.2.74
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
peerDependenciesMeta: peerDependenciesMeta:
'@types/react': '@types/react':
optional: true optional: true
@ -6919,8 +6920,8 @@ packages:
'@testing-library/dom': 10.1.0 '@testing-library/dom': 10.1.0
'@types/react': 18.2.74 '@types/react': 18.2.74
'@types/react-dom': 18.2.23 '@types/react-dom': 18.2.23
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
dev: true dev: true
/@tootallnate/once@1.1.2: /@tootallnate/once@1.1.2:
@ -7208,7 +7209,6 @@ packages:
dependencies: dependencies:
'@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-lib-coverage': 2.0.4
'@types/istanbul-lib-report': 3.0.0 '@types/istanbul-lib-report': 3.0.0
dev: false
/@types/istanbul-reports@3.0.0: /@types/istanbul-reports@3.0.0:
resolution: {integrity: sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==} resolution: {integrity: sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==}
@ -7528,7 +7528,6 @@ packages:
resolution: {integrity: sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==} resolution: {integrity: sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==}
dependencies: dependencies:
'@types/yargs-parser': 21.0.0 '@types/yargs-parser': 21.0.0
dev: false
/@types/yargs@16.0.9: /@types/yargs@16.0.9:
resolution: {integrity: sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==} resolution: {integrity: sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==}
@ -8853,7 +8852,6 @@ packages:
pretty-format: 24.9.0 pretty-format: 24.9.0
zod: 3.23.8 zod: 3.23.8
zod-validation-error: 2.1.0(zod@3.23.8) zod-validation-error: 2.1.0(zod@3.23.8)
dev: false
/babel-plugin-transform-async-to-promises@0.8.15: /babel-plugin-transform-async-to-promises@0.8.15:
resolution: {integrity: sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ==} resolution: {integrity: sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ==}
@ -14083,7 +14081,7 @@ packages:
/hoist-non-react-statics@3.3.2: /hoist-non-react-statics@3.3.2:
resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}
dependencies: dependencies:
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/homedir-polyfill@1.0.3: /homedir-polyfill@1.0.3:
@ -18280,15 +18278,15 @@ packages:
resolution: {integrity: sha1-yobR/ogoFpsBICCOPchCS524NCw=} resolution: {integrity: sha1-yobR/ogoFpsBICCOPchCS524NCw=}
dev: true dev: true
/next@14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430)(sass@1.54.0): /next@14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)(sass@1.54.0):
resolution: {integrity: sha512-vQ376NxcS/zYLJKIZRRfyis9nK+Y23KUqD8Hg93kbrgVWhJW0fZIcKf14ATm8AZg2uxDt4/vj7gVOt1QrWtMIQ==} resolution: {integrity: sha512-vQ376NxcS/zYLJKIZRRfyis9nK+Y23KUqD8Hg93kbrgVWhJW0fZIcKf14ATm8AZg2uxDt4/vj7gVOt1QrWtMIQ==}
engines: {node: '>=18.17.0'} engines: {node: '>=18.17.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
'@opentelemetry/api': ^1.1.0 '@opentelemetry/api': ^1.1.0
'@playwright/test': ^1.41.2 '@playwright/test': ^1.41.2
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
sass: ^1.3.0 sass: ^1.3.0
peerDependenciesMeta: peerDependenciesMeta:
'@opentelemetry/api': '@opentelemetry/api':
@ -18306,10 +18304,10 @@ packages:
caniuse-lite: 1.0.30001579 caniuse-lite: 1.0.30001579
graceful-fs: 4.2.11 graceful-fs: 4.2.11
postcss: 8.4.31 postcss: 8.4.31
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
sass: 1.54.0 sass: 1.54.0
styled-jsx: 5.1.1(@babel/core@7.22.5)(react@19.0.0-beta-4508873393-20240430) styled-jsx: 5.1.1(@babel/core@7.22.5)(react@19.0.0-beta-04b058868c-20240508)
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 14.3.0-canary.15 '@next/swc-darwin-arm64': 14.3.0-canary.15
'@next/swc-darwin-x64': 14.3.0-canary.15 '@next/swc-darwin-x64': 14.3.0-canary.15
@ -20921,8 +20919,7 @@ packages:
'@jest/types': 24.9.0 '@jest/types': 24.9.0
ansi-regex: 4.1.0 ansi-regex: 4.1.0
ansi-styles: 3.2.1 ansi-styles: 3.2.1
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
dev: false
/pretty-format@27.5.1: /pretty-format@27.5.1:
resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
@ -20930,7 +20927,7 @@ packages:
dependencies: dependencies:
ansi-regex: 5.0.1 ansi-regex: 5.0.1
ansi-styles: 5.2.0 ansi-styles: 5.2.0
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
/pretty-format@29.5.0: /pretty-format@29.5.0:
resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==}
@ -20938,7 +20935,7 @@ packages:
dependencies: dependencies:
'@jest/schemas': 29.4.3 '@jest/schemas': 29.4.3
ansi-styles: 5.2.0 ansi-styles: 5.2.0
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/pretty-format@29.7.0: /pretty-format@29.7.0:
@ -20947,7 +20944,7 @@ packages:
dependencies: dependencies:
'@jest/schemas': 29.6.3 '@jest/schemas': 29.6.3
ansi-styles: 5.2.0 ansi-styles: 5.2.0
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/pretty-ms@7.0.0: /pretty-ms@7.0.0:
@ -21049,7 +21046,7 @@ packages:
dependencies: dependencies:
loose-envify: 1.4.0 loose-envify: 1.4.0
object-assign: 4.1.1 object-assign: 4.1.1
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
/proper-lockfile@4.1.2: /proper-lockfile@4.1.2:
resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==}
@ -21329,36 +21326,36 @@ packages:
strip-json-comments: 2.0.1 strip-json-comments: 2.0.1
dev: true dev: true
/react-dom@0.0.0-experimental-4508873393-20240430(react@19.0.0-beta-4508873393-20240430): /react-dom@0.0.0-experimental-4508873393-20240430(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-xmoRPU8s6sFJmhNhfUTSVztr/ExqJpYBI1NSVr/aQffKAfdriTdRT/iOxxCkPjD9a6eV4kjMagcw29Mt27aybA==} resolution: {integrity: sha512-xmoRPU8s6sFJmhNhfUTSVztr/ExqJpYBI1NSVr/aQffKAfdriTdRT/iOxxCkPjD9a6eV4kjMagcw29Mt27aybA==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
scheduler: 0.25.0-beta-94eed63c49-20240425 scheduler: 0.25.0-beta-94eed63c49-20240425
dev: true dev: true
/react-dom@17.0.2(react@19.0.0-beta-4508873393-20240430): /react-dom@17.0.2(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==} resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
loose-envify: 1.4.0 loose-envify: 1.4.0
object-assign: 4.1.1 object-assign: 4.1.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
scheduler: 0.25.0-beta-94eed63c49-20240425 scheduler: 0.25.0-beta-94eed63c49-20240425
dev: true dev: true
/react-dom@19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430): /react-dom@19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-/j97ai1qF3c6O3XV0nVzzExPV/0U2v8M75Sq6ThXYxePCi33kAnm+xRsCDpZOZOrIjz6nurLU/FzzPZIzXVvKQ==} resolution: {integrity: sha512-g8DrqbkLi8ok/0GyVVJky30d5b+WXpIi4baKD+ySsMRzQJlwQHywGh/V+osSMCYmnApq1OYSWPuvOBvrVmhz5Q==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
scheduler: 0.25.0-beta-94eed63c49-20240425 scheduler: 0.25.0-beta-94eed63c49-20240425
/react-is@19.0.0-beta-4508873393-20240430: /react-is@19.0.0-beta-04b058868c-20240508:
resolution: {integrity: sha512-DB++EnCyaX+He8vWuwSvOHvZQHWvFDNT4UlYfnSoG+dZAFLlZeLd2iF2I1G1vR/ahBsNJDWmyZOUXheqJRLT/w==} resolution: {integrity: sha512-fn/t9y3/gURwRREkXGoFgvkSWngyHqN2bKg74rNNGtwsFeYqfquqxGHeE1u1Y1lddYupmltCkJR15Eh9RKUTFw==}
/react-lifecycles-compat@3.0.4: /react-lifecycles-compat@3.0.4:
resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==} resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==}
@ -21369,86 +21366,86 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: true dev: true
/react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430): /react-server-dom-turbopack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-+TcuMDyyfB2n4axpYzowXnUBYjO4uAjfIeAKVet7qwwWiRRnMOJYACIQDdK3FKYge8CZ5bF3dqZerhbzxc3HrA==} resolution: {integrity: sha512-+TcuMDyyfB2n4axpYzowXnUBYjO4uAjfIeAKVet7qwwWiRRnMOJYACIQDdK3FKYge8CZ5bF3dqZerhbzxc3HrA==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
acorn-loose: 8.3.0 acorn-loose: 8.3.0
neo-async: 2.6.1 neo-async: 2.6.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
dev: true dev: true
/react-server-dom-turbopack@19.0.0-beta-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430): /react-server-dom-turbopack@19.0.0-beta-04b058868c-20240508(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-KD/trFERuBtZLRnWaZda+gg5eq5T3GmhO3rEFenFOLnXttey+5OAh6wXHayg44YEAJ2zz8W/Y6Dh5NSqTvqa+A==} resolution: {integrity: sha512-5fc5/BhspeWEwoSDCxvwUCK3MKMSbVDJeHdSYk4FfLFL3uAlUVTYxcFBVbOMaGdRWIKjj0/arI0nL4ZEUV/1ig==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
acorn-loose: 8.3.0 acorn-loose: 8.3.0
neo-async: 2.6.1 neo-async: 2.6.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
dev: true dev: true
/react-server-dom-webpack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430)(webpack@5.90.0): /react-server-dom-webpack@0.0.0-experimental-4508873393-20240430(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)(webpack@5.90.0):
resolution: {integrity: sha512-RaJGhlOUnHnnOHhN2swOD6DeCNlh/KPPlHRoG7QnkKRjP593tSS68CrP9nnPGvuqZvFSVUP2NpuvOYMJSH+93w==} resolution: {integrity: sha512-RaJGhlOUnHnnOHhN2swOD6DeCNlh/KPPlHRoG7QnkKRjP593tSS68CrP9nnPGvuqZvFSVUP2NpuvOYMJSH+93w==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
webpack: 5.90.0 webpack: 5.90.0
dependencies: dependencies:
acorn-loose: 8.3.0 acorn-loose: 8.3.0
neo-async: 2.6.1 neo-async: 2.6.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
webpack: 5.90.0(@swc/core@1.5.7) webpack: 5.90.0(@swc/core@1.5.7)
dev: true dev: true
/react-server-dom-webpack@19.0.0-beta-4508873393-20240430(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430)(webpack@5.90.0): /react-server-dom-webpack@19.0.0-beta-04b058868c-20240508(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508)(webpack@5.90.0):
resolution: {integrity: sha512-/rRIMqNoeReqyioWwfLyqu/qUfZ39YLXOfkhLrXOStzG2g7Q2a5DoLD0eZOcCIpvpWg+/QRw1xOGZLm75mK+Aw==} resolution: {integrity: sha512-xamieQ8brN2RDSSIRDXi7trDvzC0z3u62WmIuftzQ613VX/PxsDw/xj0WBfLFi/NYdypIY8BuCsiw2NbhiOEKQ==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
webpack: 5.90.0 webpack: 5.90.0
dependencies: dependencies:
acorn-loose: 8.3.0 acorn-loose: 8.3.0
neo-async: 2.6.1 neo-async: 2.6.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
webpack: 5.90.0(@swc/core@1.5.7) webpack: 5.90.0(@swc/core@1.5.7)
dev: true dev: true
/react-ssr-prepass@1.0.8(react-is@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430): /react-ssr-prepass@1.0.8(react-is@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
object-is: 1.0.2 object-is: 1.0.2
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-is: 19.0.0-beta-4508873393-20240430 react-is: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/react-virtualized@9.22.3(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430): /react-virtualized@9.22.3(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
'@babel/runtime': 7.22.5 '@babel/runtime': 7.22.5
clsx: 1.1.1 clsx: 1.1.1
dom-helpers: 5.2.1 dom-helpers: 5.2.1
loose-envify: 1.4.0 loose-envify: 1.4.0
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
react-lifecycles-compat: 3.0.4 react-lifecycles-compat: 3.0.4
dev: true dev: true
@ -21465,8 +21462,8 @@ packages:
object-assign: 4.1.1 object-assign: 4.1.1
dev: true dev: true
/react@19.0.0-beta-4508873393-20240430: /react@19.0.0-beta-04b058868c-20240508:
resolution: {integrity: sha512-//89udV7fhVq5pEzpNH7vlpmS5D4wDbPn0oif+G7vwDsuSks5yJGdqrE1uzn2CyFNL73FjV3/R3Pjyaxs+xnvg==} resolution: {integrity: sha512-Mch4EeDejk1ZgH/O3TIH6KtELBUzcJdTZujQGWFA6tz9Y9J+X7ZgY9WS2VhUCS/alOlEcIdCXAz0Cb/JET1QVg==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
/read-cache@1.0.0: /read-cache@1.0.0:
@ -23475,13 +23472,13 @@ packages:
dependencies: dependencies:
inline-style-parser: 0.1.1 inline-style-parser: 0.1.1
/styled-components@6.0.0-rc.3(react-dom@19.0.0-beta-4508873393-20240430)(react@19.0.0-beta-4508873393-20240430): /styled-components@6.0.0-rc.3(react-dom@19.0.0-beta-04b058868c-20240508)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-5FbCTxynopck99GRwM5Ey0+VRp8pkQq69TwGOJJeYtR7gPvwGjNx8yBPLN7/dfxwwvn9ymOZYB19eQkv2k70wQ==} resolution: {integrity: sha512-5FbCTxynopck99GRwM5Ey0+VRp8pkQq69TwGOJJeYtR7gPvwGjNx8yBPLN7/dfxwwvn9ymOZYB19eQkv2k70wQ==}
engines: {node: '>= 16'} engines: {node: '>= 16'}
peerDependencies: peerDependencies:
babel-plugin-styled-components: '>= 2' babel-plugin-styled-components: '>= 2'
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430 react-dom: 19.0.0-beta-04b058868c-20240508
peerDependenciesMeta: peerDependenciesMeta:
babel-plugin-styled-components: babel-plugin-styled-components:
optional: true optional: true
@ -23499,8 +23496,8 @@ packages:
'@emotion/unitless': 0.8.1 '@emotion/unitless': 0.8.1
css-to-react-native: 3.2.0 css-to-react-native: 3.2.0
postcss: 8.4.31 postcss: 8.4.31
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-4508873393-20240430(react@19.0.0-beta-4508873393-20240430) react-dom: 19.0.0-beta-04b058868c-20240508(react@19.0.0-beta-04b058868c-20240508)
shallowequal: 1.1.0 shallowequal: 1.1.0
stylis: 4.2.0 stylis: 4.2.0
tslib: 2.5.3 tslib: 2.5.3
@ -23515,13 +23512,13 @@ packages:
postcss-load-plugins: 2.3.0 postcss-load-plugins: 2.3.0
dev: true dev: true
/styled-jsx@5.1.1(@babel/core@7.22.5)(react@19.0.0-beta-4508873393-20240430): /styled-jsx@5.1.1(@babel/core@7.22.5)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}
engines: {node: '>= 12.0.0'} engines: {node: '>= 12.0.0'}
peerDependencies: peerDependencies:
'@babel/core': '*' '@babel/core': '*'
babel-plugin-macros: '*' babel-plugin-macros: '*'
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
peerDependenciesMeta: peerDependenciesMeta:
'@babel/core': '@babel/core':
optional: true optional: true
@ -23530,16 +23527,16 @@ packages:
dependencies: dependencies:
'@babel/core': 7.22.5 '@babel/core': 7.22.5
client-only: 0.0.1 client-only: 0.0.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dev: false dev: false
/styled-jsx@5.1.3(@babel/core@7.22.5)(react@19.0.0-beta-4508873393-20240430): /styled-jsx@5.1.3(@babel/core@7.22.5)(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-qLRShOWTE/Mf6Bvl72kFeKBl8N2Eq9WIFfoAuvbtP/6tqlnj1SCjv117n2MIjOPpa1jTorYqLJgsHKy5Y3ziww==} resolution: {integrity: sha512-qLRShOWTE/Mf6Bvl72kFeKBl8N2Eq9WIFfoAuvbtP/6tqlnj1SCjv117n2MIjOPpa1jTorYqLJgsHKy5Y3ziww==}
engines: {node: '>= 12.0.0'} engines: {node: '>= 12.0.0'}
peerDependencies: peerDependencies:
'@babel/core': '*' '@babel/core': '*'
babel-plugin-macros: '*' babel-plugin-macros: '*'
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
peerDependenciesMeta: peerDependenciesMeta:
'@babel/core': '@babel/core':
optional: true optional: true
@ -23548,7 +23545,7 @@ packages:
dependencies: dependencies:
'@babel/core': 7.22.5 '@babel/core': 7.22.5
client-only: 0.0.1 client-only: 0.0.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
/stylehacks@4.0.3: /stylehacks@4.0.3:
resolution: {integrity: sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==} resolution: {integrity: sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==}
@ -23682,14 +23679,14 @@ packages:
stable: 0.1.8 stable: 0.1.8
dev: true dev: true
/swr@2.2.4(react@19.0.0-beta-4508873393-20240430): /swr@2.2.4(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
client-only: 0.0.1 client-only: 0.0.1
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
use-sync-external-store: 1.2.0(react@19.0.0-beta-4508873393-20240430) use-sync-external-store: 1.2.0(react@19.0.0-beta-04b058868c-20240508)
dev: true dev: true
/symbol-observable@1.0.1: /symbol-observable@1.0.1:
@ -24167,7 +24164,6 @@ packages:
/trim-right@1.0.1: /trim-right@1.0.1:
resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==} resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: false
/trim-trailing-lines@1.1.2: /trim-trailing-lines@1.1.2:
resolution: {integrity: sha512-MUjYItdrqqj2zpcHFTkMa9WAv4JHTI6gnRQGPFLrt5L9a6tRMiDnIqYl8JBvu2d2Tc3lWJKQwlGCp0K8AvCM+Q==} resolution: {integrity: sha512-MUjYItdrqqj2zpcHFTkMa9WAv4JHTI6gnRQGPFLrt5L9a6tRMiDnIqYl8JBvu2d2Tc3lWJKQwlGCp0K8AvCM+Q==}
@ -24768,7 +24764,7 @@ packages:
unist-util-is: 5.2.0 unist-util-is: 5.2.0
unist-util-visit-parents: 5.1.3 unist-util-visit-parents: 5.1.3
/unistore@3.4.1(react@19.0.0-beta-4508873393-20240430): /unistore@3.4.1(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-p2Ej8qqrqcD10Ah0ZUKUU/mhRB8pM4q6gzjxq9kZpgxa8dks7oHT8jDP4CqLhoRof3RXOZLKB9EBV1DTzHiJRw==} resolution: {integrity: sha512-p2Ej8qqrqcD10Ah0ZUKUU/mhRB8pM4q6gzjxq9kZpgxa8dks7oHT8jDP4CqLhoRof3RXOZLKB9EBV1DTzHiJRw==}
peerDependencies: peerDependencies:
preact: '*' preact: '*'
@ -24779,7 +24775,7 @@ packages:
react: react:
optional: true optional: true
dependencies: dependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/universal-github-app-jwt@1.1.1: /universal-github-app-jwt@1.1.1:
@ -24934,12 +24930,12 @@ packages:
engines: {node: '>= 4'} engines: {node: '>= 4'}
dev: true dev: true
/use-sync-external-store@1.2.0(react@19.0.0-beta-4508873393-20240430): /use-sync-external-store@1.2.0(react@19.0.0-beta-04b058868c-20240508):
resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==}
peerDependencies: peerDependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dependencies: dependencies:
react: 19.0.0-beta-4508873393-20240430 react: 19.0.0-beta-04b058868c-20240508
dev: true dev: true
/use@3.1.1: /use@3.1.1:
@ -25775,7 +25771,6 @@ packages:
zod: ^3.18.0 zod: ^3.18.0
dependencies: dependencies:
zod: 3.23.8 zod: 3.23.8
dev: false
/zod@3.22.3: /zod@3.22.3:
resolution: {integrity: sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==} resolution: {integrity: sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==}
@ -25783,7 +25778,6 @@ packages:
/zod@3.23.8: /zod@3.23.8:
resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==}
dev: false
/zwitch@1.0.5: /zwitch@1.0.5:
resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==}

View file

@ -3,9 +3,9 @@
"private": true, "private": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"next": "19.0.0-beta-4508873393-20240430", "next": "19.0.0-beta-04b058868c-20240508",
"react": "19.0.0-beta-4508873393-20240430", "react": "19.0.0-beta-04b058868c-20240508",
"react-dom": "19.0.0-beta-4508873393-20240430" "react-dom": "19.0.0-beta-04b058868c-20240508"
}, },
"engines": { "engines": {
"node": ">=18.17.0", "node": ">=18.17.0",

View file

@ -8,8 +8,8 @@ describe('ReactRefresh app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -9,8 +9,8 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -11,8 +11,8 @@ describe.skip('ReactRefreshLogBox scss app', () => {
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
sass: 'latest', sass: 'latest',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -15,8 +15,8 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -9,8 +9,8 @@ describe.skip('ReactRefreshLogBox app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -7,8 +7,8 @@ describe('ReactRefreshModule app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -12,8 +12,8 @@ describe('ReactRefreshRegression app', () => {
'styled-components': '5.1.0', 'styled-components': '5.1.0',
'@next/mdx': 'canary', '@next/mdx': 'canary',
'@mdx-js/loader': '0.18.0', '@mdx-js/loader': '0.18.0',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -8,8 +8,8 @@ describe('ReactRefreshRequire app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -29,8 +29,8 @@ describe('Error overlay - editor links', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -7,8 +7,8 @@ describe('Error overlay - error message urls', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -9,8 +9,8 @@ describe.each(['default', 'turbo'])('Error recovery app %s', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -11,8 +11,8 @@ describe('Error overlay for hydration errors', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -8,8 +8,8 @@ describe('Error Overlay invalid imports', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
'client-only': 'latest', 'client-only': 'latest',
}, },

View file

@ -8,8 +8,8 @@ describe('Error overlay - RSC build errors', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-build-errors')), files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-build-errors')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -9,8 +9,8 @@ describe('Error Overlay for server components', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -8,8 +8,8 @@ describe('Error overlay for hydration errors', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -28,8 +28,8 @@ describe('Error Overlay for server components compiler errors in pages', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: {}, files: {},
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
skipStart: true, skipStart: true,
}) })

View file

@ -8,8 +8,8 @@ describe('Deprecated @next/font warning', () => {
'pages/index.js': '', 'pages/index.js': '',
}, },
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'@next/font': 'canary', '@next/font': 'canary',
}, },
skipStart: true, skipStart: true,

View file

@ -7,8 +7,8 @@ describe('app-dir action allowed origins', () => {
files: join(__dirname, 'safe-origins'), files: join(__dirname, 'safe-origins'),
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
// An arbitrary & random port. // An arbitrary & random port.

View file

@ -7,8 +7,8 @@ describe('app-dir action disallowed origins', () => {
files: join(__dirname, 'unsafe-origins'), files: join(__dirname, 'unsafe-origins'),
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })

View file

@ -6,8 +6,8 @@ describe('app-dir action handling - next export', () => {
skipStart: true, skipStart: true,
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })

View file

@ -6,8 +6,8 @@ describe('app-dir action useActionState', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })
it('should support submitting form state with JS', async () => { it('should support submitting form state with JS', async () => {

View file

@ -7,9 +7,9 @@ describe('app-dir action progressive enhancement', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
nanoid: 'latest', nanoid: 'latest',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })

View file

@ -11,8 +11,8 @@ describe('app-dir action size limit invalid config', () => {
skipDeployment: true, skipDeployment: true,
skipStart: true, skipStart: true,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })

View file

@ -19,9 +19,9 @@ describe('app-dir action handling', () => {
nextTestSetup({ nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
nanoid: 'latest', nanoid: 'latest',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })

View file

@ -6,8 +6,8 @@ describe('app dir - css with pageextensions', () => {
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
'@picocss/pico': '1.5.7', '@picocss/pico': '1.5.7',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
sass: 'latest', sass: 'latest',
}, },
}) })

View file

@ -7,8 +7,8 @@ describe('app dir - css', () => {
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
'@picocss/pico': '1.5.7', '@picocss/pico': '1.5.7',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
sass: 'latest', sass: 'latest',
'@next/mdx': 'canary', '@next/mdx': 'canary',
}, },

View file

@ -5,8 +5,8 @@ describe('referencing a client component in an app route', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname)), files: new FileRef(path.join(__dirname)),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })

View file

@ -6,8 +6,8 @@ describe('RSC binary serialization', () => {
files: __dirname, files: __dirname,
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })

View file

@ -74,8 +74,8 @@ import stripAnsi from 'strip-ansi'
), ),
}, },
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })
}) })
@ -128,8 +128,8 @@ import stripAnsi from 'strip-ansi'
), ),
}, },
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })
}) })
@ -237,8 +237,8 @@ import stripAnsi from 'strip-ansi'
), ),
}, },
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })

View file

@ -9,8 +9,8 @@ describe('navigation between pages and app dir', () => {
next = await createNext({ next = await createNext({
files: new FileRef(__dirname), files: new FileRef(__dirname),
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
typescript: 'latest', typescript: 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/node': 'latest', '@types/node': 'latest',

View file

@ -4,8 +4,8 @@ describe('redirects and rewrites', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
typescript: 'latest', typescript: 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/node': 'latest', '@types/node': 'latest',

View file

@ -17,8 +17,8 @@ describe('New Link Behavior with <a> child', () => {
}, },
dependencies: { dependencies: {
next: 'latest', next: 'latest',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })
}) })

View file

@ -24,8 +24,8 @@ describe('New Link Behavior with material-ui', () => {
'@mui/material': 'latest', '@mui/material': 'latest',
next: 'latest', next: 'latest',
'prop-types': 'latest', 'prop-types': 'latest',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
// Use minimum peer dep version instead of v9 of eslint to avoid breaking changes // Use minimum peer dep version instead of v9 of eslint to avoid breaking changes
eslint: '8.56.0', eslint: '8.56.0',
'eslint-config-next': 'latest', 'eslint-config-next': 'latest',

View file

@ -21,8 +21,8 @@ describe('New Link Behavior with stitches', () => {
dependencies: { dependencies: {
'@stitches/react': '^1.2.6', '@stitches/react': '^1.2.6',
next: 'latest', next: 'latest',
react: '19.0.0-beta-4508873393-20240430', react: '19.0.0-beta-04b058868c-20240508',
'react-dom': '19.0.0-beta-4508873393-20240430', 'react-dom': '19.0.0-beta-04b058868c-20240508',
}, },
}) })
}) })

Some files were not shown because too many files have changed in this diff Show more