@react-router/dev 0.0.0-nightly-b2c8f9c8a-20240522 → 0.0.0-nightly-73afcdc0d-20240523
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/commands.js +1 -1
- package/dist/cli/detectPackageManager.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/run.js +1 -1
- package/dist/cli/useJavascript.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/colors.js +1 -1
- package/dist/config/findConfig.js +1 -1
- package/dist/config/flatRoutes.js +1 -1
- package/dist/config/format.js +1 -1
- package/dist/config/routes.js +1 -1
- package/dist/config.d.ts +1 -8
- package/dist/config.js +6 -3
- package/dist/index.js +1 -1
- package/dist/invariant.js +1 -1
- package/dist/vite/babel.js +1 -1
- package/dist/vite/build.js +1 -1
- package/dist/vite/cloudflare-proxy-plugin.js +1 -1
- package/dist/vite/dev.js +1 -1
- package/dist/vite/import-vite-esm-sync.js +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/vite/node-adapter.js +1 -1
- package/dist/vite/plugin.d.ts +1 -0
- package/dist/vite/plugin.js +14 -12
- package/dist/vite/profiler.js +1 -1
- package/dist/vite/remove-exports.js +1 -1
- package/dist/vite/resolve-file-url.js +1 -1
- package/dist/vite/styles.js +1 -1
- package/dist/vite/vmod.js +1 -1
- package/package.json +7 -7
package/dist/cli/commands.js
CHANGED
package/dist/cli/index.js
CHANGED
package/dist/cli/run.js
CHANGED
package/dist/cli.js
CHANGED
package/dist/colors.js
CHANGED
package/dist/config/format.js
CHANGED
package/dist/config/routes.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -142,10 +142,6 @@ export type ResolvedVitePluginConfig = Readonly<{
|
|
|
142
142
|
* An array of URLs to prerender to HTML files at build time.
|
|
143
143
|
*/
|
|
144
144
|
prerender: Array<string> | null;
|
|
145
|
-
/**
|
|
146
|
-
* Derived from Vite's `base` config
|
|
147
|
-
* */
|
|
148
|
-
publicPath: string;
|
|
149
145
|
/**
|
|
150
146
|
* An object of all available routes, keyed by route id.
|
|
151
147
|
*/
|
|
@@ -174,6 +170,7 @@ export type ResolvedVitePluginConfig = Readonly<{
|
|
|
174
170
|
*/
|
|
175
171
|
ssr: boolean;
|
|
176
172
|
}>;
|
|
173
|
+
export declare function resolvePublicPath(viteUserConfig: Vite.UserConfig): string;
|
|
177
174
|
export declare function resolveReactRouterConfig({ rootDirectory, reactRouterUserConfig, viteUserConfig, viteCommand, }: {
|
|
178
175
|
rootDirectory: string;
|
|
179
176
|
reactRouterUserConfig: VitePluginConfig;
|
|
@@ -204,10 +201,6 @@ export declare function resolveReactRouterConfig({ rootDirectory, reactRouterUse
|
|
|
204
201
|
* An array of URLs to prerender to HTML files at build time.
|
|
205
202
|
*/
|
|
206
203
|
prerender: string[] | null;
|
|
207
|
-
/**
|
|
208
|
-
* Derived from Vite's `base` config
|
|
209
|
-
* */
|
|
210
|
-
publicPath: string;
|
|
211
204
|
/**
|
|
212
205
|
* An object of all available routes, keyed by route id.
|
|
213
206
|
*/
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-nightly-
|
|
2
|
+
* @react-router/dev v0.0.0-nightly-73afcdc0d-20240523
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -86,6 +86,9 @@ let deepFreeze = o => {
|
|
|
86
86
|
});
|
|
87
87
|
return o;
|
|
88
88
|
};
|
|
89
|
+
function resolvePublicPath(viteUserConfig) {
|
|
90
|
+
return viteUserConfig.base ?? "/";
|
|
91
|
+
}
|
|
89
92
|
async function resolveReactRouterConfig({
|
|
90
93
|
rootDirectory,
|
|
91
94
|
reactRouterUserConfig,
|
|
@@ -149,7 +152,7 @@ async function resolveReactRouterConfig({
|
|
|
149
152
|
}
|
|
150
153
|
let appDirectory = path__default["default"].resolve(rootDirectory, userAppDirectory || "app");
|
|
151
154
|
let buildDirectory = path__default["default"].resolve(rootDirectory, userBuildDirectory);
|
|
152
|
-
let publicPath = viteUserConfig
|
|
155
|
+
let publicPath = resolvePublicPath(viteUserConfig);
|
|
153
156
|
if (basename !== "/" && viteCommand === "serve" && !((_viteUserConfig$serve = viteUserConfig.server) !== null && _viteUserConfig$serve !== void 0 && _viteUserConfig$serve.middlewareMode) && !basename.startsWith(publicPath)) {
|
|
154
157
|
throw new Error("When using the React Router `basename` and the Vite `base` config, " + "the `basename` config must begin with `base` for the default " + "Vite dev server.");
|
|
155
158
|
}
|
|
@@ -194,7 +197,6 @@ async function resolveReactRouterConfig({
|
|
|
194
197
|
buildEnd,
|
|
195
198
|
future,
|
|
196
199
|
prerender,
|
|
197
|
-
publicPath,
|
|
198
200
|
routes: routes$1,
|
|
199
201
|
serverBuildFile,
|
|
200
202
|
serverBundles,
|
|
@@ -282,4 +284,5 @@ let disjunctionListFormat = new Intl.ListFormat("en", {
|
|
|
282
284
|
|
|
283
285
|
exports.configRouteToBranchRoute = configRouteToBranchRoute;
|
|
284
286
|
exports.resolveEntryFiles = resolveEntryFiles;
|
|
287
|
+
exports.resolvePublicPath = resolvePublicPath;
|
|
285
288
|
exports.resolveReactRouterConfig = resolveReactRouterConfig;
|
package/dist/index.js
CHANGED
package/dist/invariant.js
CHANGED
package/dist/vite/babel.js
CHANGED
package/dist/vite/build.js
CHANGED
package/dist/vite/dev.js
CHANGED
package/dist/vite/index.js
CHANGED
package/dist/vite/plugin.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export type ReactRouterPluginContext = ReactRouterPluginSsrBuildContext & {
|
|
|
60
60
|
rootDirectory: string;
|
|
61
61
|
entryClientFilePath: string;
|
|
62
62
|
entryServerFilePath: string;
|
|
63
|
+
publicPath: string;
|
|
63
64
|
reactRouterConfig: ResolvedVitePluginConfig;
|
|
64
65
|
viteManifestEnabled: boolean;
|
|
65
66
|
};
|
package/dist/vite/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-nightly-
|
|
2
|
+
* @react-router/dev v0.0.0-nightly-73afcdc0d-20240523
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -153,12 +153,12 @@ const getReactRouterManifestBuildAssets = (ctx, viteManifest, entryFilePath, pre
|
|
|
153
153
|
let prependedAssetChunks = prependedAssetFilePaths.map(filePath => resolveChunk(ctx, viteManifest, filePath));
|
|
154
154
|
let chunks = resolveDependantChunks(viteManifest, [...prependedAssetChunks, entryChunk]);
|
|
155
155
|
return {
|
|
156
|
-
module: `${ctx.
|
|
156
|
+
module: `${ctx.publicPath}${entryChunk.file}`,
|
|
157
157
|
imports: dedupe(chunks.flatMap(e => e.imports ?? [])).map(imported => {
|
|
158
|
-
return `${ctx.
|
|
158
|
+
return `${ctx.publicPath}${viteManifest[imported].file}`;
|
|
159
159
|
}) ?? [],
|
|
160
160
|
css: dedupe(chunks.flatMap(e => e.css ?? [])).map(href => {
|
|
161
|
-
return `${ctx.
|
|
161
|
+
return `${ctx.publicPath}${href}`;
|
|
162
162
|
}) ?? []
|
|
163
163
|
};
|
|
164
164
|
};
|
|
@@ -285,6 +285,7 @@ const reactRouterVitePlugin = _config => {
|
|
|
285
285
|
rootDirectory,
|
|
286
286
|
reactRouterConfig
|
|
287
287
|
});
|
|
288
|
+
let publicPath = config.resolvePublicPath(viteUserConfig);
|
|
288
289
|
let viteManifestEnabled = ((_viteUserConfig$build = viteUserConfig.build) === null || _viteUserConfig$build === void 0 ? void 0 : _viteUserConfig$build.manifest) === true;
|
|
289
290
|
let ssrBuildCtx = viteConfigEnv.isSsrBuild && viteCommand === "build" ? {
|
|
290
291
|
isSsrBuild: true,
|
|
@@ -298,6 +299,7 @@ const reactRouterVitePlugin = _config => {
|
|
|
298
299
|
rootDirectory,
|
|
299
300
|
entryClientFilePath,
|
|
300
301
|
entryServerFilePath,
|
|
302
|
+
publicPath,
|
|
301
303
|
viteManifestEnabled,
|
|
302
304
|
...ssrBuildCtx
|
|
303
305
|
};
|
|
@@ -325,7 +327,7 @@ const reactRouterVitePlugin = _config => {
|
|
|
325
327
|
export const basename = ${JSON.stringify(ctx.reactRouterConfig.basename)};
|
|
326
328
|
export const future = ${JSON.stringify(ctx.reactRouterConfig.future)};
|
|
327
329
|
export const isSpaMode = ${!ctx.reactRouterConfig.ssr && ctx.reactRouterConfig.prerender == null};
|
|
328
|
-
export const publicPath = ${JSON.stringify(ctx.
|
|
330
|
+
export const publicPath = ${JSON.stringify(ctx.publicPath)};
|
|
329
331
|
export const entry = { module: entryServer };
|
|
330
332
|
export const routes = {
|
|
331
333
|
${Object.keys(routes).map((key, index) => {
|
|
@@ -397,7 +399,7 @@ const reactRouterVitePlugin = _config => {
|
|
|
397
399
|
};
|
|
398
400
|
let version = getHash(JSON.stringify(fingerprintedValues), 8);
|
|
399
401
|
let manifestPath = path__namespace.posix.join(viteConfig.build.assetsDir, `manifest-${version}.js`);
|
|
400
|
-
let url = `${ctx.
|
|
402
|
+
let url = `${ctx.publicPath}${manifestPath}`;
|
|
401
403
|
let nonFingerprintedValues = {
|
|
402
404
|
url,
|
|
403
405
|
version
|
|
@@ -432,7 +434,7 @@ const reactRouterVitePlugin = _config => {
|
|
|
432
434
|
path: route.path,
|
|
433
435
|
index: route.index,
|
|
434
436
|
caseSensitive: route.caseSensitive,
|
|
435
|
-
module: path__namespace.posix.join(ctx.
|
|
437
|
+
module: path__namespace.posix.join(ctx.publicPath, `${resolveFileUrl.resolveFileUrl(ctx, resolveRelativeRouteFilePath(route, ctx.reactRouterConfig))}`),
|
|
436
438
|
hasAction: sourceExports.includes("action"),
|
|
437
439
|
hasLoader: sourceExports.includes("loader"),
|
|
438
440
|
hasClientAction: sourceExports.includes("clientAction"),
|
|
@@ -443,12 +445,12 @@ const reactRouterVitePlugin = _config => {
|
|
|
443
445
|
}
|
|
444
446
|
return {
|
|
445
447
|
version: String(Math.random()),
|
|
446
|
-
url: path__namespace.posix.join(ctx.
|
|
448
|
+
url: path__namespace.posix.join(ctx.publicPath, vmod.url(browserManifestId)),
|
|
447
449
|
hmr: {
|
|
448
|
-
runtime: path__namespace.posix.join(ctx.
|
|
450
|
+
runtime: path__namespace.posix.join(ctx.publicPath, vmod.url(injectHmrRuntimeId))
|
|
449
451
|
},
|
|
450
452
|
entry: {
|
|
451
|
-
module: path__namespace.posix.join(ctx.
|
|
453
|
+
module: path__namespace.posix.join(ctx.publicPath, resolveFileUrl.resolveFileUrl(ctx, ctx.entryClientFilePath)),
|
|
452
454
|
imports: []
|
|
453
455
|
},
|
|
454
456
|
routes
|
|
@@ -1033,8 +1035,8 @@ async function getRouteMetadata(ctx, viteChildCompiler, route, readRouteFile) {
|
|
|
1033
1035
|
path: route.path,
|
|
1034
1036
|
index: route.index,
|
|
1035
1037
|
caseSensitive: route.caseSensitive,
|
|
1036
|
-
url: path__namespace.posix.join(ctx.
|
|
1037
|
-
module: path__namespace.posix.join(ctx.
|
|
1038
|
+
url: path__namespace.posix.join(ctx.publicPath, "/" + path__namespace.relative(ctx.rootDirectory, resolveRelativeRouteFilePath(route, ctx.reactRouterConfig))),
|
|
1039
|
+
module: path__namespace.posix.join(ctx.publicPath, `${resolveFileUrl.resolveFileUrl(ctx, resolveRelativeRouteFilePath(route, ctx.reactRouterConfig))}?import`),
|
|
1038
1040
|
// Ensure the Vite dev server responds with a JS module
|
|
1039
1041
|
hasAction: sourceExports.includes("action"),
|
|
1040
1042
|
hasClientAction: sourceExports.includes("clientAction"),
|
package/dist/vite/profiler.js
CHANGED
package/dist/vite/styles.js
CHANGED
package/dist/vite/vmod.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-73afcdc0d-20240523",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"react-refresh": "^0.14.0",
|
|
43
43
|
"semver": "^7.3.7",
|
|
44
44
|
"set-cookie-parser": "^2.6.0",
|
|
45
|
-
"@react-router/
|
|
46
|
-
"react-router": "0.0.0-nightly-
|
|
47
|
-
"
|
|
45
|
+
"@react-router/server-runtime": "0.0.0-nightly-73afcdc0d-20240523",
|
|
46
|
+
"@react-router/node": "0.0.0-nightly-73afcdc0d-20240523",
|
|
47
|
+
"react-router": "0.0.0-nightly-73afcdc0d-20240523"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/babel__core": "^7.20.5",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"tiny-invariant": "^1.2.0",
|
|
70
70
|
"vite": "^5.1.0",
|
|
71
71
|
"wrangler": "^3.28.2",
|
|
72
|
-
"@react-router/serve": "0.0.0-nightly-
|
|
72
|
+
"@react-router/serve": "0.0.0-nightly-73afcdc0d-20240523"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"typescript": "^5.1.0",
|
|
76
76
|
"vite": "^5.1.0",
|
|
77
77
|
"wrangler": "^3.28.2",
|
|
78
|
-
"react-router": "^0.0.0-nightly-
|
|
79
|
-
"@react-router/serve": "^0.0.0-nightly-
|
|
78
|
+
"react-router": "^0.0.0-nightly-73afcdc0d-20240523",
|
|
79
|
+
"@react-router/serve": "^0.0.0-nightly-73afcdc0d-20240523"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"@react-router/serve": {
|