react-router 7.9.2-pre.0 → 7.9.2-pre.2
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/CHANGELOG.md +8 -0
- package/dist/development/{chunk-ED2JHW2I.js → chunk-BMRATXNU.js} +1 -1
- package/dist/development/{chunk-VM65TX2A.js → chunk-CVJRSTVH.js} +270 -156
- package/dist/development/{chunk-EPSRV6KC.mjs → chunk-IM5OGALA.mjs} +116 -2
- package/dist/{production/chunk-HAV7J4RO.mjs → development/chunk-Z2FQBQSH.mjs} +63 -58
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.js +157 -152
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{development/chunk-PVJ3J6E6.mjs → production/chunk-54D6QT34.mjs} +63 -58
- package/dist/production/{chunk-22I2H6CR.js → chunk-JZBSSDER.js} +1 -1
- package/dist/production/{chunk-K4BWIVAI.js → chunk-MZDKBHOP.js} +270 -156
- package/dist/production/{chunk-662O2YDJ.mjs → chunk-QE6DSGL5.mjs} +116 -2
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.js +157 -152
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.2-pre.
|
|
2
|
+
* react-router v7.9.2-pre.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
isSession,
|
|
32
32
|
routeRSCServerRequest,
|
|
33
33
|
setDevServerHooks
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-Z2FQBQSH.mjs";
|
|
35
35
|
import {
|
|
36
36
|
Action,
|
|
37
37
|
Await,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
withComponentProps,
|
|
142
142
|
withErrorBoundaryProps,
|
|
143
143
|
withHydrateFallbackProps
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-IM5OGALA.mjs";
|
|
145
145
|
export {
|
|
146
146
|
Await,
|
|
147
147
|
BrowserRouter,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.2-pre.
|
|
2
|
+
* react-router v7.9.2-pre.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
SingleFetchRedirectSymbol,
|
|
23
23
|
StaticRouterProvider,
|
|
24
24
|
StreamTransfer,
|
|
25
|
+
UNSTABLE_TransitionEnabledRouterProvider,
|
|
25
26
|
convertRoutesToDataRoutes,
|
|
26
27
|
createBrowserHistory,
|
|
27
28
|
createContext,
|
|
@@ -59,7 +60,7 @@ import {
|
|
|
59
60
|
withComponentProps,
|
|
60
61
|
withErrorBoundaryProps,
|
|
61
62
|
withHydrateFallbackProps
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-QE6DSGL5.mjs";
|
|
63
64
|
|
|
64
65
|
// lib/dom/ssr/server.tsx
|
|
65
66
|
import * as React from "react";
|
|
@@ -1856,7 +1857,7 @@ function createCallServer({
|
|
|
1856
1857
|
return async (id, args) => {
|
|
1857
1858
|
let actionId = globalVar.__routerActionID = (globalVar.__routerActionID ?? (globalVar.__routerActionID = 0)) + 1;
|
|
1858
1859
|
const temporaryReferences = createTemporaryReferenceSet();
|
|
1859
|
-
const
|
|
1860
|
+
const payloadPromise = fetchImplementation(
|
|
1860
1861
|
new Request(location.href, {
|
|
1861
1862
|
body: await encodeReply(args, { temporaryReferences }),
|
|
1862
1863
|
method: "POST",
|
|
@@ -1865,44 +1866,45 @@ function createCallServer({
|
|
|
1865
1866
|
"rsc-action-id": id
|
|
1866
1867
|
}
|
|
1867
1868
|
})
|
|
1868
|
-
)
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
}
|
|
1872
|
-
const payload = await createFromReadableStream(response.body, {
|
|
1873
|
-
temporaryReferences
|
|
1874
|
-
});
|
|
1875
|
-
if (payload.type === "redirect") {
|
|
1876
|
-
if (payload.reload) {
|
|
1877
|
-
window.location.href = payload.location;
|
|
1878
|
-
return;
|
|
1869
|
+
).then((response) => {
|
|
1870
|
+
if (!response.body) {
|
|
1871
|
+
throw new Error("No response body");
|
|
1879
1872
|
}
|
|
1880
|
-
|
|
1881
|
-
|
|
1873
|
+
return createFromReadableStream(response.body, {
|
|
1874
|
+
temporaryReferences
|
|
1882
1875
|
});
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1876
|
+
});
|
|
1877
|
+
globalVar.__reactRouterDataRouter.__setPendingRerender(
|
|
1878
|
+
Promise.resolve(payloadPromise).then(async (payload) => {
|
|
1879
|
+
if (payload.type === "redirect") {
|
|
1880
|
+
if (payload.reload) {
|
|
1881
|
+
window.location.href = payload.location;
|
|
1882
|
+
return () => {
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
return () => {
|
|
1886
|
+
globalVar.__reactRouterDataRouter.navigate(payload.location, {
|
|
1887
|
+
replace: payload.replace
|
|
1888
|
+
});
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
if (payload.type !== "action") {
|
|
1892
|
+
throw new Error("Unexpected payload type");
|
|
1893
|
+
}
|
|
1894
|
+
const rerender = await payload.rerender;
|
|
1895
|
+
if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
|
1896
|
+
if (rerender.type === "redirect") {
|
|
1897
|
+
if (rerender.reload) {
|
|
1898
|
+
window.location.href = rerender.location;
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
return () => {
|
|
1901
1902
|
globalVar.__reactRouterDataRouter.navigate(rerender.location, {
|
|
1902
1903
|
replace: rerender.replace
|
|
1903
1904
|
});
|
|
1904
|
-
|
|
1905
|
-
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
return () => {
|
|
1906
1908
|
let lastMatch;
|
|
1907
1909
|
for (const match of rerender.matches) {
|
|
1908
1910
|
globalVar.__reactRouterDataRouter.patchRoutes(
|
|
@@ -1913,29 +1915,32 @@ function createCallServer({
|
|
|
1913
1915
|
lastMatch = match;
|
|
1914
1916
|
}
|
|
1915
1917
|
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
|
1916
|
-
{
|
|
1918
|
+
{
|
|
1919
|
+
loaderData: Object.assign(
|
|
1920
|
+
{},
|
|
1921
|
+
globalVar.__reactRouterDataRouter.state.loaderData,
|
|
1922
|
+
rerender.loaderData
|
|
1923
|
+
),
|
|
1924
|
+
errors: rerender.errors ? Object.assign(
|
|
1925
|
+
{},
|
|
1926
|
+
globalVar.__reactRouterDataRouter.state.errors,
|
|
1927
|
+
rerender.errors
|
|
1928
|
+
) : null
|
|
1929
|
+
}
|
|
1917
1930
|
);
|
|
1918
|
-
|
|
1919
|
-
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
|
1920
|
-
{
|
|
1921
|
-
loaderData: Object.assign(
|
|
1922
|
-
{},
|
|
1923
|
-
globalVar.__reactRouterDataRouter.state.loaderData,
|
|
1924
|
-
rerender.loaderData
|
|
1925
|
-
),
|
|
1926
|
-
errors: rerender.errors ? Object.assign(
|
|
1927
|
-
{},
|
|
1928
|
-
globalVar.__reactRouterDataRouter.state.errors,
|
|
1929
|
-
rerender.errors
|
|
1930
|
-
) : null
|
|
1931
|
-
}
|
|
1932
|
-
);
|
|
1933
|
-
});
|
|
1934
|
-
}
|
|
1931
|
+
};
|
|
1935
1932
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1933
|
+
return () => {
|
|
1934
|
+
};
|
|
1935
|
+
}).catch(() => {
|
|
1936
|
+
})
|
|
1937
|
+
);
|
|
1938
|
+
return payloadPromise.then((payload) => {
|
|
1939
|
+
if (payload.type !== "action" && payload.type !== "redirect") {
|
|
1940
|
+
throw new Error("Unexpected payload type");
|
|
1941
|
+
}
|
|
1942
|
+
return payload.actionResult;
|
|
1943
|
+
});
|
|
1939
1944
|
};
|
|
1940
1945
|
}
|
|
1941
1946
|
function createRouterFromPayload({
|
|
@@ -2302,7 +2307,7 @@ function RSCHydratedRouter({
|
|
|
2302
2307
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2303
2308
|
routeModules
|
|
2304
2309
|
};
|
|
2305
|
-
return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(
|
|
2310
|
+
return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(UNSTABLE_TransitionEnabledRouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2306
2311
|
}
|
|
2307
2312
|
function createRouteFromServerManifest(match, payload) {
|
|
2308
2313
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.9.2-pre.
|
|
2
|
+
* react-router v7.9.2-pre.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|