Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use temporary references in Replies #66054

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@
"pretty-bytes": "5.3.0",
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "19.0.0-rc-81c5ff2e04-20240521",
"react": "19.0.0-rc-f994737d14-20240522",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@19.0.0-rc-81c5ff2e04-20240521",
"react-dom": "19.0.0-rc-81c5ff2e04-20240521",
"react-builtin": "npm:react@19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@19.0.0-rc-81c5ff2e04-20240521",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-81c5ff2e04-20240521",
"react-experimental-builtin": "npm:react@0.0.0-experimental-81c5ff2e04-20240521",
"react-server-dom-turbopack": "19.0.0-rc-81c5ff2e04-20240521",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-81c5ff2e04-20240521",
"react-server-dom-webpack": "19.0.0-rc-81c5ff2e04-20240521",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-81c5ff2e04-20240521",
"react-dom-builtin": "npm:react-dom@19.0.0-rc-f994737d14-20240522",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-f994737d14-20240522",
"react-experimental-builtin": "npm:react@0.0.0-experimental-f994737d14-20240522",
"react-server-dom-turbopack": "19.0.0-rc-f994737d14-20240522",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-f994737d14-20240522",
"react-server-dom-webpack": "19.0.0-rc-f994737d14-20240522",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-f994737d14-20240522",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -218,8 +218,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.9",
"scheduler-builtin": "npm:scheduler@0.25.0-rc-81c5ff2e04-20240521",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-81c5ff2e04-20240521",
"scheduler-builtin": "npm:scheduler@0.25.0-rc-f994737d14-20240522",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-f994737d14-20240522",
"seedrandom": "3.0.5",
"semver": "7.3.7",
"shell-quote": "1.7.3",
Expand Down Expand Up @@ -253,10 +253,10 @@
"@babel/traverse": "7.22.5",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.23",
"react": "19.0.0-rc-81c5ff2e04-20240521",
"react-dom": "19.0.0-rc-81c5ff2e04-20240521",
"react-is": "19.0.0-rc-81c5ff2e04-20240521",
"scheduler": "0.25.0-rc-81c5ff2e04-20240521"
"react": "19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522",
"react-is": "19.0.0-rc-f994737d14-20240522",
"scheduler": "0.25.0-rc-f994737d14-20240522"
},
"engines": {
"node": ">=18.17.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-next-app/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export const installTemplate = async ({
* Default dependencies.
*/
dependencies: {
react: "19.0.0-rc-81c5ff2e04-20240521",
"react-dom": "19.0.0-rc-81c5ff2e04-20240521",
react: "19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522",
next: version,
},
devDependencies: {},
Expand Down
4 changes: 2 additions & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
"@opentelemetry/api": "^1.1.0",
"@playwright/test": "^1.41.2",
"babel-plugin-react-compiler": "*",
"react": "19.0.0-rc-81c5ff2e04-20240521",
"react-dom": "19.0.0-rc-81c5ff2e04-20240521",
"react": "19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522",
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
// import { createFromFetch } from 'react-server-dom-webpack/client'
// // eslint-disable-next-line import/no-extraneous-dependencies
// import { encodeReply } from 'react-server-dom-webpack/client'
const { createFromFetch, encodeReply } = (
const { createFromFetch, createTemporaryReferenceSet, encodeReply } = (
!!process.env.NEXT_RUNTIME
? // eslint-disable-next-line import/no-extraneous-dependencies
require('react-server-dom-webpack/client.edge')
Expand Down Expand Up @@ -57,7 +57,10 @@ async function fetchServerAction(
nextUrl: ReadonlyReducerState['nextUrl'],
{ actionId, actionArgs }: ServerActionAction
): Promise<FetchServerActionResult> {
const body = await encodeReply(actionArgs)
const temporaryReferences = createTemporaryReferenceSet()
const body = await encodeReply(actionArgs, {
temporaryReferences: temporaryReferences,
})

const res = await fetch('', {
method: 'POST',
Expand Down Expand Up @@ -114,6 +117,7 @@ async function fetchServerAction(
Promise.resolve(res),
{
callServer,
temporaryReferences,
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29632,6 +29632,7 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(root, parentFiber, isInS

function doubleInvokeEffectsOnFiber(root, fiber) {
var shouldDoubleInvokePassiveEffects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
setIsStrictModeForDevtools(true);
disappearLayoutEffects(fiber);

if (shouldDoubleInvokePassiveEffects) {
Expand All @@ -29643,6 +29644,8 @@ function doubleInvokeEffectsOnFiber(root, fiber) {
if (shouldDoubleInvokePassiveEffects) {
reconnectPassiveEffects(root, fiber, NoLanes, null, false);
}

setIsStrictModeForDevtools(false);
}

function doubleInvokeEffectsInDEVIfNecessary(root, fiber, parentIsInStrictMode) {
Expand Down Expand Up @@ -36253,7 +36256,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14760,7 +14760,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
var devToolsConfig$jscomp$inline_1631 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-experimental-81c5ff2e04-20240521",
version: "19.0.0-experimental-f994737d14-20240522",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2009 = {
Expand Down Expand Up @@ -14790,7 +14790,7 @@ var internals$jscomp$inline_2009 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-experimental-81c5ff2e04-20240521"
reconcilerVersion: "19.0.0-experimental-f994737d14-20240522"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2010 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -14896,4 +14896,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -29680,6 +29680,7 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(root, parentFiber, isInS

function doubleInvokeEffectsOnFiber(root, fiber) {
var shouldDoubleInvokePassiveEffects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
setIsStrictModeForDevtools(true);
disappearLayoutEffects(fiber);

if (shouldDoubleInvokePassiveEffects) {
Expand All @@ -29691,6 +29692,8 @@ function doubleInvokeEffectsOnFiber(root, fiber) {
if (shouldDoubleInvokePassiveEffects) {
reconnectPassiveEffects(root, fiber, NoLanes, null, false);
}

setIsStrictModeForDevtools(false);
}

function doubleInvokeEffectsInDEVIfNecessary(root, fiber, parentIsInStrictMode) {
Expand Down Expand Up @@ -36301,7 +36304,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15471,7 +15471,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
var devToolsConfig$jscomp$inline_1718 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-experimental-81c5ff2e04-20240521",
version: "19.0.0-experimental-f994737d14-20240522",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -15514,7 +15514,7 @@ var devToolsConfig$jscomp$inline_1718 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-experimental-81c5ff2e04-20240521"
reconcilerVersion: "19.0.0-experimental-f994737d14-20240522"
});
function noop() {}
function getCrossOriginStringAs(as, input) {
Expand Down Expand Up @@ -15768,7 +15768,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5863,4 +5863,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'
);
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5959,4 +5959,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'
);
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6542,4 +6542,4 @@ exports.resume = function (children, postponedState, options) {
startWork(request);
});
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -5951,4 +5951,4 @@ exports.renderToReadableStream = function (children, options) {
safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);
});
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6665,4 +6665,4 @@ exports.resume = function (children, postponedState, options) {
startWork(request);
});
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var async_hooks = require('async_hooks');
var ReactDOM = require('react-dom');
var stream = require('stream');

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6537,4 +6537,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) {
}
};
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -30198,6 +30198,7 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(root, parentFiber, isInS

function doubleInvokeEffectsOnFiber(root, fiber) {
var shouldDoubleInvokePassiveEffects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
setIsStrictModeForDevtools(true);
disappearLayoutEffects(fiber);

if (shouldDoubleInvokePassiveEffects) {
Expand All @@ -30209,6 +30210,8 @@ function doubleInvokeEffectsOnFiber(root, fiber) {
if (shouldDoubleInvokePassiveEffects) {
reconnectPassiveEffects(root, fiber, NoLanes, null, false);
}

setIsStrictModeForDevtools(false);
}

function doubleInvokeEffectsInDEVIfNecessary(root, fiber, parentIsInStrictMode) {
Expand Down Expand Up @@ -36954,7 +36957,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15139,7 +15139,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
var devToolsConfig$jscomp$inline_1660 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-experimental-81c5ff2e04-20240521",
version: "19.0.0-experimental-f994737d14-20240522",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2043 = {
Expand Down Expand Up @@ -15169,7 +15169,7 @@ var internals$jscomp$inline_2043 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-experimental-81c5ff2e04-20240521"
reconcilerVersion: "19.0.0-experimental-f994737d14-20240522"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2044 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15426,4 +15426,4 @@ exports.observeVisibleRects = function (
}
};
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var Internals = {
findDOMNode: null
};

var ReactVersion = '19.0.0-experimental-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-experimental-f994737d14-20240522';

/**
* HTML nodeType values that represent the type of the node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-experimental-81c5ff2e04-20240521";
exports.version = "19.0.0-experimental-f994737d14-20240522";
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
"./package.json": "./package.json"
},
"dependencies": {
"scheduler": "0.0.0-experimental-81c5ff2e04-20240521"
"scheduler": "0.0.0-experimental-f994737d14-20240522"
},
"peerDependencies": {
"react": "0.0.0-experimental-81c5ff2e04-20240521"
"react": "0.0.0-experimental-f994737d14-20240522"
},
"browser": {
"./server.js": "./server.browser.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29423,6 +29423,7 @@ function recursivelyTraverseAndDoubleInvokeEffectsInDEV(root, parentFiber, isInS

function doubleInvokeEffectsOnFiber(root, fiber) {
var shouldDoubleInvokePassiveEffects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
setIsStrictModeForDevtools(true);
disappearLayoutEffects(fiber);

if (shouldDoubleInvokePassiveEffects) {
Expand All @@ -29434,6 +29435,8 @@ function doubleInvokeEffectsOnFiber(root, fiber) {
if (shouldDoubleInvokePassiveEffects) {
reconnectPassiveEffects(root, fiber, NoLanes, null, false);
}

setIsStrictModeForDevtools(false);
}

function doubleInvokeEffectsInDEVIfNecessary(root, fiber, parentIsInStrictMode) {
Expand Down Expand Up @@ -36044,7 +36047,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-rc-81c5ff2e04-20240521';
var ReactVersion = '19.0.0-rc-f994737d14-20240522';

// Might add PROFILE later.

Expand Down
Loading
Loading