@react-router/dev 0.0.0-experimental-d82b9430b → 0.0.0-experimental-f2b42587c
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/cli/index.js +24 -23
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.d.ts +1 -1
- package/dist/vite/cloudflare.js +1 -1
- package/dist/vite.js +23 -22
- package/package.json +6 -6
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v0.0.0-experimental-
|
|
3
|
+
* @react-router/dev v0.0.0-experimental-f2b42587c
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -928,7 +928,7 @@ function generateRoutes(ctx) {
|
|
|
928
928
|
lineages.set(route.id, lineage2);
|
|
929
929
|
const fullpath2 = fullpath(lineage2);
|
|
930
930
|
if (!fullpath2) continue;
|
|
931
|
-
const pages =
|
|
931
|
+
const pages = explodeOptionalSegments(fullpath2);
|
|
932
932
|
pages.forEach((page) => allPages.add(page));
|
|
933
933
|
lineage2.forEach(({ id }) => {
|
|
934
934
|
let routePages = routeToPages.get(id);
|
|
@@ -1157,27 +1157,28 @@ function paramsType(path8) {
|
|
|
1157
1157
|
})
|
|
1158
1158
|
);
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1160
|
+
function explodeOptionalSegments(path8) {
|
|
1161
|
+
let segments = path8.split("/");
|
|
1162
|
+
if (segments.length === 0) return [];
|
|
1163
|
+
let [first, ...rest] = segments;
|
|
1164
|
+
let isOptional = first.endsWith("?");
|
|
1165
|
+
let required = first.replace(/\?$/, "");
|
|
1166
|
+
if (rest.length === 0) {
|
|
1167
|
+
return isOptional ? [required, ""] : [required];
|
|
1168
|
+
}
|
|
1169
|
+
let restExploded = explodeOptionalSegments(rest.join("/"));
|
|
1170
|
+
let result = [];
|
|
1171
|
+
result.push(
|
|
1172
|
+
...restExploded.map(
|
|
1173
|
+
(subpath) => subpath === "" ? required : [required, subpath].join("/")
|
|
1174
|
+
)
|
|
1175
|
+
);
|
|
1176
|
+
if (isOptional) {
|
|
1177
|
+
result.push(...restExploded);
|
|
1178
|
+
}
|
|
1179
|
+
return result.map(
|
|
1180
|
+
(exploded) => path8.startsWith("/") && exploded === "" ? "/" : exploded
|
|
1181
|
+
);
|
|
1181
1182
|
}
|
|
1182
1183
|
var import_dedent, Path3, Pathe, t2;
|
|
1183
1184
|
var init_generate = __esm({
|
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UNSAFE_MiddlewareEnabled, unstable_InitialContext, AppLoadContext } from 'react-router';
|
|
2
2
|
import { Plugin } from 'vite';
|
|
3
|
-
import {
|
|
3
|
+
import { PlatformProxy, GetPlatformProxyOptions } from 'wrangler';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
6
6
|
type CfProperties = Record<string, unknown>;
|
package/dist/vite/cloudflare.js
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-f2b42587c
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -915,7 +915,7 @@ function generateRoutes(ctx) {
|
|
|
915
915
|
lineages.set(route.id, lineage2);
|
|
916
916
|
const fullpath2 = fullpath(lineage2);
|
|
917
917
|
if (!fullpath2) continue;
|
|
918
|
-
const pages =
|
|
918
|
+
const pages = explodeOptionalSegments(fullpath2);
|
|
919
919
|
pages.forEach((page) => allPages.add(page));
|
|
920
920
|
lineage2.forEach(({ id }) => {
|
|
921
921
|
let routePages = routeToPages.get(id);
|
|
@@ -1144,27 +1144,28 @@ function paramsType(path6) {
|
|
|
1144
1144
|
})
|
|
1145
1145
|
);
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
const kept = isDynamic ? segment : required;
|
|
1156
|
-
const withoutSegment = recurse(segments2, index + 1);
|
|
1157
|
-
const withSegment = withoutSegment.map((rest) => [kept, rest].join("/"));
|
|
1158
|
-
if (keep) return withSegment;
|
|
1159
|
-
return [...withoutSegment, ...withSegment];
|
|
1147
|
+
function explodeOptionalSegments(path6) {
|
|
1148
|
+
let segments = path6.split("/");
|
|
1149
|
+
if (segments.length === 0) return [];
|
|
1150
|
+
let [first, ...rest] = segments;
|
|
1151
|
+
let isOptional = first.endsWith("?");
|
|
1152
|
+
let required = first.replace(/\?$/, "");
|
|
1153
|
+
if (rest.length === 0) {
|
|
1154
|
+
return isOptional ? [required, ""] : [required];
|
|
1160
1155
|
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1156
|
+
let restExploded = explodeOptionalSegments(rest.join("/"));
|
|
1157
|
+
let result = [];
|
|
1158
|
+
result.push(
|
|
1159
|
+
...restExploded.map(
|
|
1160
|
+
(subpath) => subpath === "" ? required : [required, subpath].join("/")
|
|
1161
|
+
)
|
|
1162
|
+
);
|
|
1163
|
+
if (isOptional) {
|
|
1164
|
+
result.push(...restExploded);
|
|
1166
1165
|
}
|
|
1167
|
-
return
|
|
1166
|
+
return result.map(
|
|
1167
|
+
(exploded) => path6.startsWith("/") && exploded === "" ? "/" : exploded
|
|
1168
|
+
);
|
|
1168
1169
|
}
|
|
1169
1170
|
|
|
1170
1171
|
// typegen/index.ts
|
|
@@ -3270,7 +3271,7 @@ var reactRouterVitePlugin = () => {
|
|
|
3270
3271
|
if (ctx.reactRouterConfig.future.unstable_viteEnvironmentApi) {
|
|
3271
3272
|
viteDevServer.middlewares.use(async (req, res, next) => {
|
|
3272
3273
|
let [reqPathname, reqSearch] = (req.url ?? "").split("?");
|
|
3273
|
-
if (reqPathname.
|
|
3274
|
+
if (reqPathname === `${ctx.publicPath}@react-router/critical.css`) {
|
|
3274
3275
|
let pathname = new URLSearchParams(reqSearch).get("pathname");
|
|
3275
3276
|
if (!pathname) {
|
|
3276
3277
|
return next("No pathname provided");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-f2b42587c",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"set-cookie-parser": "^2.6.0",
|
|
87
87
|
"valibot": "^0.41.0",
|
|
88
88
|
"vite-node": "^3.1.4",
|
|
89
|
-
"@react-router/node": "0.0.0-experimental-
|
|
89
|
+
"@react-router/node": "0.0.0-experimental-f2b42587c"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/babel__core": "^7.20.5",
|
|
@@ -110,15 +110,15 @@
|
|
|
110
110
|
"vite": "^6.1.0",
|
|
111
111
|
"wireit": "0.14.9",
|
|
112
112
|
"wrangler": "^4.2.0",
|
|
113
|
-
"react-router": "
|
|
114
|
-
"
|
|
113
|
+
"@react-router/serve": "0.0.0-experimental-f2b42587c",
|
|
114
|
+
"react-router": "^0.0.0-experimental-f2b42587c"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"typescript": "^5.1.0",
|
|
118
118
|
"vite": "^5.1.0 || ^6.0.0",
|
|
119
119
|
"wrangler": "^3.28.2 || ^4.0.0",
|
|
120
|
-
"
|
|
121
|
-
"react-router": "^0.0.0-experimental-
|
|
120
|
+
"react-router": "^0.0.0-experimental-f2b42587c",
|
|
121
|
+
"@react-router/serve": "^0.0.0-experimental-f2b42587c"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"@react-router/serve": {
|