Skip to content

Commit

Permalink
fix(deps): update React to latest canary 19.x (#10482)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Apr 20, 2024
1 parent efdbd8f commit 1ed2650
Show file tree
Hide file tree
Showing 38 changed files with 397 additions and 90 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ jobs:

- name: Run `rw build --no-prerender`
run: |
yarn why @apollo/client
tree .yarn
tree node_modules/@apollo/client/react/hooks/internal
cat node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js
yarn rw build --no-prerender
working-directory: ${{ steps.set-up-test-project.outputs.test-project-path }}

Expand Down
35 changes: 35 additions & 0 deletions .yarn/patches/@apollo-client-npm-3.9.9-15c2e13518.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/react/hooks/internal/useRenderGuard.js b/react/hooks/internal/useRenderGuard.js
index 15551e6e2de4dcc585e9426f80c67cb136ecd2a7..181e74a378c59779e83b698cb1923602cf845813 100644
--- a/react/hooks/internal/useRenderGuard.js
+++ b/react/hooks/internal/useRenderGuard.js
@@ -1,7 +1,9 @@
-import * as React from "rehackt";
+import React from "rehackt";
function getRenderDispatcher() {
- var _a, _b;
- return (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentDispatcher || r19.ReactCurrentDispatcher;
+ return _b === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
/*
diff --git a/testing/internal/profile/profile.js b/testing/internal/profile/profile.js
index bcb709e4a7f6a72b381632e6da6a5c7d9ab5d8f1..362dcd3e577beb62f14bdb61a72debebaaf212ff 100644
--- a/testing/internal/profile/profile.js
+++ b/testing/internal/profile/profile.js
@@ -276,8 +276,11 @@ export function profileHook(renderCallback) {
});
}
function resolveHookOwner() {
- var _a, _b, _c;
- return (_c = (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentOwner) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentOwner || r19.ReactCurrentOwner;
+ var _c;
+ return (_c = _b === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
}
export function useTrackRenders(_a) {
var _b = _a === void 0 ? {} : _a, name = _b.name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/dist/preset.js b/dist/preset.js
index e136e7e4efc61bc2596c91b12bae8748cd48226f..578c2e77cd58176ad441a8fe83d384016008bbfe 100644
--- a/dist/preset.js
+++ b/dist/preset.js
@@ -1 +1 @@
-"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{viteFinal:()=>viteFinal,webpackFinal:()=>webpackFinal});module.exports=__toCommonJS(preset_exports);var import_package=require("react-dom/package.json"),webpackFinal=async(config,options)=>{var _a;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");return legacyRootApi??!isReact18?config:{...config,resolve:{...config.resolve,alias:{...(_a=config.resolve)==null?void 0:_a.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"}}}},viteFinal=async(config,options)=>{var _a,_b;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");if(legacyRootApi||!isReact18)return config;let alias=Array.isArray((_a=config.resolve)==null?void 0:_a.alias)?config.resolve.alias.concat({find:/^@storybook\/react-dom-shim$/,replacement:"@storybook/react-dom-shim/dist/react-18"}):{...(_b=config.resolve)==null?void 0:_b.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"};return{...config,resolve:{...config.resolve,alias}}};0&&(module.exports={viteFinal,webpackFinal});
+"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{viteFinal:()=>viteFinal,webpackFinal:()=>webpackFinal});module.exports=__toCommonJS(preset_exports);var import_package=require("react-dom/package.json"),webpackFinal=async(config,options)=>{var _a;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("19")||import_package.version.startsWith("0.0.0");return legacyRootApi??!isReact18?config:{...config,resolve:{...config.resolve,alias:{...(_a=config.resolve)==null?void 0:_a.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"}}}},viteFinal=async(config,options)=>{var _a,_b;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");if(legacyRootApi||!isReact18)return config;let alias=Array.isArray((_a=config.resolve)==null?void 0:_a.alias)?config.resolve.alias.concat({find:/^@storybook\/react-dom-shim$/,replacement:"@storybook/react-dom-shim/dist/react-18"}):{...(_b=config.resolve)==null?void 0:_b.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"};return{...config,resolve:{...config.resolve,alias}}};0&&(module.exports={viteFinal,webpackFinal});
4 changes: 2 additions & 2 deletions __fixtures__/fragment-test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@redwoodjs/router": "7.0.0",
"@redwoodjs/web": "7.0.0",
"humanize-string": "2.1.0",
"react": "18.3.0-canary-a870b2d54-20240314",
"react-dom": "18.3.0-canary-a870b2d54-20240314"
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/react/hooks/internal/useRenderGuard.js b/react/hooks/internal/useRenderGuard.js
index 15551e6e2de4dcc585e9426f80c67cb136ecd2a7..181e74a378c59779e83b698cb1923602cf845813 100644
--- a/react/hooks/internal/useRenderGuard.js
+++ b/react/hooks/internal/useRenderGuard.js
@@ -1,7 +1,9 @@
-import * as React from "rehackt";
+import React from "rehackt";
function getRenderDispatcher() {
- var _a, _b;
- return (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentDispatcher || r19.ReactCurrentDispatcher;
+ return _b === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
/*
diff --git a/testing/internal/profile/profile.js b/testing/internal/profile/profile.js
index bcb709e4a7f6a72b381632e6da6a5c7d9ab5d8f1..362dcd3e577beb62f14bdb61a72debebaaf212ff 100644
--- a/testing/internal/profile/profile.js
+++ b/testing/internal/profile/profile.js
@@ -276,8 +276,11 @@ export function profileHook(renderCallback) {
});
}
function resolveHookOwner() {
- var _a, _b, _c;
- return (_c = (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentOwner) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentOwner || r19.ReactCurrentOwner;
+ var _c;
+ return (_c = _b === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
}
export function useTrackRenders(_a) {
var _b = _a === void 0 ? {} : _a, name = _b.name;
4 changes: 2 additions & 2 deletions __fixtures__/test-project-rsa/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@redwoodjs/forms": "8.0.0-canary.144",
"@redwoodjs/router": "8.0.0-canary.144",
"@redwoodjs/web": "8.0.0-canary.144",
"react": "18.3.0-canary-a870b2d54-20240314",
"react-dom": "18.3.0-canary-a870b2d54-20240314"
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
},
"devDependencies": {
"@redwoodjs/vite": "8.0.0-canary.144",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/react/hooks/internal/useRenderGuard.js b/react/hooks/internal/useRenderGuard.js
index 15551e6e2de4dcc585e9426f80c67cb136ecd2a7..181e74a378c59779e83b698cb1923602cf845813 100644
--- a/react/hooks/internal/useRenderGuard.js
+++ b/react/hooks/internal/useRenderGuard.js
@@ -1,7 +1,9 @@
-import * as React from "rehackt";
+import React from "rehackt";
function getRenderDispatcher() {
- var _a, _b;
- return (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentDispatcher || r19.ReactCurrentDispatcher;
+ return _b === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
/*
diff --git a/testing/internal/profile/profile.js b/testing/internal/profile/profile.js
index bcb709e4a7f6a72b381632e6da6a5c7d9ab5d8f1..362dcd3e577beb62f14bdb61a72debebaaf212ff 100644
--- a/testing/internal/profile/profile.js
+++ b/testing/internal/profile/profile.js
@@ -276,8 +276,11 @@ export function profileHook(renderCallback) {
});
}
function resolveHookOwner() {
- var _a, _b, _c;
- return (_c = (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentOwner) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentOwner || r19.ReactCurrentOwner;
+ var _c;
+ return (_c = _b === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
}
export function useTrackRenders(_a) {
var _b = _a === void 0 ? {} : _a, name = _b.name;
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@redwoodjs/web": "7.0.0-canary.1011",
"@tobbe.dev/rsc-test": "0.0.5",
"client-only": "0.0.1",
"react": "18.3.0-canary-a870b2d54-20240314",
"react-dom": "18.3.0-canary-a870b2d54-20240314"
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0-canary.1011",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/react/hooks/internal/useRenderGuard.js b/react/hooks/internal/useRenderGuard.js
index 15551e6e2de4dcc585e9426f80c67cb136ecd2a7..181e74a378c59779e83b698cb1923602cf845813 100644
--- a/react/hooks/internal/useRenderGuard.js
+++ b/react/hooks/internal/useRenderGuard.js
@@ -1,7 +1,9 @@
-import * as React from "rehackt";
+import React from "rehackt";
function getRenderDispatcher() {
- var _a, _b;
- return (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentDispatcher || r19.ReactCurrentDispatcher;
+ return _b === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
/*
diff --git a/testing/internal/profile/profile.js b/testing/internal/profile/profile.js
index bcb709e4a7f6a72b381632e6da6a5c7d9ab5d8f1..362dcd3e577beb62f14bdb61a72debebaaf212ff 100644
--- a/testing/internal/profile/profile.js
+++ b/testing/internal/profile/profile.js
@@ -276,8 +276,11 @@ export function profileHook(renderCallback) {
});
}
function resolveHookOwner() {
- var _a, _b, _c;
- return (_c = (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentOwner) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
+ var r18 = typeof React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== "undefined" ? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED : {};
+ var r19 = typeof React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE !== "undefined" ? React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE : {};
+ var _b = r18.ReactCurrentOwner || r19.ReactCurrentOwner;
+ var _c;
+ return (_c = _b === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
}
export function useTrackRenders(_a) {
var _b = _a === void 0 ? {} : _a, name = _b.name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/dist/preset.js b/dist/preset.js
index e136e7e4efc61bc2596c91b12bae8748cd48226f..578c2e77cd58176ad441a8fe83d384016008bbfe 100644
--- a/dist/preset.js
+++ b/dist/preset.js
@@ -1 +1 @@
-"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{viteFinal:()=>viteFinal,webpackFinal:()=>webpackFinal});module.exports=__toCommonJS(preset_exports);var import_package=require("react-dom/package.json"),webpackFinal=async(config,options)=>{var _a;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");return legacyRootApi??!isReact18?config:{...config,resolve:{...config.resolve,alias:{...(_a=config.resolve)==null?void 0:_a.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"}}}},viteFinal=async(config,options)=>{var _a,_b;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");if(legacyRootApi||!isReact18)return config;let alias=Array.isArray((_a=config.resolve)==null?void 0:_a.alias)?config.resolve.alias.concat({find:/^@storybook\/react-dom-shim$/,replacement:"@storybook/react-dom-shim/dist/react-18"}):{...(_b=config.resolve)==null?void 0:_b.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"};return{...config,resolve:{...config.resolve,alias}}};0&&(module.exports={viteFinal,webpackFinal});
+"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{viteFinal:()=>viteFinal,webpackFinal:()=>webpackFinal});module.exports=__toCommonJS(preset_exports);var import_package=require("react-dom/package.json"),webpackFinal=async(config,options)=>{var _a;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("19")||import_package.version.startsWith("0.0.0");return legacyRootApi??!isReact18?config:{...config,resolve:{...config.resolve,alias:{...(_a=config.resolve)==null?void 0:_a.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"}}}},viteFinal=async(config,options)=>{var _a,_b;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");if(legacyRootApi||!isReact18)return config;let alias=Array.isArray((_a=config.resolve)==null?void 0:_a.alias)?config.resolve.alias.concat({find:/^@storybook\/react-dom-shim$/,replacement:"@storybook/react-dom-shim/dist/react-18"}):{...(_b=config.resolve)==null?void 0:_b.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-18"};return{...config,resolve:{...config.resolve,alias}}};0&&(module.exports={viteFinal,webpackFinal});
5 changes: 4 additions & 1 deletion __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"prisma": {
"seed": "yarn rw exec seed"
},
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.1.1",
"resolutions": {
"@storybook/react-dom-shim@npm:7.6.17": "patch:@storybook/react-dom-shim@npm%3A7.6.17#~/.yarn/patches/@storybook-react-dom-shim-npm-7.6.17-789bc900f0.patch"
}
}
Loading

0 comments on commit 1ed2650

Please sign in to comment.