Unverified Commit 0a80017d authored by Josh Story's avatar Josh Story Committed by GitHub

Update React from d900fadbf to 09fbee89d. Removes server context and…

Update React from d900fadbf to 09fbee89d. Removes server context and experimental prefix for server action APIs (#56809)

The latest React canary builds have a few changes that need to be
adopted for compatability.

1. the `useFormState` and `useFormStatus` hooks in `react-dom` and the
`formData` opiont in `react-dom/server` are no longer prefixed with
`experimental_`
2. server content (an undocumented React feature) has been removed. Next
only had trivial intenral use of this API and did not expose a coherent
feature to Next users (no ability to seed context on refetches). It is
still possible that some users used the React server context APIs which
is why this should go into Next 14.

### React upstream changes

- https://github.com/facebook/react/pull/27513
- https://github.com/facebook/react/pull/27514
- https://github.com/facebook/react/pull/27511
- https://github.com/facebook/react/pull/27508
- https://github.com/facebook/react/pull/27502
- https://github.com/facebook/react/pull/27474
- https://github.com/facebook/react/pull/26789
- https://github.com/facebook/react/pull/27500
- https://github.com/facebook/react/pull/27488
- https://github.com/facebook/react/pull/27458
- https://github.com/facebook/react/pull/27471
- https://github.com/facebook/react/pull/27470
- https://github.com/facebook/react/pull/27464
- https://github.com/facebook/react/pull/27456
- https://github.com/facebook/react/pull/27462
- https://github.com/facebook/react/pull/27461
- https://github.com/facebook/react/pull/27460
- https://github.com/facebook/react/pull/27459
- https://github.com/facebook/react/pull/27454
- https://github.com/facebook/react/pull/27457
- https://github.com/facebook/react/pull/27453
- https://github.com/facebook/react/pull/27401
- https://github.com/facebook/react/pull/27443
- https://github.com/facebook/react/pull/27445
- https://github.com/facebook/react/pull/27364
- https://github.com/facebook/react/pull/27440
- https://github.com/facebook/react/pull/27436

---------
Co-authored-by: 's avatarZack Tanner <zacktanner@gmail.com>
Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
parent 26d0bf27
...@@ -377,7 +377,7 @@ For example, the following submit button: ...@@ -377,7 +377,7 @@ For example, the following submit button:
```tsx filename="app/submit-button.tsx" switcher ```tsx filename="app/submit-button.tsx" switcher
'use client' 'use client'
import { experimental_useFormStatus as useFormStatus } from 'react-dom' import { useFormStatus } from 'react-dom'
export function SubmitButton() { export function SubmitButton() {
const { pending } = useFormStatus() const { pending } = useFormStatus()
...@@ -393,7 +393,7 @@ export function SubmitButton() { ...@@ -393,7 +393,7 @@ export function SubmitButton() {
```jsx filename="app/submit-button.jsx" switcher ```jsx filename="app/submit-button.jsx" switcher
'use client' 'use client'
import { experimental_useFormStatus as useFormStatus } from 'react-dom' import { useFormStatus } from 'react-dom'
export function SubmitButton() { export function SubmitButton() {
const { pending } = useFormStatus() const { pending } = useFormStatus()
...@@ -557,8 +557,7 @@ Then, from a Client Component, you can read this value and display an error mess ...@@ -557,8 +557,7 @@ Then, from a Client Component, you can read this value and display an error mess
```tsx filename="app/add-form.tsx" switcher ```tsx filename="app/add-form.tsx" switcher
'use client' 'use client'
import { experimental_useFormState as useFormState } from 'react-dom' import { useFormState, useFormStatus } from 'react-dom'
import { experimental_useFormStatus as useFormStatus } from 'react-dom'
import { createTodo } from '@/app/actions' import { createTodo } from '@/app/actions'
const initialState = { const initialState = {
...@@ -594,8 +593,7 @@ export function AddForm() { ...@@ -594,8 +593,7 @@ export function AddForm() {
```jsx filename="app/add-form.jsx" switcher ```jsx filename="app/add-form.jsx" switcher
'use client' 'use client'
import { experimental_useFormState as useFormState } from 'react-dom' import { useFormState, useFormStatus } from 'react-dom'
import { experimental_useFormStatus as useFormStatus } from 'react-dom'
import { createTodo } from '@/app/actions' import { createTodo } from '@/app/actions'
const initialState = { const initialState = {
......
'use client' 'use client'
import { experimental_useFormState as useFormState } from 'react-dom' import { experimental_useFormState as useFormState } from 'react-dom'
import { experimental_useFormStatus as useFormStatus } from 'react-dom' import { useFormStatus } from 'react-dom'
import { createTodo } from '@/app/actions' import { createTodo } from '@/app/actions'
const initialState = { const initialState = {
......
'use client' 'use client'
import { experimental_useFormState as useFormState } from 'react-dom' import { useFormState, useFormStatus } from 'react-dom'
import { experimental_useFormStatus as useFormStatus } from 'react-dom'
import { deleteTodo } from '@/app/actions' import { deleteTodo } from '@/app/actions'
const initialState = { const initialState = {
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
import cn from 'classnames' import cn from 'classnames'
import { createEntryAction } from '@/actions/entry' import { createEntryAction } from '@/actions/entry'
// @ts-ignore // @ts-ignore
import { experimental_useFormState as useFormState } from 'react-dom' import { useFormState, useFormStatus } from 'react-dom'
import { experimental_useFormStatus as useFormStatus } from 'react-dom'
import LoadingSpinner from '@/components/LoadingSpinner' import LoadingSpinner from '@/components/LoadingSpinner'
import SuccessMessage from '@/components/SuccessMessage' import SuccessMessage from '@/components/SuccessMessage'
import ErrorMessage from '@/components/ErrorMessage' import ErrorMessage from '@/components/ErrorMessage'
...@@ -26,7 +25,7 @@ export default function EntryForm() { ...@@ -26,7 +25,7 @@ export default function EntryForm() {
return ( return (
<> <>
<form className="flex relative my-4" action={formAction}> <form className="relative flex my-4" action={formAction}>
<input <input
required required
className={cn(inputClasses, 'w-1/3 mr-2 px-4')} className={cn(inputClasses, 'w-1/3 mr-2 px-4')}
......
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
"@types/jest": "27.4.1", "@types/jest": "27.4.1",
"@types/node": "20.2.5", "@types/node": "20.2.5",
"@types/node-fetch": "2.6.1", "@types/node-fetch": "2.6.1",
"@types/react": "18.2.8", "@types/react": "18.2.28",
"@types/react-dom": "18.2.4", "@types/react-dom": "18.2.13",
"@types/relay-runtime": "14.1.13", "@types/relay-runtime": "14.1.13",
"@types/selenium-webdriver": "4.0.15", "@types/selenium-webdriver": "4.0.15",
"@types/sharp": "0.29.3", "@types/sharp": "0.29.3",
...@@ -193,16 +193,16 @@ ...@@ -193,16 +193,16 @@
"random-seed": "0.3.0", "random-seed": "0.3.0",
"react": "18.2.0", "react": "18.2.0",
"react-17": "npm:react@17.0.2", "react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-canary-d900fadbf-20230929", "react-builtin": "npm:react@18.3.0-canary-09fbee89d-20231013",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2", "react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-d900fadbf-20230929", "react-dom-builtin": "npm:react-dom@18.3.0-canary-09fbee89d-20231013",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-d900fadbf-20230929", "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-09fbee89d-20231013",
"react-experimental-builtin": "npm:react@0.0.0-experimental-d900fadbf-20230929", "react-experimental-builtin": "npm:react@0.0.0-experimental-09fbee89d-20231013",
"react-server-dom-turbopack": "18.3.0-canary-d900fadbf-20230929", "react-server-dom-turbopack": "18.3.0-canary-09fbee89d-20231013",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-d900fadbf-20230929", "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-09fbee89d-20231013",
"react-server-dom-webpack": "18.3.0-canary-d900fadbf-20230929", "react-server-dom-webpack": "18.3.0-canary-09fbee89d-20231013",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d900fadbf-20230929", "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-09fbee89d-20231013",
"react-ssr-prepass": "1.0.8", "react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3", "react-virtualized": "9.22.3",
"relay-compiler": "13.0.2", "relay-compiler": "13.0.2",
...@@ -212,8 +212,8 @@ ...@@ -212,8 +212,8 @@
"resolve-from": "5.0.0", "resolve-from": "5.0.0",
"sass": "1.54.0", "sass": "1.54.0",
"satori": "0.10.6", "satori": "0.10.6",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-d900fadbf-20230929", "scheduler-builtin": "npm:scheduler@0.24.0-canary-09fbee89d-20231013",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-d900fadbf-20230929", "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-09fbee89d-20231013",
"seedrandom": "3.0.5", "seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4", "selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7", "semver": "7.3.7",
...@@ -245,8 +245,8 @@ ...@@ -245,8 +245,8 @@
"@babel/parser": "7.18.0", "@babel/parser": "7.18.0",
"@babel/types": "7.18.0", "@babel/types": "7.18.0",
"@babel/traverse": "7.18.0", "@babel/traverse": "7.18.0",
"@types/react": "18.2.7", "@types/react": "18.2.28",
"@types/react-dom": "18.2.4" "@types/react-dom": "18.2.13"
}, },
"engines": { "engines": {
"node": ">=18.18.2", "node": ">=18.18.2",
......
...@@ -612,8 +612,8 @@ pub fn server_components<C: Comments>( ...@@ -612,8 +612,8 @@ pub fn server_components<C: Comments>(
JsWord::from("findDOMNode"), JsWord::from("findDOMNode"),
JsWord::from("flushSync"), JsWord::from("flushSync"),
JsWord::from("unstable_batchedUpdates"), JsWord::from("unstable_batchedUpdates"),
JsWord::from("experimental_useFormStatus"), JsWord::from("useFormStatus"),
JsWord::from("experimental_useFormState"), JsWord::from("useFormState"),
], ],
invalid_server_react_apis: vec![ invalid_server_react_apis: vec![
JsWord::from("Component"), JsWord::from("Component"),
......
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'
import { import { useFormStatus, useFormState } from 'react-dom'
experimental_useFormStatus,
experimental_useFormState,
} from 'react-dom'
export default function () { export default function () {
return null return null
......
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'; import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom';
import { experimental_useFormStatus, experimental_useFormState } from 'react-dom'; import { useFormStatus, useFormState } from 'react-dom';
export default function() { export default function() {
return null; return null;
} }
...@@ -17,18 +17,18 @@ ...@@ -17,18 +17,18 @@
: ^^^^^^^^^^^^^^^^^^^^^^^ : ^^^^^^^^^^^^^^^^^^^^^^^
`---- `----
x NEXT_RSC_ERR_REACT_API: experimental_useFormStatus x NEXT_RSC_ERR_REACT_API: useFormStatus
,-[input.js:3:1] ,-[input.js:3:1]
3 | import { 3 | import {
4 | experimental_useFormStatus, 4 | useFormStatus,
: ^^^^^^^^^^^^^^^^^^^^^^^^^^ : ^^^^^^^^^^^^^^^^^^^^^^^^^^
5 | experimental_useFormState, 5 | useFormState,
`---- `----
x NEXT_RSC_ERR_REACT_API: experimental_useFormState x NEXT_RSC_ERR_REACT_API: useFormState
,-[input.js:4:1] ,-[input.js:4:1]
4 | experimental_useFormStatus, 4 | useFormStatus,
5 | experimental_useFormState, 5 | useFormState,
: ^^^^^^^^^^^^^^^^^^^^^^^^^ : ^^^^^^^^^^^^^^^^^^^^^^^^^
6 | } from 'react-dom' 6 | } from 'react-dom'
`---- `----
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'
import { import { useFormStatus, useFormState } from 'react-dom'
experimental_useFormStatus,
experimental_useFormState,
} from 'react-dom'
export default function () { export default function () {
return null return null
......
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'; import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom';
import { experimental_useFormStatus, experimental_useFormState } from 'react-dom'; import { useFormStatus, useFormState } from 'react-dom';
export default function() { export default function() {
return null; return null;
......
...@@ -299,7 +299,7 @@ export function hydrate() { ...@@ -299,7 +299,7 @@ export function hydrate() {
React.startTransition(() => React.startTransition(() =>
(ReactDOMClient as any).hydrateRoot(appElement, reactEl, { (ReactDOMClient as any).hydrateRoot(appElement, reactEl, {
...options, ...options,
experimental_formState: initialFormStateData, formState: initialFormStateData,
}) })
) )
} }
......
...@@ -16,16 +16,6 @@ if (process.env.NODE_ENV !== "production") { ...@@ -16,16 +16,6 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental"); var React = require("next/dist/compiled/react-experimental");
var ReactVersion = '18.3.0-experimental-d900fadbf-20230929';
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
}
};
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function error(format) { function error(format) {
...@@ -65,6 +55,16 @@ function printWarning(level, format, args) { ...@@ -65,6 +55,16 @@ function printWarning(level, format, args) {
} }
} }
var ReactVersion = '18.3.0-experimental-09fbee89d-20231013';
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
}
};
function getCrossOriginString(input) { function getCrossOriginString(input) {
if (typeof input === 'string') { if (typeof input === 'string') {
return input === 'use-credentials' ? input : ''; return input === 'use-credentials' ? input : '';
...@@ -358,10 +358,25 @@ function batchedUpdates(fn, a) { ...@@ -358,10 +358,25 @@ function batchedUpdates(fn, a) {
return fn(a); return fn(a);
} }
function experimental_useFormStatus() {
{
error('useFormStatus is now in canary. Remove the experimental_ prefix. ' + 'The prefixed alias will be removed in an upcoming release.');
}
return useFormStatus();
}
function experimental_useFormState(action, initialState, permalink) {
{
error('useFormState is now in canary. Remove the experimental_ prefix. ' + 'The prefixed alias will be removed in an upcoming release.');
}
return useFormState(action, initialState, permalink);
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal; exports.createPortal = createPortal;
exports.experimental_useFormState = useFormState; exports.experimental_useFormState = experimental_useFormState;
exports.experimental_useFormStatus = useFormStatus; exports.experimental_useFormStatus = experimental_useFormStatus;
exports.flushSync = flushSync; exports.flushSync = flushSync;
exports.preconnect = preconnect; exports.preconnect = preconnect;
exports.prefetchDNS = prefetchDNS; exports.prefetchDNS = prefetchDNS;
...@@ -370,6 +385,8 @@ exports.preinitModule = preinitModule; ...@@ -370,6 +385,8 @@ exports.preinitModule = preinitModule;
exports.preload = preload; exports.preload = preload;
exports.preloadModule = preloadModule; exports.preloadModule = preloadModule;
exports.unstable_batchedUpdates = batchedUpdates; exports.unstable_batchedUpdates = batchedUpdates;
exports.useFormState = useFormState;
exports.useFormStatus = useFormStatus;
exports.version = ReactVersion; exports.version = ReactVersion;
})(); })();
} }
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
'use strict';var e=require("next/dist/compiled/react-experimental"),f={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function h(b){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+b+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} 'use strict';var e=require("next/dist/compiled/react-experimental"),f={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function h(b){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+b+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
function k(b,a){if("font"===b)return"";if("string"===typeof a)return"use-credentials"===a?a:""}var l=f.Dispatcher,p=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f;exports.createPortal=function(){throw Error(h(448));};exports.experimental_useFormState=function(b,a,c){return p.current.useFormState(b,a,c)};exports.experimental_useFormStatus=function(){return p.current.useHostTransitionStatus()}; function k(b,a){if("font"===b)return"";if("string"===typeof a)return"use-credentials"===a?a:""}var l=f.Dispatcher,m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function n(){return m.current.useHostTransitionStatus()}function r(b,a,c){return m.current.useFormState(b,a,c)}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f;exports.createPortal=function(){throw Error(h(448));};exports.experimental_useFormState=function(b,a,c){return r(b,a,c)};
exports.flushSync=function(){throw Error(h(449));};exports.preconnect=function(b,a){var c=l.current;c&&"string"===typeof b&&(a?(a=a.crossOrigin,a="string"===typeof a?"use-credentials"===a?a:"":void 0):a=null,c.preconnect(b,a))};exports.prefetchDNS=function(b){var a=l.current;a&&"string"===typeof b&&a.prefetchDNS(b)}; exports.experimental_useFormStatus=function(){return n()};exports.flushSync=function(){throw Error(h(449));};exports.preconnect=function(b,a){var c=l.current;c&&"string"===typeof b&&(a?(a=a.crossOrigin,a="string"===typeof a?"use-credentials"===a?a:"":void 0):a=null,c.preconnect(b,a))};exports.prefetchDNS=function(b){var a=l.current;a&&"string"===typeof b&&a.prefetchDNS(b)};
exports.preinit=function(b,a){var c=l.current;if(c&&"string"===typeof b&&a&&"string"===typeof a.as){var d=a.as,g=k(d,a.crossOrigin),m="string"===typeof a.integrity?a.integrity:void 0,n="string"===typeof a.fetchPriority?a.fetchPriority:void 0;"style"===d?c.preinitStyle(b,"string"===typeof a.precedence?a.precedence:void 0,{crossOrigin:g,integrity:m,fetchPriority:n}):"script"===d&&c.preinitScript(b,{crossOrigin:g,integrity:m,fetchPriority:n,nonce:"string"===typeof a.nonce?a.nonce:void 0})}}; exports.preinit=function(b,a){var c=l.current;if(c&&"string"===typeof b&&a&&"string"===typeof a.as){var d=a.as,g=k(d,a.crossOrigin),p="string"===typeof a.integrity?a.integrity:void 0,q="string"===typeof a.fetchPriority?a.fetchPriority:void 0;"style"===d?c.preinitStyle(b,"string"===typeof a.precedence?a.precedence:void 0,{crossOrigin:g,integrity:p,fetchPriority:q}):"script"===d&&c.preinitScript(b,{crossOrigin:g,integrity:p,fetchPriority:q,nonce:"string"===typeof a.nonce?a.nonce:void 0})}};
exports.preinitModule=function(b,a){var c=l.current;if(c&&"string"===typeof b)if("object"===typeof a&&null!==a){if(null==a.as||"script"===a.as){var d=k(a.as,a.crossOrigin);c.preinitModuleScript(b,{crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0})}}else null==a&&c.preinitModuleScript(b)}; exports.preinitModule=function(b,a){var c=l.current;if(c&&"string"===typeof b)if("object"===typeof a&&null!==a){if(null==a.as||"script"===a.as){var d=k(a.as,a.crossOrigin);c.preinitModuleScript(b,{crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0})}}else null==a&&c.preinitModuleScript(b)};
exports.preload=function(b,a){var c=l.current;if(c&&"string"===typeof b&&"object"===typeof a&&null!==a&&"string"===typeof a.as){var d=a.as,g=k(d,a.crossOrigin);c.preload(b,d,{crossOrigin:g,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0,type:"string"===typeof a.type?a.type:void 0,fetchPriority:"string"===typeof a.fetchPriority?a.fetchPriority:void 0,referrerPolicy:"string"===typeof a.referrerPolicy?a.referrerPolicy:void 0,imageSrcSet:"string"=== exports.preload=function(b,a){var c=l.current;if(c&&"string"===typeof b&&"object"===typeof a&&null!==a&&"string"===typeof a.as){var d=a.as,g=k(d,a.crossOrigin);c.preload(b,d,{crossOrigin:g,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0,type:"string"===typeof a.type?a.type:void 0,fetchPriority:"string"===typeof a.fetchPriority?a.fetchPriority:void 0,referrerPolicy:"string"===typeof a.referrerPolicy?a.referrerPolicy:void 0,imageSrcSet:"string"===
typeof a.imageSrcSet?a.imageSrcSet:void 0,imageSizes:"string"===typeof a.imageSizes?a.imageSizes:void 0})}};exports.preloadModule=function(b,a){var c=l.current;if(c&&"string"===typeof b)if(a){var d=k(a.as,a.crossOrigin);c.preloadModule(b,{as:"string"===typeof a.as&&"script"!==a.as?a.as:void 0,crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0})}else c.preloadModule(b)};exports.unstable_batchedUpdates=function(b,a){return b(a)};exports.version="18.3.0-experimental-d900fadbf-20230929"; typeof a.imageSrcSet?a.imageSrcSet:void 0,imageSizes:"string"===typeof a.imageSizes?a.imageSizes:void 0})}};exports.preloadModule=function(b,a){var c=l.current;if(c&&"string"===typeof b)if(a){var d=k(a.as,a.crossOrigin);c.preloadModule(b,{as:"string"===typeof a.as&&"script"!==a.as?a.as:void 0,crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0})}else c.preloadModule(b)};exports.unstable_batchedUpdates=function(b,a){return b(a)};exports.useFormState=r;exports.useFormStatus=n;
exports.version="18.3.0-experimental-09fbee89d-20231013";
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -42,10 +42,10 @@ ...@@ -42,10 +42,10 @@
}, },
"dependencies": { "dependencies": {
"loose-envify": "^1.1.0", "loose-envify": "^1.1.0",
"scheduler": "0.0.0-experimental-d900fadbf-20230929" "scheduler": "0.0.0-experimental-09fbee89d-20231013"
}, },
"peerDependencies": { "peerDependencies": {
"react": "0.0.0-experimental-d900fadbf-20230929" "react": "0.0.0-experimental-09fbee89d-20231013"
}, },
"browser": { "browser": {
"./server.js": "./server.browser.js", "./server.js": "./server.browser.js",
......
...@@ -16,16 +16,6 @@ if (process.env.NODE_ENV !== "production") { ...@@ -16,16 +16,6 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react"); var React = require("next/dist/compiled/react");
var ReactVersion = '18.3.0-canary-d900fadbf-20230929';
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
}
};
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function error(format) { function error(format) {
...@@ -65,6 +55,16 @@ function printWarning(level, format, args) { ...@@ -65,6 +55,16 @@ function printWarning(level, format, args) {
} }
} }
var ReactVersion = '18.3.0-canary-09fbee89d-20231013';
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
}
};
function getCrossOriginString(input) { function getCrossOriginString(input) {
if (typeof input === 'string') { if (typeof input === 'string') {
return input === 'use-credentials' ? input : ''; return input === 'use-credentials' ? input : '';
...@@ -310,14 +310,37 @@ function getValueDescriptorExpectingEnumForWarning(thing) { ...@@ -310,14 +310,37 @@ function getValueDescriptorExpectingEnumForWarning(thing) {
return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : typeof thing === 'string' ? JSON.stringify(thing) : typeof thing === 'number' ? '`' + thing + '`' : "something with type \"" + typeof thing + "\""; return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : typeof thing === 'string' ? JSON.stringify(thing) : typeof thing === 'number' ? '`' + thing + '`' : "something with type \"" + typeof thing + "\"";
} }
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; // Since the "not pending" value is always the same, we can reuse the
function resolveDispatcher() {
// Copied from react/src/ReactHooks.js. It's the same thing but in a
// different package.
var dispatcher = ReactCurrentDispatcher.current;
{
if (dispatcher === null) {
error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
}
} // Will result in a null access error if accessed outside render phase. We
// intentionally don't throw our own error because this is in a hot path.
// Also helps ensure this is inlined.
return dispatcher;
}
function useFormStatus() { function useFormStatus() {
{ {
throw new Error('Not implemented.'); var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] We know this exists because of the feature check above.
return dispatcher.useHostTransitionStatus();
} }
} }
function useFormState(action, initialState, permalink) { function useFormState(action, initialState, permalink) {
{ {
throw new Error('Not implemented.'); var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
return dispatcher.useFormState(action, initialState, permalink);
} }
} }
...@@ -335,10 +358,25 @@ function batchedUpdates(fn, a) { ...@@ -335,10 +358,25 @@ function batchedUpdates(fn, a) {
return fn(a); return fn(a);
} }
function experimental_useFormStatus() {
{
error('useFormStatus is now in canary. Remove the experimental_ prefix. ' + 'The prefixed alias will be removed in an upcoming release.');
}
return useFormStatus();
}
function experimental_useFormState(action, initialState, permalink) {
{
error('useFormState is now in canary. Remove the experimental_ prefix. ' + 'The prefixed alias will be removed in an upcoming release.');
}
return useFormState(action, initialState, permalink);
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal; exports.createPortal = createPortal;
exports.experimental_useFormState = useFormState; exports.experimental_useFormState = experimental_useFormState;
exports.experimental_useFormStatus = useFormStatus; exports.experimental_useFormStatus = experimental_useFormStatus;
exports.flushSync = flushSync; exports.flushSync = flushSync;
exports.preconnect = preconnect; exports.preconnect = preconnect;
exports.prefetchDNS = prefetchDNS; exports.prefetchDNS = prefetchDNS;
...@@ -347,6 +385,8 @@ exports.preinitModule = preinitModule; ...@@ -347,6 +385,8 @@ exports.preinitModule = preinitModule;
exports.preload = preload; exports.preload = preload;
exports.preloadModule = preloadModule; exports.preloadModule = preloadModule;
exports.unstable_batchedUpdates = batchedUpdates; exports.unstable_batchedUpdates = batchedUpdates;
exports.useFormState = useFormState;
exports.useFormStatus = useFormStatus;
exports.version = ReactVersion; exports.version = ReactVersion;
})(); })();
} }
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
'use strict';var e={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function f(b){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+b+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function g(b,a){if("font"===b)return"";if("string"===typeof a)return"use-credentials"===a?a:""} 'use strict';var e=require("next/dist/compiled/react"),f={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function h(b){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+b+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
var k=e.Dispatcher;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e;exports.createPortal=function(){throw Error(f(448));};exports.experimental_useFormState=function(){throw Error(f(248));};exports.experimental_useFormStatus=function(){throw Error(f(248));};exports.flushSync=function(){throw Error(f(449));};exports.preconnect=function(b,a){var c=k.current;c&&"string"===typeof b&&(a?(a=a.crossOrigin,a="string"===typeof a?"use-credentials"===a?a:"":void 0):a=null,c.preconnect(b,a))}; function k(b,a){if("font"===b)return"";if("string"===typeof a)return"use-credentials"===a?a:""}var l=f.Dispatcher,m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function n(){return m.current.useHostTransitionStatus()}function r(b,a,c){return m.current.useFormState(b,a,c)}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f;exports.createPortal=function(){throw Error(h(448));};exports.experimental_useFormState=function(b,a,c){return r(b,a,c)};
exports.prefetchDNS=function(b){var a=k.current;a&&"string"===typeof b&&a.prefetchDNS(b)}; exports.experimental_useFormStatus=function(){return n()};exports.flushSync=function(){throw Error(h(449));};exports.preconnect=function(b,a){var c=l.current;c&&"string"===typeof b&&(a?(a=a.crossOrigin,a="string"===typeof a?"use-credentials"===a?a:"":void 0):a=null,c.preconnect(b,a))};exports.prefetchDNS=function(b){var a=l.current;a&&"string"===typeof b&&a.prefetchDNS(b)};
exports.preinit=function(b,a){var c=k.current;if(c&&"string"===typeof b&&a&&"string"===typeof a.as){var d=a.as,h=g(d,a.crossOrigin),l="string"===typeof a.integrity?a.integrity:void 0,m="string"===typeof a.fetchPriority?a.fetchPriority:void 0;"style"===d?c.preinitStyle(b,"string"===typeof a.precedence?a.precedence:void 0,{crossOrigin:h,integrity:l,fetchPriority:m}):"script"===d&&c.preinitScript(b,{crossOrigin:h,integrity:l,fetchPriority:m,nonce:"string"===typeof a.nonce?a.nonce:void 0})}}; exports.preinit=function(b,a){var c=l.current;if(c&&"string"===typeof b&&a&&"string"===typeof a.as){var d=a.as,g=k(d,a.crossOrigin),p="string"===typeof a.integrity?a.integrity:void 0,q="string"===typeof a.fetchPriority?a.fetchPriority:void 0;"style"===d?c.preinitStyle(b,"string"===typeof a.precedence?a.precedence:void 0,{crossOrigin:g,integrity:p,fetchPriority:q}):"script"===d&&c.preinitScript(b,{crossOrigin:g,integrity:p,fetchPriority:q,nonce:"string"===typeof a.nonce?a.nonce:void 0})}};
exports.preinitModule=function(b,a){var c=k.current;if(c&&"string"===typeof b)if("object"===typeof a&&null!==a){if(null==a.as||"script"===a.as){var d=g(a.as,a.crossOrigin);c.preinitModuleScript(b,{crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0})}}else null==a&&c.preinitModuleScript(b)}; exports.preinitModule=function(b,a){var c=l.current;if(c&&"string"===typeof b)if("object"===typeof a&&null!==a){if(null==a.as||"script"===a.as){var d=k(a.as,a.crossOrigin);c.preinitModuleScript(b,{crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0})}}else null==a&&c.preinitModuleScript(b)};
exports.preload=function(b,a){var c=k.current;if(c&&"string"===typeof b&&"object"===typeof a&&null!==a&&"string"===typeof a.as){var d=a.as,h=g(d,a.crossOrigin);c.preload(b,d,{crossOrigin:h,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0,type:"string"===typeof a.type?a.type:void 0,fetchPriority:"string"===typeof a.fetchPriority?a.fetchPriority:void 0,referrerPolicy:"string"===typeof a.referrerPolicy?a.referrerPolicy:void 0,imageSrcSet:"string"=== exports.preload=function(b,a){var c=l.current;if(c&&"string"===typeof b&&"object"===typeof a&&null!==a&&"string"===typeof a.as){var d=a.as,g=k(d,a.crossOrigin);c.preload(b,d,{crossOrigin:g,integrity:"string"===typeof a.integrity?a.integrity:void 0,nonce:"string"===typeof a.nonce?a.nonce:void 0,type:"string"===typeof a.type?a.type:void 0,fetchPriority:"string"===typeof a.fetchPriority?a.fetchPriority:void 0,referrerPolicy:"string"===typeof a.referrerPolicy?a.referrerPolicy:void 0,imageSrcSet:"string"===
typeof a.imageSrcSet?a.imageSrcSet:void 0,imageSizes:"string"===typeof a.imageSizes?a.imageSizes:void 0})}};exports.preloadModule=function(b,a){var c=k.current;if(c&&"string"===typeof b)if(a){var d=g(a.as,a.crossOrigin);c.preloadModule(b,{as:"string"===typeof a.as&&"script"!==a.as?a.as:void 0,crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0})}else c.preloadModule(b)};exports.unstable_batchedUpdates=function(b,a){return b(a)};exports.version="18.3.0-canary-d900fadbf-20230929"; typeof a.imageSrcSet?a.imageSrcSet:void 0,imageSizes:"string"===typeof a.imageSizes?a.imageSizes:void 0})}};exports.preloadModule=function(b,a){var c=l.current;if(c&&"string"===typeof b)if(a){var d=k(a.as,a.crossOrigin);c.preloadModule(b,{as:"string"===typeof a.as&&"script"!==a.as?a.as:void 0,crossOrigin:d,integrity:"string"===typeof a.integrity?a.integrity:void 0})}else c.preloadModule(b)};exports.unstable_batchedUpdates=function(b,a){return b(a)};exports.useFormState=r;exports.useFormStatus=n;
exports.version="18.3.0-canary-09fbee89d-20231013";
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment