@remix-run/react
Advanced tools
Comparing version 2.11.0 to 2.11.1-pre.0
# `@remix-run/react` | ||
## 2.11.1-pre.0 | ||
### Patch Changes | ||
- Revert #9695, stop infinite reload. ([`6dd275797`](https://github.com/remix-run/remix/commit/6dd2757977d9029501b399f02c83d1010df692d1)) | ||
- Updated dependencies: | ||
- `@remix-run/server-runtime@2.11.1-pre.0` | ||
## 2.11.0 | ||
@@ -4,0 +12,0 @@ |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
@@ -7,3 +7,3 @@ import type { HydrationState, Router } from "@remix-run/router"; | ||
var __remixContext: { | ||
ssrMatches: string[]; | ||
url: string; | ||
basename?: string; | ||
@@ -10,0 +10,0 @@ state: HydrationState; |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -75,2 +75,20 @@ * Copyright (c) Remix Software Inc. | ||
if (!router) { | ||
// Hard reload if the path we tried to load is not the current path. | ||
// This is usually the result of 2 rapid back/forward clicks from an | ||
// external site into a Remix app, where we initially start the load for | ||
// one URL and while the JS chunks are loading a second forward click moves | ||
// us to a new URL. Avoid comparing search params because of CDNs which | ||
// can be configured to ignore certain params and only pathname is relevant | ||
// towards determining the route matches. | ||
let initialPathname = window.__remixContext.url; | ||
let hydratedPathname = window.location.pathname; | ||
if (initialPathname !== hydratedPathname && !window.__remixContext.isSpaMode) { | ||
let errorMsg = `Initial URL (${initialPathname}) does not match URL at time of hydration ` + `(${hydratedPathname}), reloading page...`; | ||
console.error(errorMsg); | ||
window.location.reload(); | ||
// Get out of here so the reload can happen - don't create the router | ||
// since it'll then kick off unnecessary route.lazy() loads | ||
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null); | ||
} | ||
// When single fetch is enabled, we need to suspend until the initial state | ||
@@ -116,24 +134,2 @@ // snapshot is decoded into window.__remixContext.state | ||
let initialMatches = reactRouterDom.matchRoutes(routes$1, window.location, window.__remixContext.basename); | ||
// Hard reload if the matches we rendered on the server aren't the matches | ||
// we matched in the client, otherwise we'll try to hydrate without the | ||
// right modules and throw a hydration error, which can put React into an | ||
// infinite hydration loop when hydrating the full `<html>` document. | ||
// This is usually the result of 2 rapid back/forward clicks from an | ||
// external site into a Remix app, where we initially start the load for | ||
// one URL and while the JS chunks are loading a second forward click moves | ||
// us to a new URL. | ||
let ssrMatches = window.__remixContext.ssrMatches; | ||
let hasDifferentSSRMatches = (initialMatches || []).length !== ssrMatches.length || !(initialMatches || []).every((m, i) => ssrMatches[i] === m.route.id); | ||
if (hasDifferentSSRMatches && !window.__remixContext.isSpaMode) { | ||
let ssr = ssrMatches.join(","); | ||
let client = (initialMatches || []).map(m => m.route.id).join(","); | ||
let errorMsg = `SSR Matches (${ssr}) do not match client matches (${client}) at ` + `time of hydration , reloading page...`; | ||
console.error(errorMsg); | ||
window.location.reload(); | ||
// Get out of here so the reload can happen - don't create the router | ||
// since it'll then kick off unnecessary route.lazy() loads | ||
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null); | ||
} | ||
if (initialMatches) { | ||
@@ -140,0 +136,0 @@ for (let match of initialMatches) { |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -115,2 +115,20 @@ * Copyright (c) Remix Software Inc. | ||
if (!router) { | ||
// Hard reload if the path we tried to load is not the current path. | ||
// This is usually the result of 2 rapid back/forward clicks from an | ||
// external site into a Remix app, where we initially start the load for | ||
// one URL and while the JS chunks are loading a second forward click moves | ||
// us to a new URL. Avoid comparing search params because of CDNs which | ||
// can be configured to ignore certain params and only pathname is relevant | ||
// towards determining the route matches. | ||
let initialPathname = window.__remixContext.url; | ||
let hydratedPathname = window.location.pathname; | ||
if (initialPathname !== hydratedPathname && !window.__remixContext.isSpaMode) { | ||
let errorMsg = `Initial URL (${initialPathname}) does not match URL at time of hydration ` + `(${hydratedPathname}), reloading page...`; | ||
console.error(errorMsg); | ||
window.location.reload(); | ||
// Get out of here so the reload can happen - don't create the router | ||
// since it'll then kick off unnecessary route.lazy() loads | ||
return /*#__PURE__*/React.createElement(React.Fragment, null); | ||
} | ||
// When single fetch is enabled, we need to suspend until the initial state | ||
@@ -156,24 +174,2 @@ // snapshot is decoded into window.__remixContext.state | ||
let initialMatches = matchRoutes(routes, window.location, window.__remixContext.basename); | ||
// Hard reload if the matches we rendered on the server aren't the matches | ||
// we matched in the client, otherwise we'll try to hydrate without the | ||
// right modules and throw a hydration error, which can put React into an | ||
// infinite hydration loop when hydrating the full `<html>` document. | ||
// This is usually the result of 2 rapid back/forward clicks from an | ||
// external site into a Remix app, where we initially start the load for | ||
// one URL and while the JS chunks are loading a second forward click moves | ||
// us to a new URL. | ||
let ssrMatches = window.__remixContext.ssrMatches; | ||
let hasDifferentSSRMatches = (initialMatches || []).length !== ssrMatches.length || !(initialMatches || []).every((m, i) => ssrMatches[i] === m.route.id); | ||
if (hasDifferentSSRMatches && !window.__remixContext.isSpaMode) { | ||
let ssr = ssrMatches.join(","); | ||
let client = (initialMatches || []).map(m => m.route.id).join(","); | ||
let errorMsg = `SSR Matches (${ssr}) do not match client matches (${client}) at ` + `time of hydration , reloading page...`; | ||
console.error(errorMsg); | ||
window.location.reload(); | ||
// Get out of here so the reload can happen - don't create the router | ||
// since it'll then kick off unnecessary route.lazy() loads | ||
return /*#__PURE__*/React.createElement(React.Fragment, null); | ||
} | ||
if (initialMatches) { | ||
@@ -180,0 +176,0 @@ for (let match of initialMatches) { |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v2.11.0 | ||
* @remix-run/react v2.11.1-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
{ | ||
"name": "@remix-run/react", | ||
"version": "2.11.0", | ||
"version": "2.11.1-pre.0", | ||
"description": "React DOM bindings for Remix", | ||
@@ -23,3 +23,3 @@ "bugs": { | ||
"turbo-stream": "2.2.0", | ||
"@remix-run/server-runtime": "2.11.0" | ||
"@remix-run/server-runtime": "2.11.1-pre.0" | ||
}, | ||
@@ -34,4 +34,4 @@ "devDependencies": { | ||
"typescript": "^5.1.6", | ||
"@remix-run/node": "2.11.0", | ||
"@remix-run/react": "2.11.0" | ||
"@remix-run/node": "2.11.1-pre.0", | ||
"@remix-run/react": "2.11.1-pre.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
357576
7509
2
+ Added@remix-run/server-runtime@2.11.1-pre.0(transitive)
- Removed@remix-run/server-runtime@2.11.0(transitive)