Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(deps): update React to latest canary 19.x #10482

Merged
merged 29 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f61d58b
fix(deps): update React to latest canary 19.x
Tobbe Apr 19, 2024
bfa9325
Merge branch 'main' into tobbe-chore-react-canary-upgrade
Tobbe Apr 20, 2024
1349041
Patch @apollo/client to work with React 19
Tobbe Apr 20, 2024
685f40c
Update yarn.lock
Tobbe Apr 20, 2024
27b18f8
more apollo patching
Tobbe Apr 20, 2024
a346fb5
Add apollo patches to test projects
Tobbe Apr 20, 2024
13c36e8
Temporarily handle yarn patch files
Tobbe Apr 20, 2024
c9d3871
Restore rebuild script
Tobbe Apr 20, 2024
86eaa98
include patch in crwa template
Tobbe Apr 20, 2024
39858dc
debug ci
Tobbe Apr 20, 2024
7cd4e8c
update crwa templates test
Tobbe Apr 20, 2024
1b99d0f
tree node_modules
Tobbe Apr 20, 2024
87c71fd
modify patch
Tobbe Apr 20, 2024
d2a8f51
update yarn.lock
Tobbe Apr 20, 2024
f93f01f
update patches
Tobbe Apr 20, 2024
172b4da
update js template test
Tobbe Apr 20, 2024
e8470ca
require instead of import
Tobbe Apr 20, 2024
07ccf78
update patches
Tobbe Apr 20, 2024
0037e74
update patches again
Tobbe Apr 20, 2024
feb0d68
try import React
Tobbe Apr 20, 2024
5091965
yarn.lock
Tobbe Apr 20, 2024
2978e29
new patches
Tobbe Apr 20, 2024
7da6965
update crwa template patch files
Tobbe Apr 20, 2024
d153dbf
More projects with patch files
Tobbe Apr 20, 2024
9301b15
Merge branch 'main' into tobbe-chore-react-canary-upgrade
Tobbe Apr 20, 2024
cd3ae57
patch storybook
Tobbe Apr 20, 2024
fb1423c
sb patch resolutions
Tobbe Apr 20, 2024
a60019c
update crwa template test
Tobbe Apr 20, 2024
8ca6066
Merge branch 'main' into tobbe-chore-react-canary-upgrade
Tobbe Apr 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading