Skip to content

Commit

Permalink
Upgrade to React v18.2 (#1571)
Browse files Browse the repository at this point in the history
* Upgrade to React 18.2

* Remove error catching for Suspense bug

* Remove unnecessary Suspense boundaries

* Add changeset

* Revert bad types update

* Fix types version again

* hello darkness my old friend
  • Loading branch information
jplhomer committed Jun 15, 2022
1 parent 2f75247 commit accdc78
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 18,785 deletions.
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 @@ -128,8 +128,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 @@ -140,22 +138,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"
}
}

0 comments on commit accdc78

Please sign in to comment.