react-router 7.8.1 → 7.8.2-pre.1
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 +23 -0
- package/dist/development/{chunk-IFMMFE4R.mjs → chunk-7QFLQWWN.mjs} +34 -75
- package/dist/{production/chunk-YMYXECPK.js → development/chunk-IVOVRAK2.js} +210 -169
- package/dist/development/{chunk-UH6JLGW7.mjs → chunk-ZVD2KUIM.mjs} +187 -204
- package/dist/development/{chunk-TGXCWGPT.js → chunk-ZVMYUFGA.js} +125 -183
- package/dist/development/{context-DohQKLID.d.mts → context-jKip1TFB.d.mts} +846 -8
- package/dist/development/dom-export.d.mts +20 -2
- package/dist/development/dom-export.d.ts +20 -1
- package/dist/development/dom-export.js +10 -4
- package/dist/development/dom-export.mjs +10 -4
- package/dist/{production/index-react-server-client-BQ6FxdA_.d.ts → development/index-react-server-client-BKpa2trA.d.ts} +6 -816
- package/dist/{production/index-react-server-client-11fLy3qB.d.mts → development/index-react-server-client-DRhjXpk2.d.mts} +2 -3
- package/dist/development/index-react-server-client.d.mts +3 -4
- package/dist/development/index-react-server-client.d.ts +2 -2
- 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.d.mts +4 -3
- package/dist/development/index-react-server.d.ts +4 -3
- package/dist/development/index-react-server.js +62 -53
- package/dist/development/index-react-server.mjs +62 -53
- package/dist/development/index.d.mts +7 -9
- package/dist/development/index.d.ts +5 -5
- package/dist/development/index.js +122 -163
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +3 -3
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-CNjObrhZ.d.mts → route-data-DAVP2QQ0.d.mts} +3 -3
- package/dist/development/{routeModules-C3oqzPpI.d.ts → routeModules-rOzWJJ9x.d.ts} +848 -10
- package/dist/production/{chunk-KHPQXKYM.js → chunk-5WPGWA23.js} +125 -183
- package/dist/{development/chunk-IIA3TUI2.js → production/chunk-IK7IYG3O.js} +210 -169
- package/dist/production/{chunk-5Y7ELDIJ.mjs → chunk-LR4OTIMG.mjs} +34 -75
- package/dist/production/{chunk-PFDCNQUK.mjs → chunk-VHBXOG2Z.mjs} +187 -204
- package/dist/production/{context-DohQKLID.d.mts → context-jKip1TFB.d.mts} +846 -8
- package/dist/production/dom-export.d.mts +20 -2
- package/dist/production/dom-export.d.ts +20 -1
- package/dist/production/dom-export.js +10 -4
- package/dist/production/dom-export.mjs +10 -4
- package/dist/{development/index-react-server-client-BQ6FxdA_.d.ts → production/index-react-server-client-BKpa2trA.d.ts} +6 -816
- package/dist/{development/index-react-server-client-11fLy3qB.d.mts → production/index-react-server-client-DRhjXpk2.d.mts} +2 -3
- package/dist/production/index-react-server-client.d.mts +3 -4
- package/dist/production/index-react-server-client.d.ts +2 -2
- 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.d.mts +4 -3
- package/dist/production/index-react-server.d.ts +4 -3
- package/dist/production/index-react-server.js +62 -53
- package/dist/production/index-react-server.mjs +62 -53
- package/dist/production/index.d.mts +7 -9
- package/dist/production/index.d.ts +5 -5
- package/dist/production/index.js +122 -163
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +3 -3
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-CNjObrhZ.d.mts → route-data-DAVP2QQ0.d.mts} +3 -3
- package/dist/production/{routeModules-C3oqzPpI.d.ts → routeModules-rOzWJJ9x.d.ts} +848 -10
- package/package.json +1 -1
- package/dist/development/components-CuPfnyiZ.d.mts +0 -814
- package/dist/production/components-CuPfnyiZ.d.mts +0 -814
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## 7.8.2-pre.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [UNSTABLE] Remove Data Mode `future.unstable_middleware` flag from `createBrowserRouter` ([#14213](https://github.com/remix-run/react-router/pull/14213))
|
|
8
|
+
- This is only needed as a Framework Mode flag because of the route modules and the `getLoadContext` type behavior change
|
|
9
|
+
- In Data Mode, it's an opt-in feature because it's just a new property on a route object, so there's no behavior changes that necessitate a flag
|
|
10
|
+
|
|
11
|
+
- server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
|
|
12
|
+
- [REMOVE] Update type as a follow up to https://github.com/remix-run/react-router/pull/14151 ([#14212](https://github.com/remix-run/react-router/pull/14212))
|
|
13
|
+
|
|
14
|
+
## 7.8.2-pre.0
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
|
|
19
|
+
- Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
|
|
20
|
+
- Maintain `ReadonlyMap` and `ReadonlySet` types in server response data. ([#13092](https://github.com/remix-run/react-router/pull/13092))
|
|
21
|
+
- [UNSTABLE] Delay serialization of `.data` redirects to 202 responses until after middleware chain ([#14205](https://github.com/remix-run/react-router/pull/14205))
|
|
22
|
+
- Fix `TypeError` if you throw from `patchRoutesOnNavigation` when no partial matches exist ([#14198](https://github.com/remix-run/react-router/pull/14198))
|
|
23
|
+
- Fix `basename` usage without a leading slash in data routers ([#11671](https://github.com/remix-run/react-router/pull/11671))
|
|
24
|
+
- [UNSTABLE] Update client middleware so it returns the data strategy results allowing for more advanced post-processing middleware ([#14151](https://github.com/remix-run/react-router/pull/14151))
|
|
25
|
+
|
|
3
26
|
## 7.8.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.1
|
|
2
|
+
* react-router v7.8.2-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
withComponentProps,
|
|
59
59
|
withErrorBoundaryProps,
|
|
60
60
|
withHydrateFallbackProps
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-ZVD2KUIM.mjs";
|
|
62
62
|
|
|
63
63
|
// lib/dom/ssr/server.tsx
|
|
64
64
|
import * as React from "react";
|
|
@@ -799,21 +799,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
799
799
|
return handleQueryError(error);
|
|
800
800
|
}
|
|
801
801
|
function handleQueryResult(result) {
|
|
802
|
-
|
|
803
|
-
result = staticContextToResponse(result);
|
|
804
|
-
}
|
|
805
|
-
if (isRedirectResponse(result)) {
|
|
806
|
-
return generateSingleFetchResponse(request, build, serverMode, {
|
|
807
|
-
result: getSingleFetchRedirect(
|
|
808
|
-
result.status,
|
|
809
|
-
result.headers,
|
|
810
|
-
build.basename
|
|
811
|
-
),
|
|
812
|
-
headers: result.headers,
|
|
813
|
-
status: SINGLE_FETCH_REDIRECT_STATUS
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
return result;
|
|
802
|
+
return isResponse(result) ? result : staticContextToResponse(result);
|
|
817
803
|
}
|
|
818
804
|
function handleQueryError(error) {
|
|
819
805
|
handleError(error);
|
|
@@ -826,15 +812,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
826
812
|
function staticContextToResponse(context) {
|
|
827
813
|
let headers = getDocumentHeaders(context, build);
|
|
828
814
|
if (isRedirectStatusCode(context.statusCode) && headers.has("Location")) {
|
|
829
|
-
return
|
|
830
|
-
result: getSingleFetchRedirect(
|
|
831
|
-
context.statusCode,
|
|
832
|
-
headers,
|
|
833
|
-
build.basename
|
|
834
|
-
),
|
|
835
|
-
headers,
|
|
836
|
-
status: SINGLE_FETCH_REDIRECT_STATUS
|
|
837
|
-
});
|
|
815
|
+
return new Response(null, { status: context.statusCode, headers });
|
|
838
816
|
}
|
|
839
817
|
if (context.errors) {
|
|
840
818
|
Object.values(context.errors).forEach((err) => {
|
|
@@ -885,21 +863,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
885
863
|
return handleQueryError(error);
|
|
886
864
|
}
|
|
887
865
|
function handleQueryResult(result) {
|
|
888
|
-
|
|
889
|
-
if (isRedirectResponse(response)) {
|
|
890
|
-
return generateSingleFetchResponse(request, build, serverMode, {
|
|
891
|
-
result: {
|
|
892
|
-
[SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
893
|
-
response.status,
|
|
894
|
-
response.headers,
|
|
895
|
-
build.basename
|
|
896
|
-
)
|
|
897
|
-
},
|
|
898
|
-
headers: response.headers,
|
|
899
|
-
status: SINGLE_FETCH_REDIRECT_STATUS
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
return response;
|
|
866
|
+
return isResponse(result) ? result : staticContextToResponse(result);
|
|
903
867
|
}
|
|
904
868
|
function handleQueryError(error) {
|
|
905
869
|
handleError(error);
|
|
@@ -912,17 +876,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
912
876
|
function staticContextToResponse(context) {
|
|
913
877
|
let headers = getDocumentHeaders(context, build);
|
|
914
878
|
if (isRedirectStatusCode(context.statusCode) && headers.has("Location")) {
|
|
915
|
-
return
|
|
916
|
-
result: {
|
|
917
|
-
[SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
918
|
-
context.statusCode,
|
|
919
|
-
headers,
|
|
920
|
-
build.basename
|
|
921
|
-
)
|
|
922
|
-
},
|
|
923
|
-
headers,
|
|
924
|
-
status: SINGLE_FETCH_REDIRECT_STATUS
|
|
925
|
-
});
|
|
879
|
+
return new Response(null, { status: context.statusCode, headers });
|
|
926
880
|
}
|
|
927
881
|
if (context.errors) {
|
|
928
882
|
Object.values(context.errors).forEach((err) => {
|
|
@@ -980,6 +934,21 @@ function generateSingleFetchResponse(request, build, serverMode, {
|
|
|
980
934
|
}
|
|
981
935
|
);
|
|
982
936
|
}
|
|
937
|
+
function generateSingleFetchRedirectResponse(redirectResponse, request, build, serverMode) {
|
|
938
|
+
let redirect2 = getSingleFetchRedirect(
|
|
939
|
+
redirectResponse.status,
|
|
940
|
+
redirectResponse.headers,
|
|
941
|
+
build.basename
|
|
942
|
+
);
|
|
943
|
+
let headers = new Headers(redirectResponse.headers);
|
|
944
|
+
headers.delete("Location");
|
|
945
|
+
headers.set("Content-Type", "text/x-script");
|
|
946
|
+
return generateSingleFetchResponse(request, build, serverMode, {
|
|
947
|
+
result: request.method === "GET" ? { [SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
948
|
+
headers,
|
|
949
|
+
status: SINGLE_FETCH_REDIRECT_STATUS
|
|
950
|
+
});
|
|
951
|
+
}
|
|
983
952
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
984
953
|
let redirect2 = headers.get("Location");
|
|
985
954
|
if (basename) {
|
|
@@ -1205,6 +1174,14 @@ var createRequestHandler = (build, mode) => {
|
|
|
1205
1174
|
loadContext,
|
|
1206
1175
|
handleError
|
|
1207
1176
|
);
|
|
1177
|
+
if (isRedirectResponse(response)) {
|
|
1178
|
+
response = generateSingleFetchRedirectResponse(
|
|
1179
|
+
response,
|
|
1180
|
+
request,
|
|
1181
|
+
_build,
|
|
1182
|
+
serverMode
|
|
1183
|
+
);
|
|
1184
|
+
}
|
|
1208
1185
|
if (_build.entry.module.handleDataRequest) {
|
|
1209
1186
|
response = await _build.entry.module.handleDataRequest(response, {
|
|
1210
1187
|
context: loadContext,
|
|
@@ -1212,29 +1189,11 @@ var createRequestHandler = (build, mode) => {
|
|
|
1212
1189
|
request
|
|
1213
1190
|
});
|
|
1214
1191
|
if (isRedirectResponse(response)) {
|
|
1215
|
-
|
|
1216
|
-
response
|
|
1217
|
-
|
|
1218
|
-
_build
|
|
1219
|
-
|
|
1220
|
-
if (request.method === "GET") {
|
|
1221
|
-
result = {
|
|
1222
|
-
[SingleFetchRedirectSymbol]: result
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
let headers = new Headers(response.headers);
|
|
1226
|
-
headers.set("Content-Type", "text/x-script");
|
|
1227
|
-
return new Response(
|
|
1228
|
-
encodeViaTurboStream(
|
|
1229
|
-
result,
|
|
1230
|
-
request.signal,
|
|
1231
|
-
_build.entry.module.streamTimeout,
|
|
1232
|
-
serverMode
|
|
1233
|
-
),
|
|
1234
|
-
{
|
|
1235
|
-
status: SINGLE_FETCH_REDIRECT_STATUS,
|
|
1236
|
-
headers
|
|
1237
|
-
}
|
|
1192
|
+
response = generateSingleFetchRedirectResponse(
|
|
1193
|
+
response,
|
|
1194
|
+
request,
|
|
1195
|
+
_build,
|
|
1196
|
+
serverMode
|
|
1238
1197
|
);
|
|
1239
1198
|
}
|
|
1240
1199
|
}
|