[compiler] Refactor validations to return Result and log where appropriate

Updates ~all of our validations to return a Result, and then updates callers to either unwrap() if they should bailout or else just log.

ghstack-source-id: 418b5f5aa2
Pull Request resolved: https://github.com/facebook/react/pull/32688

DiffTrain build for [e3c06424ae](https://github.com/facebook/react/commit/e3c06424ae1162319d786a76371d649dee412c29)
This commit is contained in:
josephsavona
2025-03-20 11:09:13 -07:00
parent ddb820e3b4
commit f846612902
35 changed files with 317 additions and 243 deletions
+231 -157
View File
@@ -16295,6 +16295,125 @@ function requireLib () {
var libExports = requireLib();
function Ok(val) {
return new OkImpl(val);
}
class OkImpl {
constructor(val) {
this.val = val;
}
map(fn) {
return new OkImpl(fn(this.val));
}
mapErr(_fn) {
return this;
}
mapOr(_fallback, fn) {
return fn(this.val);
}
mapOrElse(_fallback, fn) {
return fn(this.val);
}
andThen(fn) {
return fn(this.val);
}
and(res) {
return res;
}
or(_res) {
return this;
}
orElse(_fn) {
return this;
}
isOk() {
return true;
}
isErr() {
return false;
}
expect(_msg) {
return this.val;
}
expectErr(msg) {
throw new Error(`${msg}: ${this.val}`);
}
unwrap() {
return this.val;
}
unwrapOr(_fallback) {
return this.val;
}
unwrapOrElse(_fallback) {
return this.val;
}
unwrapErr() {
if (this.val instanceof Error) {
throw this.val;
}
throw new Error(`Can't unwrap \`Ok\` to \`Err\`: ${this.val}`);
}
}
function Err(val) {
return new ErrImpl(val);
}
class ErrImpl {
constructor(val) {
this.val = val;
}
map(_fn) {
return this;
}
mapErr(fn) {
return new ErrImpl(fn(this.val));
}
mapOr(fallback, _fn) {
return fallback;
}
mapOrElse(fallback, _fn) {
return fallback();
}
andThen(_fn) {
return this;
}
and(_res) {
return this;
}
or(res) {
return res;
}
orElse(fn) {
return fn(this.val);
}
isOk() {
return false;
}
isErr() {
return true;
}
expect(msg) {
throw new Error(`${msg}: ${this.val}`);
}
expectErr(_msg) {
return this.val;
}
unwrap() {
if (this.val instanceof Error) {
throw this.val;
}
throw new Error(`Can't unwrap \`Err\` to \`Ok\`: ${this.val}`);
}
unwrapOr(fallback) {
return fallback;
}
unwrapOrElse(fallback) {
return fallback(this.val);
}
unwrapErr() {
return this.val;
}
}
function assertExhaustive$1(_, errorMsg) {
throw new Error(errorMsg);
}
@@ -16511,6 +16630,9 @@ class CompilerError extends Error {
hasErrors() {
return this.details.length > 0;
}
asResult() {
return this.hasErrors() ? Err(this) : Ok(undefined);
}
isCritical() {
return this.details.some(detail => {
switch (detail.severity) {
@@ -27950,125 +28072,6 @@ function validateMutableRange(mutableRange) {
mutableRange.end > mutableRange.start, 'Identifier scope mutableRange was invalid: [%s:%s]', mutableRange.start, mutableRange.end);
}
function Ok(val) {
return new OkImpl(val);
}
class OkImpl {
constructor(val) {
this.val = val;
}
map(fn) {
return new OkImpl(fn(this.val));
}
mapErr(_fn) {
return this;
}
mapOr(_fallback, fn) {
return fn(this.val);
}
mapOrElse(_fallback, fn) {
return fn(this.val);
}
andThen(fn) {
return fn(this.val);
}
and(res) {
return res;
}
or(_res) {
return this;
}
orElse(_fn) {
return this;
}
isOk() {
return true;
}
isErr() {
return false;
}
expect(_msg) {
return this.val;
}
expectErr(msg) {
throw new Error(`${msg}: ${this.val}`);
}
unwrap() {
return this.val;
}
unwrapOr(_fallback) {
return this.val;
}
unwrapOrElse(_fallback) {
return this.val;
}
unwrapErr() {
if (this.val instanceof Error) {
throw this.val;
}
throw new Error(`Can't unwrap \`Ok\` to \`Err\`: ${this.val}`);
}
}
function Err(val) {
return new ErrImpl(val);
}
class ErrImpl {
constructor(val) {
this.val = val;
}
map(_fn) {
return this;
}
mapErr(fn) {
return new ErrImpl(fn(this.val));
}
mapOr(fallback, _fn) {
return fallback;
}
mapOrElse(fallback, _fn) {
return fallback();
}
andThen(_fn) {
return this;
}
and(_res) {
return this;
}
or(res) {
return res;
}
orElse(fn) {
return fn(this.val);
}
isOk() {
return false;
}
isErr() {
return true;
}
expect(msg) {
throw new Error(`${msg}: ${this.val}`);
}
expectErr(_msg) {
return this.val;
}
unwrap() {
if (this.val instanceof Error) {
throw this.val;
}
throw new Error(`Can't unwrap \`Err\` to \`Ok\`: ${this.val}`);
}
unwrapOr(fallback) {
return fallback;
}
unwrapOrElse(fallback) {
return fallback(this.val);
}
unwrapErr() {
return this.val;
}
}
var _HIRBuilder_instances, _HIRBuilder_completed, _HIRBuilder_current, _HIRBuilder_entry, _HIRBuilder_scopes, _HIRBuilder_context, _HIRBuilder_bindings, _HIRBuilder_env, _HIRBuilder_exceptionHandlerStack, _HIRBuilder_resolveBabelBinding;
function newBlock(id, kind) {
return { id, kind, instructions: [] };
@@ -36999,6 +37002,7 @@ const EnvironmentConfigSchema = zod.z.object({
validateNoSetStateInRender: zod.z.boolean().default(true),
validateNoSetStateInPassiveEffects: zod.z.boolean().default(false),
validateNoJSXInTryStatements: zod.z.boolean().default(false),
validateStaticComponents: zod.z.boolean().default(false),
validateMemoizedEffectDependencies: zod.z.boolean().default(false),
validateNoCapitalizedCalls: zod.z.nullable(zod.z.array(zod.z.string())).default(null),
validateBlocklistedImports: zod.z.nullable(zod.z.array(zod.z.string())).default(null),
@@ -37098,6 +37102,18 @@ class Environment {
var _a, _b;
return makeScopeId((__classPrivateFieldSet(this, _Environment_nextScope, (_b = __classPrivateFieldGet(this, _Environment_nextScope, "f"), _a = _b++, _b), "f"), _a));
}
logErrors(errors) {
if (errors.isOk() || this.logger == null) {
return;
}
for (const error of errors.unwrapErr().details) {
this.logger.logEvent(this.filename, {
kind: 'CompileError',
detail: error,
fnLoc: null,
});
}
}
isContextIdentifier(node) {
return __classPrivateFieldGet(this, _Environment_contextIdentifiers, "f").has(node);
}
@@ -49807,9 +49823,7 @@ function validateHooksUsage(fn) {
for (const [, error] of errorsByPlace) {
errors.push(error);
}
if (errors.hasErrors()) {
throw errors;
}
return errors.asResult();
}
function visitFunctionExpression(errors, fn) {
for (const [, block] of fn.body.blocks) {
@@ -49845,9 +49859,7 @@ function visitFunctionExpression(errors, fn) {
function validateMemoizedEffectDependencies(fn) {
const errors = new CompilerError();
visitReactiveFunction(fn, new Visitor$1(), errors);
if (errors.hasErrors()) {
throw errors;
}
return errors.asResult();
}
let Visitor$1 = class Visitor extends ReactiveFunctionVisitor {
constructor() {
@@ -49910,6 +49922,7 @@ function validateNoCapitalizedCalls(fn) {
const isAllowed = (name) => {
return (ALLOW_LIST.has(name) || (hookPattern != null && hookPattern.test(name)));
};
const errors = new CompilerError();
const capitalLoadGlobals = new Map();
const capitalizedProperties = new Map();
const reason = 'Capitalized functions are reserved for components, which must be invoked with JSX. If this is a component, render it with JSX. Otherwise, ensure that it has no hook calls and rename it to begin with a lowercase letter. Alternatively, if you know for a fact that this function is not a component, you can allowlist it via the compiler config';
@@ -49949,7 +49962,8 @@ function validateNoCapitalizedCalls(fn) {
const propertyIdentifier = value.property.identifier.id;
const propertyName = capitalizedProperties.get(propertyIdentifier);
if (propertyName != null) {
CompilerError.throwInvalidReact({
errors.push({
severity: ErrorSeverity.InvalidReact,
reason,
description: `${propertyName} may be a component.`,
loc: value.loc,
@@ -49961,6 +49975,7 @@ function validateNoCapitalizedCalls(fn) {
}
}
}
return errors.asResult();
}
var _Env_changed;
@@ -50001,7 +50016,7 @@ class Env extends Map {
_Env_changed = new WeakMap();
function validateNoRefAccessInRender(fn) {
const env = new Env();
validateNoRefAccessInRenderImpl(fn, env).unwrap();
return validateNoRefAccessInRenderImpl(fn, env).map(_ => undefined);
}
function refTypeOfType(place) {
if (isRefValueType(place.identifier)) {
@@ -50471,7 +50486,7 @@ function validateNoDirectRefValueAccess(errors, operand, env) {
function validateNoSetStateInRender(fn) {
const unconditionalSetStateFunctions = new Set();
validateNoSetStateInRenderImpl(fn, unconditionalSetStateFunctions).unwrap();
return validateNoSetStateInRenderImpl(fn, unconditionalSetStateFunctions);
}
function validateNoSetStateInRenderImpl(fn, unconditionalSetStateFunctions) {
const unconditionalBlocks = computeUnconditionalBlocks(fn);
@@ -50546,12 +50561,7 @@ function validateNoSetStateInRenderImpl(fn, unconditionalSetStateFunctions) {
}
}
}
if (errors.hasErrors()) {
return Err(errors);
}
else {
return Ok(undefined);
}
return errors.asResult();
}
function validatePreservedManualMemoization(fn) {
@@ -50560,9 +50570,7 @@ function validatePreservedManualMemoization(fn) {
manualMemoState: null,
};
visitReactiveFunction(fn, new Visitor(), state);
if (state.errors.hasErrors()) {
throw state.errors;
}
return state.errors.asResult();
}
var CompareDependencyResult;
(function (CompareDependencyResult) {
@@ -50842,6 +50850,7 @@ function isUnmemoized(operand, scopes) {
}
function validateUseMemo(fn) {
const errors = new CompilerError();
const useMemos = new Set();
const react = new Set();
const functions = new Map();
@@ -50887,7 +50896,8 @@ function validateUseMemo(fn) {
continue;
}
if (body.loweredFunc.func.params.length > 0) {
CompilerError.throwInvalidReact({
errors.push({
severity: ErrorSeverity.InvalidReact,
reason: 'useMemo callbacks may not accept any arguments',
description: null,
loc: body.loc,
@@ -50895,7 +50905,8 @@ function validateUseMemo(fn) {
});
}
if (body.loweredFunc.func.async || body.loweredFunc.func.generator) {
CompilerError.throwInvalidReact({
errors.push({
severity: ErrorSeverity.InvalidReact,
reason: 'useMemo callbacks may not be async or generator functions',
description: null,
loc: body.loc,
@@ -50907,6 +50918,7 @@ function validateUseMemo(fn) {
}
}
}
return errors.asResult();
}
function validateLocalsNotReassignedAfterRender(fn) {
@@ -51381,9 +51393,7 @@ function validateNoSetStateInPassiveEffects(fn) {
}
}
}
if (errors.hasErrors()) {
throw errors;
}
return errors.asResult();
}
function getSetStateCall(fn, setStateFunctions) {
for (const [, block] of fn.body.blocks) {
@@ -51440,9 +51450,7 @@ function validateNoJSXInTryStatement(fn) {
activeTryBlocks.push(block.terminal.handler);
}
}
if (errors.hasErrors()) {
throw errors;
}
return errors.asResult();
}
function collectHoistablePropertyLoads(fn, temporaries, hoistableFromOptionals) {
@@ -53417,9 +53425,72 @@ function validateNoImpureFunctionsInRender(fn) {
}
}
}
if (errors.hasErrors()) {
throw errors;
return errors.asResult();
}
function validateStaticComponents(fn) {
const error = new CompilerError();
const knownDynamicComponents = new Map();
for (const block of fn.body.blocks.values()) {
phis: for (const phi of block.phis) {
for (const operand of phi.operands.values()) {
const loc = knownDynamicComponents.get(operand.identifier.id);
if (loc != null) {
knownDynamicComponents.set(phi.place.identifier.id, loc);
continue phis;
}
}
}
for (const instr of block.instructions) {
const { lvalue, value } = instr;
switch (value.kind) {
case 'FunctionExpression':
case 'NewExpression':
case 'MethodCall':
case 'CallExpression': {
knownDynamicComponents.set(lvalue.identifier.id, value.loc);
break;
}
case 'LoadLocal': {
const loc = knownDynamicComponents.get(value.place.identifier.id);
if (loc != null) {
knownDynamicComponents.set(lvalue.identifier.id, loc);
}
break;
}
case 'StoreLocal': {
const loc = knownDynamicComponents.get(value.value.identifier.id);
if (loc != null) {
knownDynamicComponents.set(lvalue.identifier.id, loc);
knownDynamicComponents.set(value.lvalue.place.identifier.id, loc);
}
break;
}
case 'JsxExpression': {
if (value.tag.kind === 'Identifier') {
const location = knownDynamicComponents.get(value.tag.identifier.id);
if (location != null) {
error.push({
reason: `Components created during render will reset their state each time they are created. Declare components outside of render. `,
severity: ErrorSeverity.InvalidReact,
loc: value.tag.loc,
description: null,
suggestions: null,
});
error.push({
reason: `The component may be created during render`,
severity: ErrorSeverity.InvalidReact,
loc: location,
description: null,
suggestions: null,
});
}
}
}
}
}
}
return error.asResult();
}
function run(func, config, fnType, mode, useMemoCacheIdentifier, logger, filename, code) {
@@ -53443,7 +53514,7 @@ function runWithEnvironment(func, env) {
pruneMaybeThrows(hir);
log({ kind: 'hir', name: 'PruneMaybeThrows', value: hir });
validateContextVariableLValues(hir);
validateUseMemo(hir);
validateUseMemo(hir).unwrap();
if (env.isInferredMemoEnabled &&
!env.config.enablePreserveExistingManualUseMemo &&
!env.config.disableMemoizationForDebugging &&
@@ -53472,10 +53543,10 @@ function runWithEnvironment(func, env) {
log({ kind: 'hir', name: 'InferTypes', value: hir });
if (env.isInferredMemoEnabled) {
if (env.config.validateHooksUsage) {
validateHooksUsage(hir);
validateHooksUsage(hir).unwrap();
}
if (env.config.validateNoCapitalizedCalls) {
validateNoCapitalizedCalls(hir);
validateNoCapitalizedCalls(hir).unwrap();
}
}
if (env.config.enableFire) {
@@ -53512,19 +53583,19 @@ function runWithEnvironment(func, env) {
assertValidMutableRanges(hir);
}
if (env.config.validateRefAccessDuringRender) {
validateNoRefAccessInRender(hir);
validateNoRefAccessInRender(hir).unwrap();
}
if (env.config.validateNoSetStateInRender) {
validateNoSetStateInRender(hir);
validateNoSetStateInRender(hir).unwrap();
}
if (env.config.validateNoSetStateInPassiveEffects) {
validateNoSetStateInPassiveEffects(hir);
env.logErrors(validateNoSetStateInPassiveEffects(hir));
}
if (env.config.validateNoJSXInTryStatements) {
validateNoJSXInTryStatement(hir);
env.logErrors(validateNoJSXInTryStatement(hir));
}
if (env.config.validateNoImpureFunctionsInRender) {
validateNoImpureFunctionsInRender(hir);
validateNoImpureFunctionsInRender(hir).unwrap();
}
}
inferReactivePlaces(hir);
@@ -53542,6 +53613,9 @@ function runWithEnvironment(func, env) {
value: hir,
});
if (env.isInferredMemoEnabled) {
if (env.config.validateStaticComponents) {
env.logErrors(validateStaticComponents(hir));
}
inferReactiveScopeVariables(hir);
log({ kind: 'hir', name: 'InferReactiveScopeVariables', value: hir });
}
@@ -53722,11 +53796,11 @@ function runWithEnvironment(func, env) {
value: reactiveFunction,
});
if (env.config.validateMemoizedEffectDependencies) {
validateMemoizedEffectDependencies(reactiveFunction);
validateMemoizedEffectDependencies(reactiveFunction).unwrap();
}
if (env.config.enablePreserveExistingMemoizationGuarantees ||
env.config.validatePreserveExistingMemoizationGuarantees) {
validatePreservedManualMemoization(reactiveFunction);
validatePreservedManualMemoization(reactiveFunction).unwrap();
}
const ast = codegenFunction(reactiveFunction, {
uniqueIdentifiers,
+1 -1
View File
@@ -1 +1 @@
ff8f6f21f756c81fba284557357eb6e6ce765149
e3c06424ae1162319d786a76371d649dee412c29
+1 -1
View File
@@ -1 +1 @@
ff8f6f21f756c81fba284557357eb6e6ce765149
e3c06424ae1162319d786a76371d649dee412c29
+1 -1
View File
@@ -1534,7 +1534,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+1 -1
View File
@@ -1534,7 +1534,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+1 -1
View File
@@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
+1 -1
View File
@@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -18529,10 +18529,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18566,7 +18566,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+3 -3
View File
@@ -18301,10 +18301,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18338,7 +18338,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -11332,10 +11332,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1583 = {
bundleType: 0,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1584 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -11361,4 +11361,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
@@ -11045,10 +11045,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1556 = {
bundleType: 0,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1557 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -11074,4 +11074,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
@@ -30273,11 +30273,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-classic-ff8f6f21-20250319" !== isomorphicReactPackageVersion)
if ("19.1.0-www-classic-e3c06424-20250320" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-classic-ff8f6f21-20250319\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-classic-e3c06424-20250320\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -30320,10 +30320,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30921,7 +30921,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+5 -5
View File
@@ -30059,11 +30059,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-modern-ff8f6f21-20250319" !== isomorphicReactPackageVersion)
if ("19.1.0-www-modern-e3c06424-20250320" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-modern-ff8f6f21-20250319\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-modern-e3c06424-20250320\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -30106,10 +30106,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30707,7 +30707,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -18997,14 +18997,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1971 = React.version;
if (
"19.1.0-www-classic-ff8f6f21-20250319" !==
"19.1.0-www-classic-e3c06424-20250320" !==
isomorphicReactPackageVersion$jscomp$inline_1971
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1971,
"19.1.0-www-classic-ff8f6f21-20250319"
"19.1.0-www-classic-e3c06424-20250320"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -19022,10 +19022,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2559 = {
bundleType: 0,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2560 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -19389,4 +19389,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
@@ -18726,14 +18726,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1961 = React.version;
if (
"19.1.0-www-modern-ff8f6f21-20250319" !==
"19.1.0-www-modern-e3c06424-20250320" !==
isomorphicReactPackageVersion$jscomp$inline_1961
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1961,
"19.1.0-www-modern-ff8f6f21-20250319"
"19.1.0-www-modern-e3c06424-20250320"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -18751,10 +18751,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2541 = {
bundleType: 0,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2542 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -19118,4 +19118,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
@@ -20739,14 +20739,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_2131 = React.version;
if (
"19.1.0-www-classic-ff8f6f21-20250319" !==
"19.1.0-www-classic-e3c06424-20250320" !==
isomorphicReactPackageVersion$jscomp$inline_2131
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2131,
"19.1.0-www-classic-ff8f6f21-20250319"
"19.1.0-www-classic-e3c06424-20250320"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -20764,10 +20764,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2133 = {
bundleType: 0,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_2133.getLaneLabelMap = getLaneLabelMap),
@@ -21134,7 +21134,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -20537,14 +20537,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_2121 = React.version;
if (
"19.1.0-www-modern-ff8f6f21-20250319" !==
"19.1.0-www-modern-e3c06424-20250320" !==
isomorphicReactPackageVersion$jscomp$inline_2121
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2121,
"19.1.0-www-modern-ff8f6f21-20250319"
"19.1.0-www-modern-e3c06424-20250320"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -20562,10 +20562,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2123 = {
bundleType: 0,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_2123.getLaneLabelMap = getLaneLabelMap),
@@ -20932,7 +20932,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -9421,5 +9421,5 @@ __DEV__ &&
'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.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
})();
@@ -9350,5 +9350,5 @@ __DEV__ &&
'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.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
})();
@@ -6203,4 +6203,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.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
@@ -6115,4 +6115,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.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
@@ -30594,11 +30594,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-classic-ff8f6f21-20250319" !== isomorphicReactPackageVersion)
if ("19.1.0-www-classic-e3c06424-20250320" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-classic-ff8f6f21-20250319\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-classic-e3c06424-20250320\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -30641,10 +30641,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -31408,5 +31408,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
})();
@@ -30380,11 +30380,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-modern-ff8f6f21-20250319" !== isomorphicReactPackageVersion)
if ("19.1.0-www-modern-e3c06424-20250320" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-modern-ff8f6f21-20250319\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-modern-e3c06424-20250320\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -30427,10 +30427,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -31194,5 +31194,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
})();
@@ -19313,14 +19313,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_2000 = React.version;
if (
"19.1.0-www-classic-ff8f6f21-20250319" !==
"19.1.0-www-classic-e3c06424-20250320" !==
isomorphicReactPackageVersion$jscomp$inline_2000
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2000,
"19.1.0-www-classic-ff8f6f21-20250319"
"19.1.0-www-classic-e3c06424-20250320"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -19338,10 +19338,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2593 = {
bundleType: 0,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2594 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -19856,4 +19856,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
@@ -19042,14 +19042,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1990 = React.version;
if (
"19.1.0-www-modern-ff8f6f21-20250319" !==
"19.1.0-www-modern-e3c06424-20250320" !==
isomorphicReactPackageVersion$jscomp$inline_1990
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1990,
"19.1.0-www-modern-ff8f6f21-20250319"
"19.1.0-www-modern-e3c06424-20250320"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -19067,10 +19067,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2575 = {
bundleType: 0,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2576 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -19585,4 +19585,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
@@ -21240,7 +21240,7 @@ __DEV__ &&
version: rendererVersion,
rendererPackageName: rendererPackageName,
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -21021,7 +21021,7 @@ __DEV__ &&
version: rendererVersion,
rendererPackageName: rendererPackageName,
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -13939,7 +13939,7 @@ module.exports = function ($$$config) {
version: rendererVersion,
rendererPackageName: rendererPackageName,
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -13656,7 +13656,7 @@ module.exports = function ($$$config) {
version: rendererVersion,
rendererPackageName: rendererPackageName,
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -15075,10 +15075,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-ff8f6f21-20250319",
version: "19.1.0-www-classic-e3c06424-20250320",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-classic-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -15213,5 +15213,5 @@ __DEV__ &&
exports.unstable_batchedUpdates = function (fn, a) {
return fn(a);
};
exports.version = "19.1.0-www-classic-ff8f6f21-20250319";
exports.version = "19.1.0-www-classic-e3c06424-20250320";
})();
@@ -15075,10 +15075,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-ff8f6f21-20250319",
version: "19.1.0-www-modern-e3c06424-20250320",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-ff8f6f21-20250319"
reconcilerVersion: "19.1.0-www-modern-e3c06424-20250320"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -15213,5 +15213,5 @@ __DEV__ &&
exports.unstable_batchedUpdates = function (fn, a) {
return fn(a);
};
exports.version = "19.1.0-www-modern-ff8f6f21-20250319";
exports.version = "19.1.0-www-modern-e3c06424-20250320";
})();
+1 -1
View File
@@ -1 +1 @@
19.1.0-www-classic-ff8f6f21-20250319
19.1.0-www-classic-e3c06424-20250320
+1 -1
View File
@@ -1 +1 @@
19.1.0-www-modern-ff8f6f21-20250319
19.1.0-www-modern-e3c06424-20250320