react-router 0.0.0-experimental-a25eed86d → 0.0.0-experimental-ab0e85b04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/{chunk-JS5R3RPS.mjs → chunk-EBUZVJTZ.mjs} +27 -22
- package/dist/development/dom-export.js +25 -20
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.js +27 -22
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/route-module.d.mts +1 -1
- package/dist/development/lib/types/route-module.d.ts +1 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/production/{chunk-N6ZF3R6Q.mjs → chunk-3F6ADOVA.mjs} +27 -22
- package/dist/production/dom-export.js +25 -20
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.js +27 -22
- package/dist/production/index.mjs +2 -2
- package/dist/production/lib/types/route-module.d.mts +1 -1
- package/dist/production/lib/types/route-module.d.ts +1 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -307,14 +307,7 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
function createURL(to) {
|
|
310
|
-
|
|
311
|
-
let href2 = typeof to === "string" ? to : createPath(to);
|
|
312
|
-
href2 = href2.replace(/ $/, "%20");
|
|
313
|
-
invariant(
|
|
314
|
-
base,
|
|
315
|
-
`No window.location.(origin|href) available to create URL for href: ${href2}`
|
|
316
|
-
);
|
|
317
|
-
return new URL(href2, base);
|
|
310
|
+
return createBrowserURLImpl(to);
|
|
318
311
|
}
|
|
319
312
|
let history = {
|
|
320
313
|
get action() {
|
|
@@ -354,6 +347,19 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
354
347
|
};
|
|
355
348
|
return history;
|
|
356
349
|
}
|
|
350
|
+
function createBrowserURLImpl(to, isAbsolute = false) {
|
|
351
|
+
let base = "http://localhost";
|
|
352
|
+
if (typeof window !== "undefined") {
|
|
353
|
+
base = window.location.origin !== "null" ? window.location.origin : window.location.href;
|
|
354
|
+
}
|
|
355
|
+
invariant(base, "No window.location.(origin|href) available to create URL");
|
|
356
|
+
let href2 = typeof to === "string" ? to : createPath(to);
|
|
357
|
+
href2 = href2.replace(/ $/, "%20");
|
|
358
|
+
if (!isAbsolute && href2.startsWith("//")) {
|
|
359
|
+
href2 = base + href2;
|
|
360
|
+
}
|
|
361
|
+
return new URL(href2, base);
|
|
362
|
+
}
|
|
357
363
|
|
|
358
364
|
// lib/router/utils.ts
|
|
359
365
|
function unstable_createContext(defaultValue) {
|
|
@@ -2206,7 +2212,7 @@ function createRouter(init) {
|
|
|
2206
2212
|
if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
|
|
2207
2213
|
isDocumentReload = true;
|
|
2208
2214
|
} else if (ABSOLUTE_URL_REGEX.test(location)) {
|
|
2209
|
-
const url =
|
|
2215
|
+
const url = createBrowserURLImpl(location, true);
|
|
2210
2216
|
isDocumentReload = // Hard reload if it's an absolute URL to a new origin
|
|
2211
2217
|
url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2212
2218
|
stripBasename(url.pathname, basename) == null;
|
|
@@ -4788,10 +4794,10 @@ var RouteContext = React.createContext({
|
|
|
4788
4794
|
RouteContext.displayName = "Route";
|
|
4789
4795
|
var RouteErrorContext = React.createContext(null);
|
|
4790
4796
|
RouteErrorContext.displayName = "RouteError";
|
|
4797
|
+
var ENABLE_DEV_WARNINGS = true;
|
|
4791
4798
|
|
|
4792
4799
|
// lib/hooks.tsx
|
|
4793
4800
|
import * as React2 from "react";
|
|
4794
|
-
var ENABLE_DEV_WARNINGS = true;
|
|
4795
4801
|
function useHref(to, { relative } = {}) {
|
|
4796
4802
|
invariant(
|
|
4797
4803
|
useInRouterContext(),
|
|
@@ -5373,7 +5379,6 @@ function warnOnce(condition, message) {
|
|
|
5373
5379
|
}
|
|
5374
5380
|
|
|
5375
5381
|
// lib/components.tsx
|
|
5376
|
-
var ENABLE_DEV_WARNINGS2 = true;
|
|
5377
5382
|
function mapRouteProperties(route) {
|
|
5378
5383
|
let updates = {
|
|
5379
5384
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -5381,7 +5386,7 @@ function mapRouteProperties(route) {
|
|
|
5381
5386
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
5382
5387
|
};
|
|
5383
5388
|
if (route.Component) {
|
|
5384
|
-
if (
|
|
5389
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5385
5390
|
if (route.element) {
|
|
5386
5391
|
warning(
|
|
5387
5392
|
false,
|
|
@@ -5395,7 +5400,7 @@ function mapRouteProperties(route) {
|
|
|
5395
5400
|
});
|
|
5396
5401
|
}
|
|
5397
5402
|
if (route.HydrateFallback) {
|
|
5398
|
-
if (
|
|
5403
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5399
5404
|
if (route.hydrateFallbackElement) {
|
|
5400
5405
|
warning(
|
|
5401
5406
|
false,
|
|
@@ -5409,7 +5414,7 @@ function mapRouteProperties(route) {
|
|
|
5409
5414
|
});
|
|
5410
5415
|
}
|
|
5411
5416
|
if (route.ErrorBoundary) {
|
|
5412
|
-
if (
|
|
5417
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5413
5418
|
if (route.errorElement) {
|
|
5414
5419
|
warning(
|
|
5415
5420
|
false,
|
|
@@ -6791,14 +6796,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
6791
6796
|
dangerouslySetInnerHTML: {
|
|
6792
6797
|
__html: `
|
|
6793
6798
|
console.log(
|
|
6794
|
-
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://
|
|
6799
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
6795
6800
|
);
|
|
6796
6801
|
`
|
|
6797
6802
|
}
|
|
6798
6803
|
}
|
|
6799
6804
|
);
|
|
6800
6805
|
if (isRouteErrorResponse(error)) {
|
|
6801
|
-
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
6806
|
+
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), ENABLE_DEV_WARNINGS ? heyDeveloper : null);
|
|
6802
6807
|
}
|
|
6803
6808
|
let errorInstance;
|
|
6804
6809
|
if (error instanceof Error) {
|
|
@@ -6851,7 +6856,7 @@ function BoundaryShell({
|
|
|
6851
6856
|
// lib/dom/ssr/fallback.tsx
|
|
6852
6857
|
import * as React6 from "react";
|
|
6853
6858
|
function RemixRootDefaultHydrateFallback() {
|
|
6854
|
-
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React6.createElement(
|
|
6859
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, ENABLE_DEV_WARNINGS ? /* @__PURE__ */ React6.createElement(
|
|
6855
6860
|
"script",
|
|
6856
6861
|
{
|
|
6857
6862
|
dangerouslySetInnerHTML: {
|
|
@@ -6859,13 +6864,13 @@ function RemixRootDefaultHydrateFallback() {
|
|
|
6859
6864
|
console.log(
|
|
6860
6865
|
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
|
|
6861
6866
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
6862
|
-
"functions. Check out https://
|
|
6867
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
6863
6868
|
"for more information."
|
|
6864
6869
|
);
|
|
6865
6870
|
`
|
|
6866
6871
|
}
|
|
6867
6872
|
}
|
|
6868
|
-
));
|
|
6873
|
+
) : null);
|
|
6869
6874
|
}
|
|
6870
6875
|
|
|
6871
6876
|
// lib/dom/ssr/routes.tsx
|
|
@@ -7969,7 +7974,7 @@ function mergeRefs(...refs) {
|
|
|
7969
7974
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7970
7975
|
try {
|
|
7971
7976
|
if (isBrowser) {
|
|
7972
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
7977
|
+
window.__reactRouterVersion = "0.0.0-experimental-ab0e85b04";
|
|
7973
7978
|
}
|
|
7974
7979
|
} catch (e) {
|
|
7975
7980
|
}
|
|
@@ -9228,7 +9233,7 @@ function processRoutes(routes, manifest, routeModules, parentId) {
|
|
|
9228
9233
|
import { parse, serialize } from "cookie";
|
|
9229
9234
|
|
|
9230
9235
|
// lib/server-runtime/crypto.ts
|
|
9231
|
-
var encoder = new TextEncoder();
|
|
9236
|
+
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
9232
9237
|
var sign = async (value, secret) => {
|
|
9233
9238
|
let data2 = encoder.encode(value);
|
|
9234
9239
|
let key = await createKey2(secret, ["sign"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -202,14 +202,7 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options =
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
function createURL(to) {
|
|
205
|
-
|
|
206
|
-
let href = typeof to === "string" ? to : createPath(to);
|
|
207
|
-
href = href.replace(/ $/, "%20");
|
|
208
|
-
invariant(
|
|
209
|
-
base,
|
|
210
|
-
`No window.location.(origin|href) available to create URL for href: ${href}`
|
|
211
|
-
);
|
|
212
|
-
return new URL(href, base);
|
|
205
|
+
return createBrowserURLImpl(to);
|
|
213
206
|
}
|
|
214
207
|
let history = {
|
|
215
208
|
get action() {
|
|
@@ -249,6 +242,19 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options =
|
|
|
249
242
|
};
|
|
250
243
|
return history;
|
|
251
244
|
}
|
|
245
|
+
function createBrowserURLImpl(to, isAbsolute = false) {
|
|
246
|
+
let base = "http://localhost";
|
|
247
|
+
if (typeof window !== "undefined") {
|
|
248
|
+
base = window.location.origin !== "null" ? window.location.origin : window.location.href;
|
|
249
|
+
}
|
|
250
|
+
invariant(base, "No window.location.(origin|href) available to create URL");
|
|
251
|
+
let href = typeof to === "string" ? to : createPath(to);
|
|
252
|
+
href = href.replace(/ $/, "%20");
|
|
253
|
+
if (!isAbsolute && href.startsWith("//")) {
|
|
254
|
+
href = base + href;
|
|
255
|
+
}
|
|
256
|
+
return new URL(href, base);
|
|
257
|
+
}
|
|
252
258
|
|
|
253
259
|
// lib/router/utils.ts
|
|
254
260
|
var _map;
|
|
@@ -2060,7 +2066,7 @@ function createRouter(init) {
|
|
|
2060
2066
|
if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
|
|
2061
2067
|
isDocumentReload = true;
|
|
2062
2068
|
} else if (ABSOLUTE_URL_REGEX.test(location)) {
|
|
2063
|
-
const url =
|
|
2069
|
+
const url = createBrowserURLImpl(location, true);
|
|
2064
2070
|
isDocumentReload = // Hard reload if it's an absolute URL to a new origin
|
|
2065
2071
|
url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2066
2072
|
stripBasename(url.pathname, basename) == null;
|
|
@@ -4025,10 +4031,10 @@ var RouteContext = React.createContext({
|
|
|
4025
4031
|
RouteContext.displayName = "Route";
|
|
4026
4032
|
var RouteErrorContext = React.createContext(null);
|
|
4027
4033
|
RouteErrorContext.displayName = "RouteError";
|
|
4034
|
+
var ENABLE_DEV_WARNINGS = true;
|
|
4028
4035
|
|
|
4029
4036
|
// lib/hooks.tsx
|
|
4030
4037
|
var React2 = __toESM(require("react"));
|
|
4031
|
-
var ENABLE_DEV_WARNINGS = true;
|
|
4032
4038
|
function useInRouterContext() {
|
|
4033
4039
|
return React2.useContext(LocationContext) != null;
|
|
4034
4040
|
}
|
|
@@ -4370,7 +4376,6 @@ function warnOnce(condition, message) {
|
|
|
4370
4376
|
}
|
|
4371
4377
|
|
|
4372
4378
|
// lib/components.tsx
|
|
4373
|
-
var ENABLE_DEV_WARNINGS2 = true;
|
|
4374
4379
|
function mapRouteProperties(route) {
|
|
4375
4380
|
let updates = {
|
|
4376
4381
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -4378,7 +4383,7 @@ function mapRouteProperties(route) {
|
|
|
4378
4383
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
4379
4384
|
};
|
|
4380
4385
|
if (route.Component) {
|
|
4381
|
-
if (
|
|
4386
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
4382
4387
|
if (route.element) {
|
|
4383
4388
|
warning(
|
|
4384
4389
|
false,
|
|
@@ -4392,7 +4397,7 @@ function mapRouteProperties(route) {
|
|
|
4392
4397
|
});
|
|
4393
4398
|
}
|
|
4394
4399
|
if (route.HydrateFallback) {
|
|
4395
|
-
if (
|
|
4400
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
4396
4401
|
if (route.hydrateFallbackElement) {
|
|
4397
4402
|
warning(
|
|
4398
4403
|
false,
|
|
@@ -4406,7 +4411,7 @@ function mapRouteProperties(route) {
|
|
|
4406
4411
|
});
|
|
4407
4412
|
}
|
|
4408
4413
|
if (route.ErrorBoundary) {
|
|
4409
|
-
if (
|
|
4414
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
4410
4415
|
if (route.errorElement) {
|
|
4411
4416
|
warning(
|
|
4412
4417
|
false,
|
|
@@ -5248,14 +5253,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
5248
5253
|
dangerouslySetInnerHTML: {
|
|
5249
5254
|
__html: `
|
|
5250
5255
|
console.log(
|
|
5251
|
-
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://
|
|
5256
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
5252
5257
|
);
|
|
5253
5258
|
`
|
|
5254
5259
|
}
|
|
5255
5260
|
}
|
|
5256
5261
|
);
|
|
5257
5262
|
if (isRouteErrorResponse(error)) {
|
|
5258
|
-
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
5263
|
+
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), ENABLE_DEV_WARNINGS ? heyDeveloper : null);
|
|
5259
5264
|
}
|
|
5260
5265
|
let errorInstance;
|
|
5261
5266
|
if (error instanceof Error) {
|
|
@@ -5308,7 +5313,7 @@ function BoundaryShell({
|
|
|
5308
5313
|
// lib/dom/ssr/fallback.tsx
|
|
5309
5314
|
var React6 = __toESM(require("react"));
|
|
5310
5315
|
function RemixRootDefaultHydrateFallback() {
|
|
5311
|
-
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React6.createElement(
|
|
5316
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, ENABLE_DEV_WARNINGS ? /* @__PURE__ */ React6.createElement(
|
|
5312
5317
|
"script",
|
|
5313
5318
|
{
|
|
5314
5319
|
dangerouslySetInnerHTML: {
|
|
@@ -5316,13 +5321,13 @@ function RemixRootDefaultHydrateFallback() {
|
|
|
5316
5321
|
console.log(
|
|
5317
5322
|
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
|
|
5318
5323
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
5319
|
-
"functions. Check out https://
|
|
5324
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
5320
5325
|
"for more information."
|
|
5321
5326
|
);
|
|
5322
5327
|
`
|
|
5323
5328
|
}
|
|
5324
5329
|
}
|
|
5325
|
-
));
|
|
5330
|
+
) : null);
|
|
5326
5331
|
}
|
|
5327
5332
|
|
|
5328
5333
|
// lib/dom/ssr/routes.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
invariant,
|
|
26
26
|
mapRouteProperties,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-EBUZVJTZ.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -457,14 +457,7 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
function createURL(to) {
|
|
460
|
-
|
|
461
|
-
let href2 = typeof to === "string" ? to : createPath(to);
|
|
462
|
-
href2 = href2.replace(/ $/, "%20");
|
|
463
|
-
invariant(
|
|
464
|
-
base,
|
|
465
|
-
`No window.location.(origin|href) available to create URL for href: ${href2}`
|
|
466
|
-
);
|
|
467
|
-
return new URL(href2, base);
|
|
460
|
+
return createBrowserURLImpl(to);
|
|
468
461
|
}
|
|
469
462
|
let history = {
|
|
470
463
|
get action() {
|
|
@@ -504,6 +497,19 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
504
497
|
};
|
|
505
498
|
return history;
|
|
506
499
|
}
|
|
500
|
+
function createBrowserURLImpl(to, isAbsolute = false) {
|
|
501
|
+
let base = "http://localhost";
|
|
502
|
+
if (typeof window !== "undefined") {
|
|
503
|
+
base = window.location.origin !== "null" ? window.location.origin : window.location.href;
|
|
504
|
+
}
|
|
505
|
+
invariant(base, "No window.location.(origin|href) available to create URL");
|
|
506
|
+
let href2 = typeof to === "string" ? to : createPath(to);
|
|
507
|
+
href2 = href2.replace(/ $/, "%20");
|
|
508
|
+
if (!isAbsolute && href2.startsWith("//")) {
|
|
509
|
+
href2 = base + href2;
|
|
510
|
+
}
|
|
511
|
+
return new URL(href2, base);
|
|
512
|
+
}
|
|
507
513
|
|
|
508
514
|
// lib/router/utils.ts
|
|
509
515
|
function unstable_createContext(defaultValue) {
|
|
@@ -2356,7 +2362,7 @@ function createRouter(init) {
|
|
|
2356
2362
|
if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
|
|
2357
2363
|
isDocumentReload = true;
|
|
2358
2364
|
} else if (ABSOLUTE_URL_REGEX.test(location)) {
|
|
2359
|
-
const url =
|
|
2365
|
+
const url = createBrowserURLImpl(location, true);
|
|
2360
2366
|
isDocumentReload = // Hard reload if it's an absolute URL to a new origin
|
|
2361
2367
|
url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2362
2368
|
stripBasename(url.pathname, basename) == null;
|
|
@@ -4938,10 +4944,10 @@ var RouteContext = React.createContext({
|
|
|
4938
4944
|
RouteContext.displayName = "Route";
|
|
4939
4945
|
var RouteErrorContext = React.createContext(null);
|
|
4940
4946
|
RouteErrorContext.displayName = "RouteError";
|
|
4947
|
+
var ENABLE_DEV_WARNINGS = true;
|
|
4941
4948
|
|
|
4942
4949
|
// lib/hooks.tsx
|
|
4943
4950
|
var React2 = __toESM(require("react"));
|
|
4944
|
-
var ENABLE_DEV_WARNINGS = true;
|
|
4945
4951
|
function useHref(to, { relative } = {}) {
|
|
4946
4952
|
invariant(
|
|
4947
4953
|
useInRouterContext(),
|
|
@@ -5523,7 +5529,6 @@ function warnOnce(condition, message) {
|
|
|
5523
5529
|
}
|
|
5524
5530
|
|
|
5525
5531
|
// lib/components.tsx
|
|
5526
|
-
var ENABLE_DEV_WARNINGS2 = true;
|
|
5527
5532
|
function mapRouteProperties(route) {
|
|
5528
5533
|
let updates = {
|
|
5529
5534
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -5531,7 +5536,7 @@ function mapRouteProperties(route) {
|
|
|
5531
5536
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
5532
5537
|
};
|
|
5533
5538
|
if (route.Component) {
|
|
5534
|
-
if (
|
|
5539
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5535
5540
|
if (route.element) {
|
|
5536
5541
|
warning(
|
|
5537
5542
|
false,
|
|
@@ -5545,7 +5550,7 @@ function mapRouteProperties(route) {
|
|
|
5545
5550
|
});
|
|
5546
5551
|
}
|
|
5547
5552
|
if (route.HydrateFallback) {
|
|
5548
|
-
if (
|
|
5553
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5549
5554
|
if (route.hydrateFallbackElement) {
|
|
5550
5555
|
warning(
|
|
5551
5556
|
false,
|
|
@@ -5559,7 +5564,7 @@ function mapRouteProperties(route) {
|
|
|
5559
5564
|
});
|
|
5560
5565
|
}
|
|
5561
5566
|
if (route.ErrorBoundary) {
|
|
5562
|
-
if (
|
|
5567
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5563
5568
|
if (route.errorElement) {
|
|
5564
5569
|
warning(
|
|
5565
5570
|
false,
|
|
@@ -6941,14 +6946,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
6941
6946
|
dangerouslySetInnerHTML: {
|
|
6942
6947
|
__html: `
|
|
6943
6948
|
console.log(
|
|
6944
|
-
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://
|
|
6949
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
6945
6950
|
);
|
|
6946
6951
|
`
|
|
6947
6952
|
}
|
|
6948
6953
|
}
|
|
6949
6954
|
);
|
|
6950
6955
|
if (isRouteErrorResponse(error)) {
|
|
6951
|
-
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
6956
|
+
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), ENABLE_DEV_WARNINGS ? heyDeveloper : null);
|
|
6952
6957
|
}
|
|
6953
6958
|
let errorInstance;
|
|
6954
6959
|
if (error instanceof Error) {
|
|
@@ -7001,7 +7006,7 @@ function BoundaryShell({
|
|
|
7001
7006
|
// lib/dom/ssr/fallback.tsx
|
|
7002
7007
|
var React6 = __toESM(require("react"));
|
|
7003
7008
|
function RemixRootDefaultHydrateFallback() {
|
|
7004
|
-
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React6.createElement(
|
|
7009
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, ENABLE_DEV_WARNINGS ? /* @__PURE__ */ React6.createElement(
|
|
7005
7010
|
"script",
|
|
7006
7011
|
{
|
|
7007
7012
|
dangerouslySetInnerHTML: {
|
|
@@ -7009,13 +7014,13 @@ function RemixRootDefaultHydrateFallback() {
|
|
|
7009
7014
|
console.log(
|
|
7010
7015
|
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
|
|
7011
7016
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
7012
|
-
"functions. Check out https://
|
|
7017
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
7013
7018
|
"for more information."
|
|
7014
7019
|
);
|
|
7015
7020
|
`
|
|
7016
7021
|
}
|
|
7017
7022
|
}
|
|
7018
|
-
));
|
|
7023
|
+
) : null);
|
|
7019
7024
|
}
|
|
7020
7025
|
|
|
7021
7026
|
// lib/dom/ssr/routes.tsx
|
|
@@ -8119,7 +8124,7 @@ function mergeRefs(...refs) {
|
|
|
8119
8124
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8120
8125
|
try {
|
|
8121
8126
|
if (isBrowser) {
|
|
8122
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8127
|
+
window.__reactRouterVersion = "0.0.0-experimental-ab0e85b04";
|
|
8123
8128
|
}
|
|
8124
8129
|
} catch (e) {
|
|
8125
8130
|
}
|
|
@@ -9378,7 +9383,7 @@ function processRoutes(routes, manifest, routeModules, parentId) {
|
|
|
9378
9383
|
var import_cookie = require("cookie");
|
|
9379
9384
|
|
|
9380
9385
|
// lib/server-runtime/crypto.ts
|
|
9381
|
-
var encoder = new TextEncoder();
|
|
9386
|
+
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
9382
9387
|
var sign = async (value, secret) => {
|
|
9383
9388
|
let data2 = encoder.encode(value);
|
|
9384
9389
|
let key = await createKey2(secret, ["sign"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
useSearchParams,
|
|
126
126
|
useSubmit,
|
|
127
127
|
useViewTransitionState
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-EBUZVJTZ.mjs";
|
|
129
129
|
export {
|
|
130
130
|
Await,
|
|
131
131
|
BrowserRouter,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aE as LinkDescriptor, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.mjs';
|
|
1
|
+
import { aE as LinkDescriptor, L as Location, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.mjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
4
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aE as LinkDescriptor, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.js';
|
|
1
|
+
import { aE as LinkDescriptor, L as Location, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
4
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -307,14 +307,7 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
function createURL(to) {
|
|
310
|
-
|
|
311
|
-
let href2 = typeof to === "string" ? to : createPath(to);
|
|
312
|
-
href2 = href2.replace(/ $/, "%20");
|
|
313
|
-
invariant(
|
|
314
|
-
base,
|
|
315
|
-
`No window.location.(origin|href) available to create URL for href: ${href2}`
|
|
316
|
-
);
|
|
317
|
-
return new URL(href2, base);
|
|
310
|
+
return createBrowserURLImpl(to);
|
|
318
311
|
}
|
|
319
312
|
let history = {
|
|
320
313
|
get action() {
|
|
@@ -354,6 +347,19 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
354
347
|
};
|
|
355
348
|
return history;
|
|
356
349
|
}
|
|
350
|
+
function createBrowserURLImpl(to, isAbsolute = false) {
|
|
351
|
+
let base = "http://localhost";
|
|
352
|
+
if (typeof window !== "undefined") {
|
|
353
|
+
base = window.location.origin !== "null" ? window.location.origin : window.location.href;
|
|
354
|
+
}
|
|
355
|
+
invariant(base, "No window.location.(origin|href) available to create URL");
|
|
356
|
+
let href2 = typeof to === "string" ? to : createPath(to);
|
|
357
|
+
href2 = href2.replace(/ $/, "%20");
|
|
358
|
+
if (!isAbsolute && href2.startsWith("//")) {
|
|
359
|
+
href2 = base + href2;
|
|
360
|
+
}
|
|
361
|
+
return new URL(href2, base);
|
|
362
|
+
}
|
|
357
363
|
|
|
358
364
|
// lib/router/utils.ts
|
|
359
365
|
function unstable_createContext(defaultValue) {
|
|
@@ -2206,7 +2212,7 @@ function createRouter(init) {
|
|
|
2206
2212
|
if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
|
|
2207
2213
|
isDocumentReload = true;
|
|
2208
2214
|
} else if (ABSOLUTE_URL_REGEX.test(location)) {
|
|
2209
|
-
const url =
|
|
2215
|
+
const url = createBrowserURLImpl(location, true);
|
|
2210
2216
|
isDocumentReload = // Hard reload if it's an absolute URL to a new origin
|
|
2211
2217
|
url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2212
2218
|
stripBasename(url.pathname, basename) == null;
|
|
@@ -4788,10 +4794,10 @@ var RouteContext = React.createContext({
|
|
|
4788
4794
|
RouteContext.displayName = "Route";
|
|
4789
4795
|
var RouteErrorContext = React.createContext(null);
|
|
4790
4796
|
RouteErrorContext.displayName = "RouteError";
|
|
4797
|
+
var ENABLE_DEV_WARNINGS = false;
|
|
4791
4798
|
|
|
4792
4799
|
// lib/hooks.tsx
|
|
4793
4800
|
import * as React2 from "react";
|
|
4794
|
-
var ENABLE_DEV_WARNINGS = false;
|
|
4795
4801
|
function useHref(to, { relative } = {}) {
|
|
4796
4802
|
invariant(
|
|
4797
4803
|
useInRouterContext(),
|
|
@@ -5373,7 +5379,6 @@ function warnOnce(condition, message) {
|
|
|
5373
5379
|
}
|
|
5374
5380
|
|
|
5375
5381
|
// lib/components.tsx
|
|
5376
|
-
var ENABLE_DEV_WARNINGS2 = false;
|
|
5377
5382
|
function mapRouteProperties(route) {
|
|
5378
5383
|
let updates = {
|
|
5379
5384
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -5381,7 +5386,7 @@ function mapRouteProperties(route) {
|
|
|
5381
5386
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
5382
5387
|
};
|
|
5383
5388
|
if (route.Component) {
|
|
5384
|
-
if (
|
|
5389
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5385
5390
|
if (route.element) {
|
|
5386
5391
|
warning(
|
|
5387
5392
|
false,
|
|
@@ -5395,7 +5400,7 @@ function mapRouteProperties(route) {
|
|
|
5395
5400
|
});
|
|
5396
5401
|
}
|
|
5397
5402
|
if (route.HydrateFallback) {
|
|
5398
|
-
if (
|
|
5403
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5399
5404
|
if (route.hydrateFallbackElement) {
|
|
5400
5405
|
warning(
|
|
5401
5406
|
false,
|
|
@@ -5409,7 +5414,7 @@ function mapRouteProperties(route) {
|
|
|
5409
5414
|
});
|
|
5410
5415
|
}
|
|
5411
5416
|
if (route.ErrorBoundary) {
|
|
5412
|
-
if (
|
|
5417
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5413
5418
|
if (route.errorElement) {
|
|
5414
5419
|
warning(
|
|
5415
5420
|
false,
|
|
@@ -6791,14 +6796,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
6791
6796
|
dangerouslySetInnerHTML: {
|
|
6792
6797
|
__html: `
|
|
6793
6798
|
console.log(
|
|
6794
|
-
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://
|
|
6799
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
6795
6800
|
);
|
|
6796
6801
|
`
|
|
6797
6802
|
}
|
|
6798
6803
|
}
|
|
6799
6804
|
);
|
|
6800
6805
|
if (isRouteErrorResponse(error)) {
|
|
6801
|
-
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
6806
|
+
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), ENABLE_DEV_WARNINGS ? heyDeveloper : null);
|
|
6802
6807
|
}
|
|
6803
6808
|
let errorInstance;
|
|
6804
6809
|
if (error instanceof Error) {
|
|
@@ -6851,7 +6856,7 @@ function BoundaryShell({
|
|
|
6851
6856
|
// lib/dom/ssr/fallback.tsx
|
|
6852
6857
|
import * as React6 from "react";
|
|
6853
6858
|
function RemixRootDefaultHydrateFallback() {
|
|
6854
|
-
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React6.createElement(
|
|
6859
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, ENABLE_DEV_WARNINGS ? /* @__PURE__ */ React6.createElement(
|
|
6855
6860
|
"script",
|
|
6856
6861
|
{
|
|
6857
6862
|
dangerouslySetInnerHTML: {
|
|
@@ -6859,13 +6864,13 @@ function RemixRootDefaultHydrateFallback() {
|
|
|
6859
6864
|
console.log(
|
|
6860
6865
|
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
|
|
6861
6866
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
6862
|
-
"functions. Check out https://
|
|
6867
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
6863
6868
|
"for more information."
|
|
6864
6869
|
);
|
|
6865
6870
|
`
|
|
6866
6871
|
}
|
|
6867
6872
|
}
|
|
6868
|
-
));
|
|
6873
|
+
) : null);
|
|
6869
6874
|
}
|
|
6870
6875
|
|
|
6871
6876
|
// lib/dom/ssr/routes.tsx
|
|
@@ -7969,7 +7974,7 @@ function mergeRefs(...refs) {
|
|
|
7969
7974
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7970
7975
|
try {
|
|
7971
7976
|
if (isBrowser) {
|
|
7972
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
7977
|
+
window.__reactRouterVersion = "0.0.0-experimental-ab0e85b04";
|
|
7973
7978
|
}
|
|
7974
7979
|
} catch (e) {
|
|
7975
7980
|
}
|
|
@@ -9228,7 +9233,7 @@ function processRoutes(routes, manifest, routeModules, parentId) {
|
|
|
9228
9233
|
import { parse, serialize } from "cookie";
|
|
9229
9234
|
|
|
9230
9235
|
// lib/server-runtime/crypto.ts
|
|
9231
|
-
var encoder = new TextEncoder();
|
|
9236
|
+
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
9232
9237
|
var sign = async (value, secret) => {
|
|
9233
9238
|
let data2 = encoder.encode(value);
|
|
9234
9239
|
let key = await createKey2(secret, ["sign"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -202,14 +202,7 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options =
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
function createURL(to) {
|
|
205
|
-
|
|
206
|
-
let href = typeof to === "string" ? to : createPath(to);
|
|
207
|
-
href = href.replace(/ $/, "%20");
|
|
208
|
-
invariant(
|
|
209
|
-
base,
|
|
210
|
-
`No window.location.(origin|href) available to create URL for href: ${href}`
|
|
211
|
-
);
|
|
212
|
-
return new URL(href, base);
|
|
205
|
+
return createBrowserURLImpl(to);
|
|
213
206
|
}
|
|
214
207
|
let history = {
|
|
215
208
|
get action() {
|
|
@@ -249,6 +242,19 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options =
|
|
|
249
242
|
};
|
|
250
243
|
return history;
|
|
251
244
|
}
|
|
245
|
+
function createBrowserURLImpl(to, isAbsolute = false) {
|
|
246
|
+
let base = "http://localhost";
|
|
247
|
+
if (typeof window !== "undefined") {
|
|
248
|
+
base = window.location.origin !== "null" ? window.location.origin : window.location.href;
|
|
249
|
+
}
|
|
250
|
+
invariant(base, "No window.location.(origin|href) available to create URL");
|
|
251
|
+
let href = typeof to === "string" ? to : createPath(to);
|
|
252
|
+
href = href.replace(/ $/, "%20");
|
|
253
|
+
if (!isAbsolute && href.startsWith("//")) {
|
|
254
|
+
href = base + href;
|
|
255
|
+
}
|
|
256
|
+
return new URL(href, base);
|
|
257
|
+
}
|
|
252
258
|
|
|
253
259
|
// lib/router/utils.ts
|
|
254
260
|
var _map;
|
|
@@ -2060,7 +2066,7 @@ function createRouter(init) {
|
|
|
2060
2066
|
if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
|
|
2061
2067
|
isDocumentReload = true;
|
|
2062
2068
|
} else if (ABSOLUTE_URL_REGEX.test(location)) {
|
|
2063
|
-
const url =
|
|
2069
|
+
const url = createBrowserURLImpl(location, true);
|
|
2064
2070
|
isDocumentReload = // Hard reload if it's an absolute URL to a new origin
|
|
2065
2071
|
url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2066
2072
|
stripBasename(url.pathname, basename) == null;
|
|
@@ -4025,10 +4031,10 @@ var RouteContext = React.createContext({
|
|
|
4025
4031
|
RouteContext.displayName = "Route";
|
|
4026
4032
|
var RouteErrorContext = React.createContext(null);
|
|
4027
4033
|
RouteErrorContext.displayName = "RouteError";
|
|
4034
|
+
var ENABLE_DEV_WARNINGS = false;
|
|
4028
4035
|
|
|
4029
4036
|
// lib/hooks.tsx
|
|
4030
4037
|
var React2 = __toESM(require("react"));
|
|
4031
|
-
var ENABLE_DEV_WARNINGS = false;
|
|
4032
4038
|
function useInRouterContext() {
|
|
4033
4039
|
return React2.useContext(LocationContext) != null;
|
|
4034
4040
|
}
|
|
@@ -4370,7 +4376,6 @@ function warnOnce(condition, message) {
|
|
|
4370
4376
|
}
|
|
4371
4377
|
|
|
4372
4378
|
// lib/components.tsx
|
|
4373
|
-
var ENABLE_DEV_WARNINGS2 = false;
|
|
4374
4379
|
function mapRouteProperties(route) {
|
|
4375
4380
|
let updates = {
|
|
4376
4381
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -4378,7 +4383,7 @@ function mapRouteProperties(route) {
|
|
|
4378
4383
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
4379
4384
|
};
|
|
4380
4385
|
if (route.Component) {
|
|
4381
|
-
if (
|
|
4386
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
4382
4387
|
if (route.element) {
|
|
4383
4388
|
warning(
|
|
4384
4389
|
false,
|
|
@@ -4392,7 +4397,7 @@ function mapRouteProperties(route) {
|
|
|
4392
4397
|
});
|
|
4393
4398
|
}
|
|
4394
4399
|
if (route.HydrateFallback) {
|
|
4395
|
-
if (
|
|
4400
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
4396
4401
|
if (route.hydrateFallbackElement) {
|
|
4397
4402
|
warning(
|
|
4398
4403
|
false,
|
|
@@ -4406,7 +4411,7 @@ function mapRouteProperties(route) {
|
|
|
4406
4411
|
});
|
|
4407
4412
|
}
|
|
4408
4413
|
if (route.ErrorBoundary) {
|
|
4409
|
-
if (
|
|
4414
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
4410
4415
|
if (route.errorElement) {
|
|
4411
4416
|
warning(
|
|
4412
4417
|
false,
|
|
@@ -5248,14 +5253,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
5248
5253
|
dangerouslySetInnerHTML: {
|
|
5249
5254
|
__html: `
|
|
5250
5255
|
console.log(
|
|
5251
|
-
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://
|
|
5256
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
5252
5257
|
);
|
|
5253
5258
|
`
|
|
5254
5259
|
}
|
|
5255
5260
|
}
|
|
5256
5261
|
);
|
|
5257
5262
|
if (isRouteErrorResponse(error)) {
|
|
5258
|
-
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
5263
|
+
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), ENABLE_DEV_WARNINGS ? heyDeveloper : null);
|
|
5259
5264
|
}
|
|
5260
5265
|
let errorInstance;
|
|
5261
5266
|
if (error instanceof Error) {
|
|
@@ -5308,7 +5313,7 @@ function BoundaryShell({
|
|
|
5308
5313
|
// lib/dom/ssr/fallback.tsx
|
|
5309
5314
|
var React6 = __toESM(require("react"));
|
|
5310
5315
|
function RemixRootDefaultHydrateFallback() {
|
|
5311
|
-
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React6.createElement(
|
|
5316
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, ENABLE_DEV_WARNINGS ? /* @__PURE__ */ React6.createElement(
|
|
5312
5317
|
"script",
|
|
5313
5318
|
{
|
|
5314
5319
|
dangerouslySetInnerHTML: {
|
|
@@ -5316,13 +5321,13 @@ function RemixRootDefaultHydrateFallback() {
|
|
|
5316
5321
|
console.log(
|
|
5317
5322
|
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
|
|
5318
5323
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
5319
|
-
"functions. Check out https://
|
|
5324
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
5320
5325
|
"for more information."
|
|
5321
5326
|
);
|
|
5322
5327
|
`
|
|
5323
5328
|
}
|
|
5324
5329
|
}
|
|
5325
|
-
));
|
|
5330
|
+
) : null);
|
|
5326
5331
|
}
|
|
5327
5332
|
|
|
5328
5333
|
// lib/dom/ssr/routes.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
invariant,
|
|
26
26
|
mapRouteProperties,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-3F6ADOVA.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -457,14 +457,7 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
function createURL(to) {
|
|
460
|
-
|
|
461
|
-
let href2 = typeof to === "string" ? to : createPath(to);
|
|
462
|
-
href2 = href2.replace(/ $/, "%20");
|
|
463
|
-
invariant(
|
|
464
|
-
base,
|
|
465
|
-
`No window.location.(origin|href) available to create URL for href: ${href2}`
|
|
466
|
-
);
|
|
467
|
-
return new URL(href2, base);
|
|
460
|
+
return createBrowserURLImpl(to);
|
|
468
461
|
}
|
|
469
462
|
let history = {
|
|
470
463
|
get action() {
|
|
@@ -504,6 +497,19 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
504
497
|
};
|
|
505
498
|
return history;
|
|
506
499
|
}
|
|
500
|
+
function createBrowserURLImpl(to, isAbsolute = false) {
|
|
501
|
+
let base = "http://localhost";
|
|
502
|
+
if (typeof window !== "undefined") {
|
|
503
|
+
base = window.location.origin !== "null" ? window.location.origin : window.location.href;
|
|
504
|
+
}
|
|
505
|
+
invariant(base, "No window.location.(origin|href) available to create URL");
|
|
506
|
+
let href2 = typeof to === "string" ? to : createPath(to);
|
|
507
|
+
href2 = href2.replace(/ $/, "%20");
|
|
508
|
+
if (!isAbsolute && href2.startsWith("//")) {
|
|
509
|
+
href2 = base + href2;
|
|
510
|
+
}
|
|
511
|
+
return new URL(href2, base);
|
|
512
|
+
}
|
|
507
513
|
|
|
508
514
|
// lib/router/utils.ts
|
|
509
515
|
function unstable_createContext(defaultValue) {
|
|
@@ -2356,7 +2362,7 @@ function createRouter(init) {
|
|
|
2356
2362
|
if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
|
|
2357
2363
|
isDocumentReload = true;
|
|
2358
2364
|
} else if (ABSOLUTE_URL_REGEX.test(location)) {
|
|
2359
|
-
const url =
|
|
2365
|
+
const url = createBrowserURLImpl(location, true);
|
|
2360
2366
|
isDocumentReload = // Hard reload if it's an absolute URL to a new origin
|
|
2361
2367
|
url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
2362
2368
|
stripBasename(url.pathname, basename) == null;
|
|
@@ -4938,10 +4944,10 @@ var RouteContext = React.createContext({
|
|
|
4938
4944
|
RouteContext.displayName = "Route";
|
|
4939
4945
|
var RouteErrorContext = React.createContext(null);
|
|
4940
4946
|
RouteErrorContext.displayName = "RouteError";
|
|
4947
|
+
var ENABLE_DEV_WARNINGS = false;
|
|
4941
4948
|
|
|
4942
4949
|
// lib/hooks.tsx
|
|
4943
4950
|
var React2 = __toESM(require("react"));
|
|
4944
|
-
var ENABLE_DEV_WARNINGS = false;
|
|
4945
4951
|
function useHref(to, { relative } = {}) {
|
|
4946
4952
|
invariant(
|
|
4947
4953
|
useInRouterContext(),
|
|
@@ -5523,7 +5529,6 @@ function warnOnce(condition, message) {
|
|
|
5523
5529
|
}
|
|
5524
5530
|
|
|
5525
5531
|
// lib/components.tsx
|
|
5526
|
-
var ENABLE_DEV_WARNINGS2 = false;
|
|
5527
5532
|
function mapRouteProperties(route) {
|
|
5528
5533
|
let updates = {
|
|
5529
5534
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -5531,7 +5536,7 @@ function mapRouteProperties(route) {
|
|
|
5531
5536
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
5532
5537
|
};
|
|
5533
5538
|
if (route.Component) {
|
|
5534
|
-
if (
|
|
5539
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5535
5540
|
if (route.element) {
|
|
5536
5541
|
warning(
|
|
5537
5542
|
false,
|
|
@@ -5545,7 +5550,7 @@ function mapRouteProperties(route) {
|
|
|
5545
5550
|
});
|
|
5546
5551
|
}
|
|
5547
5552
|
if (route.HydrateFallback) {
|
|
5548
|
-
if (
|
|
5553
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5549
5554
|
if (route.hydrateFallbackElement) {
|
|
5550
5555
|
warning(
|
|
5551
5556
|
false,
|
|
@@ -5559,7 +5564,7 @@ function mapRouteProperties(route) {
|
|
|
5559
5564
|
});
|
|
5560
5565
|
}
|
|
5561
5566
|
if (route.ErrorBoundary) {
|
|
5562
|
-
if (
|
|
5567
|
+
if (ENABLE_DEV_WARNINGS) {
|
|
5563
5568
|
if (route.errorElement) {
|
|
5564
5569
|
warning(
|
|
5565
5570
|
false,
|
|
@@ -6941,14 +6946,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
6941
6946
|
dangerouslySetInnerHTML: {
|
|
6942
6947
|
__html: `
|
|
6943
6948
|
console.log(
|
|
6944
|
-
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://
|
|
6949
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
6945
6950
|
);
|
|
6946
6951
|
`
|
|
6947
6952
|
}
|
|
6948
6953
|
}
|
|
6949
6954
|
);
|
|
6950
6955
|
if (isRouteErrorResponse(error)) {
|
|
6951
|
-
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
6956
|
+
return /* @__PURE__ */ React5.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React5.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), ENABLE_DEV_WARNINGS ? heyDeveloper : null);
|
|
6952
6957
|
}
|
|
6953
6958
|
let errorInstance;
|
|
6954
6959
|
if (error instanceof Error) {
|
|
@@ -7001,7 +7006,7 @@ function BoundaryShell({
|
|
|
7001
7006
|
// lib/dom/ssr/fallback.tsx
|
|
7002
7007
|
var React6 = __toESM(require("react"));
|
|
7003
7008
|
function RemixRootDefaultHydrateFallback() {
|
|
7004
|
-
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React6.createElement(
|
|
7009
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, ENABLE_DEV_WARNINGS ? /* @__PURE__ */ React6.createElement(
|
|
7005
7010
|
"script",
|
|
7006
7011
|
{
|
|
7007
7012
|
dangerouslySetInnerHTML: {
|
|
@@ -7009,13 +7014,13 @@ function RemixRootDefaultHydrateFallback() {
|
|
|
7009
7014
|
console.log(
|
|
7010
7015
|
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
|
|
7011
7016
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
7012
|
-
"functions. Check out https://
|
|
7017
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
7013
7018
|
"for more information."
|
|
7014
7019
|
);
|
|
7015
7020
|
`
|
|
7016
7021
|
}
|
|
7017
7022
|
}
|
|
7018
|
-
));
|
|
7023
|
+
) : null);
|
|
7019
7024
|
}
|
|
7020
7025
|
|
|
7021
7026
|
// lib/dom/ssr/routes.tsx
|
|
@@ -8119,7 +8124,7 @@ function mergeRefs(...refs) {
|
|
|
8119
8124
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8120
8125
|
try {
|
|
8121
8126
|
if (isBrowser) {
|
|
8122
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8127
|
+
window.__reactRouterVersion = "0.0.0-experimental-ab0e85b04";
|
|
8123
8128
|
}
|
|
8124
8129
|
} catch (e) {
|
|
8125
8130
|
}
|
|
@@ -9378,7 +9383,7 @@ function processRoutes(routes, manifest, routeModules, parentId) {
|
|
|
9378
9383
|
var import_cookie = require("cookie");
|
|
9379
9384
|
|
|
9380
9385
|
// lib/server-runtime/crypto.ts
|
|
9381
|
-
var encoder = new TextEncoder();
|
|
9386
|
+
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
9382
9387
|
var sign = async (value, secret) => {
|
|
9383
9388
|
let data2 = encoder.encode(value);
|
|
9384
9389
|
let key = await createKey2(secret, ["sign"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-ab0e85b04
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
useSearchParams,
|
|
126
126
|
useSubmit,
|
|
127
127
|
useViewTransitionState
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-3F6ADOVA.mjs";
|
|
129
129
|
export {
|
|
130
130
|
Await,
|
|
131
131
|
BrowserRouter,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aE as LinkDescriptor, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.mjs';
|
|
1
|
+
import { aE as LinkDescriptor, L as Location, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.mjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
4
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aE as LinkDescriptor, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.js';
|
|
1
|
+
import { aE as LinkDescriptor, L as Location, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ab as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BvrN3Sw4.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
4
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|