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

Upgrade to React v18.2 #1571

Merged
merged 7 commits into from Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silver-buses-warn.md
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Upgrade Hydrogen to React v18.2. To update your app, run `yarn add @shopify/hydrogen@latest react@latest react-dom@latest`.
4 changes: 2 additions & 2 deletions examples/api-routes/package.json
Expand Up @@ -20,8 +20,8 @@
"@shopify/hydrogen": "latest",
"body-parser": "^1.20.0",
"compression": "^1.7.4",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"serve-static": "^1.14.1"
}
}
4 changes: 2 additions & 2 deletions examples/css-modules/package.json
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@shopify/hydrogen": "latest",
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
4 changes: 2 additions & 2 deletions examples/google-analytics/package.json
Expand Up @@ -20,8 +20,8 @@
"@shopify/hydrogen": "latest",
"body-parser": "^1.20.0",
"compression": "^1.7.4",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"serve-static": "^1.14.1"
}
}
4 changes: 2 additions & 2 deletions examples/meta-pixel/package.json
Expand Up @@ -20,8 +20,8 @@
"@shopify/hydrogen": "latest",
"body-parser": "^1.20.0",
"compression": "^1.7.4",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"serve-static": "^1.14.1"
}
}
4 changes: 2 additions & 2 deletions packages/hydrogen-ui/package.json
Expand Up @@ -69,8 +69,8 @@
"vitest": "^0.9.4"
},
"peerDependencies": {
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"type-fest": "^2.12.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/package.json
Expand Up @@ -91,8 +91,8 @@
"peerDependencies": {
"body-parser": "^1.20.0",
"compression": "^1.7.4",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"serve-static": "^1.14.1",
"vite": "^2.9.0"
},
Expand Down
19 changes: 1 addition & 18 deletions packages/hydrogen/src/entry-client.tsx
Expand Up @@ -125,8 +125,6 @@ const renderHydrogen: ClientHandler = async (ClientWrapper) => {
// Default to StrictMode on, unless explicitly turned off
config.strictMode !== false ? StrictMode : Fragment;

let hasCaughtError = false;

hydrateRoot(
root,
<>
Expand All @@ -137,22 +135,7 @@ const renderHydrogen: ClientHandler = async (ClientWrapper) => {
</Suspense>
</ErrorBoundary>
</RootComponent>
</>,
{
onRecoverableError(e: any) {
if (__HYDROGEN_DEV__ && !hasCaughtError) {
hasCaughtError = true;
console.log(
`React encountered an error while attempting to hydrate the application. ` +
`This is likely due to a bug in React's Suspense behavior related to experimental server components, ` +
`and it is safe to ignore this error.\n` +
`Visit this issue to learn more: https://github.com/Shopify/hydrogen/issues/920.\n\n` +
`The original error is printed below:`
);
console.log(e);
}
},
}
</>
);
};

Expand Down
4 changes: 2 additions & 2 deletions packages/playground/async-config/package.json
Expand Up @@ -19,7 +19,7 @@
"@cloudflare/kv-asset-handler": "*",
"@shopify/hydrogen": "^0.24.0",
"miniflare": "^1.3.3",
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
4 changes: 2 additions & 2 deletions packages/playground/server-components/package.json
Expand Up @@ -19,7 +19,7 @@
"@cloudflare/kv-asset-handler": "*",
"@shopify/hydrogen": "^0.24.0",
"miniflare": "^1.3.3",
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}