@react-router/dev 0.0.0-experimental-235eba2 → 0.0.0-experimental-8265d95da
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 +14 -9
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/static/refresh-utils.cjs +0 -2
- package/dist/vite/cloudflare.js +4 -7
- package/dist/vite.js +31 -19
- package/package.json +7 -7
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-8265d95da
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -743,7 +743,7 @@ var init_config = __esm({
|
|
|
743
743
|
});
|
|
744
744
|
return o;
|
|
745
745
|
};
|
|
746
|
-
entryExts = [".js", ".jsx", ".ts", ".tsx"];
|
|
746
|
+
entryExts = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".mts"];
|
|
747
747
|
}
|
|
748
748
|
});
|
|
749
749
|
|
|
@@ -1495,10 +1495,6 @@ async function getEnvironmentOptionsResolvers(ctx, viteCommand) {
|
|
|
1495
1495
|
);
|
|
1496
1496
|
let { moduleSyncEnabled } = await import(`file:///${path6.join(packageRoot, "module-sync-enabled/index.mjs")}`);
|
|
1497
1497
|
let vite2 = getVite();
|
|
1498
|
-
let viteServerConditions = [
|
|
1499
|
-
...vite2.defaultServerConditions ?? [],
|
|
1500
|
-
...moduleSyncEnabled ? ["module-sync"] : []
|
|
1501
|
-
];
|
|
1502
1498
|
function getBaseOptions({
|
|
1503
1499
|
viteUserConfig
|
|
1504
1500
|
}) {
|
|
@@ -1530,15 +1526,24 @@ async function getEnvironmentOptionsResolvers(ctx, viteCommand) {
|
|
|
1530
1526
|
function getBaseServerOptions({
|
|
1531
1527
|
viteUserConfig
|
|
1532
1528
|
}) {
|
|
1533
|
-
let
|
|
1529
|
+
let maybeModuleSyncConditions = [
|
|
1530
|
+
...moduleSyncEnabled ? ["module-sync"] : []
|
|
1531
|
+
];
|
|
1532
|
+
let maybeDevelopmentConditions = viteCommand === "build" ? [] : ["development"];
|
|
1533
|
+
let maybeDefaultServerConditions = vite2.defaultServerConditions || [];
|
|
1534
|
+
let defaultExternalConditions = ["node"];
|
|
1535
|
+
let baseConditions = [
|
|
1536
|
+
...maybeDevelopmentConditions,
|
|
1537
|
+
...maybeModuleSyncConditions
|
|
1538
|
+
];
|
|
1534
1539
|
return mergeEnvironmentOptions(getBaseOptions({ viteUserConfig }), {
|
|
1535
1540
|
resolve: {
|
|
1536
1541
|
external: (
|
|
1537
1542
|
// If `unstable_viteEnvironmentApi` is `true`, `resolve.external` is set in the `configEnvironment` hook
|
|
1538
1543
|
ctx.reactRouterConfig.future.unstable_viteEnvironmentApi ? void 0 : ssrExternals
|
|
1539
1544
|
),
|
|
1540
|
-
conditions,
|
|
1541
|
-
externalConditions:
|
|
1545
|
+
conditions: [...baseConditions, ...maybeDefaultServerConditions],
|
|
1546
|
+
externalConditions: [...baseConditions, ...defaultExternalConditions]
|
|
1542
1547
|
},
|
|
1543
1548
|
build: {
|
|
1544
1549
|
// We move SSR-only assets to client assets. Note that the
|
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
|
@@ -158,8 +158,6 @@ const routeUpdates = new Map();
|
|
|
158
158
|
window.__reactRouterRouteModuleUpdates = new Map();
|
|
159
159
|
|
|
160
160
|
import.meta.hot.on("react-router:hmr", async ({ route }) => {
|
|
161
|
-
window.__reactRouterClearCriticalCss();
|
|
162
|
-
|
|
163
161
|
if (route) {
|
|
164
162
|
routeUpdates.set(route.id, route);
|
|
165
163
|
}
|
package/dist/vite/cloudflare.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-8265d95da
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -736,7 +736,7 @@ function omitRoutes(config) {
|
|
|
736
736
|
routes: {}
|
|
737
737
|
};
|
|
738
738
|
}
|
|
739
|
-
var entryExts = [".js", ".jsx", ".ts", ".tsx"];
|
|
739
|
+
var entryExts = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".mts"];
|
|
740
740
|
function isEntryFile(entryBasename, filename) {
|
|
741
741
|
return entryExts.some((ext) => filename === `${entryBasename}${ext}`);
|
|
742
742
|
}
|
|
@@ -803,10 +803,7 @@ var cloudflareDevProxyVitePlugin = (options = {}) => {
|
|
|
803
803
|
name: PLUGIN_NAME,
|
|
804
804
|
config: async (config, configEnv) => {
|
|
805
805
|
await preloadVite();
|
|
806
|
-
const
|
|
807
|
-
const serverConditions = [
|
|
808
|
-
...vite2.defaultServerConditions ?? []
|
|
809
|
-
];
|
|
806
|
+
const externalConditions = ["node"];
|
|
810
807
|
let configResult = await loadConfig({
|
|
811
808
|
rootDirectory: config.root ?? process.cwd(),
|
|
812
809
|
mode: configEnv.mode
|
|
@@ -818,7 +815,7 @@ var cloudflareDevProxyVitePlugin = (options = {}) => {
|
|
|
818
815
|
return {
|
|
819
816
|
ssr: {
|
|
820
817
|
resolve: {
|
|
821
|
-
externalConditions: [...workerdConditions, ...
|
|
818
|
+
externalConditions: [...workerdConditions, ...externalConditions]
|
|
822
819
|
}
|
|
823
820
|
}
|
|
824
821
|
};
|
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-8265d95da
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -740,7 +740,7 @@ function omitRoutes(config) {
|
|
|
740
740
|
routes: {}
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
var entryExts = [".js", ".jsx", ".ts", ".tsx"];
|
|
743
|
+
var entryExts = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".mts"];
|
|
744
744
|
function isEntryFile(entryBasename, filename2) {
|
|
745
745
|
return entryExts.some((ext) => filename2 === `${entryBasename}${ext}`);
|
|
746
746
|
}
|
|
@@ -4073,7 +4073,7 @@ async function handleSpaMode(viteConfig, reactRouterConfig, serverBuildDirectory
|
|
|
4073
4073
|
);
|
|
4074
4074
|
}
|
|
4075
4075
|
await (0, import_promises2.writeFile)(path5.join(clientBuildDirectory, filename2), html);
|
|
4076
|
-
let prettyDir = path5.relative(
|
|
4076
|
+
let prettyDir = path5.relative(viteConfig.root, clientBuildDirectory);
|
|
4077
4077
|
let prettyPath = path5.join(prettyDir, filename2);
|
|
4078
4078
|
if (build.prerender.length > 0) {
|
|
4079
4079
|
viteConfig.logger.info(
|
|
@@ -4201,12 +4201,13 @@ async function prerenderData(handler, prerenderPath, onlyRoutes, clientBuildDire
|
|
|
4201
4201
|
${normalizedPath}`
|
|
4202
4202
|
);
|
|
4203
4203
|
}
|
|
4204
|
-
let
|
|
4205
|
-
let outfile = path5.join(outdir, ...normalizedPath.split("/"));
|
|
4204
|
+
let outfile = path5.join(clientBuildDirectory, ...normalizedPath.split("/"));
|
|
4206
4205
|
await (0, import_promises2.mkdir)(path5.dirname(outfile), { recursive: true });
|
|
4207
4206
|
await (0, import_promises2.writeFile)(outfile, data);
|
|
4208
4207
|
viteConfig.logger.info(
|
|
4209
|
-
`Prerender (data): ${prerenderPath} -> ${import_picocolors3.default.bold(
|
|
4208
|
+
`Prerender (data): ${prerenderPath} -> ${import_picocolors3.default.bold(
|
|
4209
|
+
path5.relative(viteConfig.root, outfile)
|
|
4210
|
+
)}`
|
|
4210
4211
|
);
|
|
4211
4212
|
return data;
|
|
4212
4213
|
}
|
|
@@ -4240,12 +4241,17 @@ async function prerenderRoute(handler, prerenderPath, clientBuildDirectory, reac
|
|
|
4240
4241
|
${html}`
|
|
4241
4242
|
);
|
|
4242
4243
|
}
|
|
4243
|
-
let
|
|
4244
|
-
|
|
4244
|
+
let outfile = path5.join(
|
|
4245
|
+
clientBuildDirectory,
|
|
4246
|
+
...normalizedPath.split("/"),
|
|
4247
|
+
"index.html"
|
|
4248
|
+
);
|
|
4245
4249
|
await (0, import_promises2.mkdir)(path5.dirname(outfile), { recursive: true });
|
|
4246
4250
|
await (0, import_promises2.writeFile)(outfile, html);
|
|
4247
4251
|
viteConfig.logger.info(
|
|
4248
|
-
`Prerender (html): ${prerenderPath} -> ${import_picocolors3.default.bold(
|
|
4252
|
+
`Prerender (html): ${prerenderPath} -> ${import_picocolors3.default.bold(
|
|
4253
|
+
path5.relative(viteConfig.root, outfile)
|
|
4254
|
+
)}`
|
|
4249
4255
|
);
|
|
4250
4256
|
}
|
|
4251
4257
|
async function prerenderResourceRoute(handler, prerenderPath, clientBuildDirectory, reactRouterConfig, viteConfig, requestInit) {
|
|
@@ -4259,12 +4265,13 @@ async function prerenderResourceRoute(handler, prerenderPath, clientBuildDirecto
|
|
|
4259
4265
|
${content.toString("utf8")}`
|
|
4260
4266
|
);
|
|
4261
4267
|
}
|
|
4262
|
-
let
|
|
4263
|
-
let outfile = path5.join(outdir, ...normalizedPath.split("/"));
|
|
4268
|
+
let outfile = path5.join(clientBuildDirectory, ...normalizedPath.split("/"));
|
|
4264
4269
|
await (0, import_promises2.mkdir)(path5.dirname(outfile), { recursive: true });
|
|
4265
4270
|
await (0, import_promises2.writeFile)(outfile, content);
|
|
4266
4271
|
viteConfig.logger.info(
|
|
4267
|
-
`Prerender (resource): ${prerenderPath} -> ${import_picocolors3.default.bold(
|
|
4272
|
+
`Prerender (resource): ${prerenderPath} -> ${import_picocolors3.default.bold(
|
|
4273
|
+
path5.relative(viteConfig.root, outfile)
|
|
4274
|
+
)}`
|
|
4268
4275
|
);
|
|
4269
4276
|
}
|
|
4270
4277
|
async function getPrerenderPaths(prerender, ssr, routes, logWarning = false) {
|
|
@@ -4625,10 +4632,6 @@ async function getEnvironmentOptionsResolvers(ctx, viteCommand) {
|
|
|
4625
4632
|
);
|
|
4626
4633
|
let { moduleSyncEnabled } = await import(`file:///${path5.join(packageRoot, "module-sync-enabled/index.mjs")}`);
|
|
4627
4634
|
let vite2 = getVite();
|
|
4628
|
-
let viteServerConditions = [
|
|
4629
|
-
...vite2.defaultServerConditions ?? [],
|
|
4630
|
-
...moduleSyncEnabled ? ["module-sync"] : []
|
|
4631
|
-
];
|
|
4632
4635
|
function getBaseOptions({
|
|
4633
4636
|
viteUserConfig
|
|
4634
4637
|
}) {
|
|
@@ -4660,15 +4663,24 @@ async function getEnvironmentOptionsResolvers(ctx, viteCommand) {
|
|
|
4660
4663
|
function getBaseServerOptions({
|
|
4661
4664
|
viteUserConfig
|
|
4662
4665
|
}) {
|
|
4663
|
-
let
|
|
4666
|
+
let maybeModuleSyncConditions = [
|
|
4667
|
+
...moduleSyncEnabled ? ["module-sync"] : []
|
|
4668
|
+
];
|
|
4669
|
+
let maybeDevelopmentConditions = viteCommand === "build" ? [] : ["development"];
|
|
4670
|
+
let maybeDefaultServerConditions = vite2.defaultServerConditions || [];
|
|
4671
|
+
let defaultExternalConditions = ["node"];
|
|
4672
|
+
let baseConditions = [
|
|
4673
|
+
...maybeDevelopmentConditions,
|
|
4674
|
+
...maybeModuleSyncConditions
|
|
4675
|
+
];
|
|
4664
4676
|
return mergeEnvironmentOptions(getBaseOptions({ viteUserConfig }), {
|
|
4665
4677
|
resolve: {
|
|
4666
4678
|
external: (
|
|
4667
4679
|
// If `unstable_viteEnvironmentApi` is `true`, `resolve.external` is set in the `configEnvironment` hook
|
|
4668
4680
|
ctx.reactRouterConfig.future.unstable_viteEnvironmentApi ? void 0 : ssrExternals
|
|
4669
4681
|
),
|
|
4670
|
-
conditions,
|
|
4671
|
-
externalConditions:
|
|
4682
|
+
conditions: [...baseConditions, ...maybeDefaultServerConditions],
|
|
4683
|
+
externalConditions: [...baseConditions, ...defaultExternalConditions]
|
|
4672
4684
|
},
|
|
4673
4685
|
build: {
|
|
4674
4686
|
// We move SSR-only assets to client assets. Note that the
|
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-8265d95da",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"set-cookie-parser": "^2.6.0",
|
|
85
85
|
"tinyglobby": "^0.2.14",
|
|
86
86
|
"valibot": "^0.41.0",
|
|
87
|
-
"vite-node": "^3.
|
|
88
|
-
"@react-router/node": "0.0.0-experimental-
|
|
87
|
+
"vite-node": "^3.2.2",
|
|
88
|
+
"@react-router/node": "0.0.0-experimental-8265d95da"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@types/babel__core": "^7.20.5",
|
|
@@ -109,15 +109,15 @@
|
|
|
109
109
|
"vite": "^6.1.0",
|
|
110
110
|
"wireit": "0.14.9",
|
|
111
111
|
"wrangler": "^4.2.0",
|
|
112
|
-
"react-router": "
|
|
113
|
-
"
|
|
112
|
+
"@react-router/serve": "0.0.0-experimental-8265d95da",
|
|
113
|
+
"react-router": "^0.0.0-experimental-8265d95da"
|
|
114
114
|
},
|
|
115
115
|
"peerDependencies": {
|
|
116
116
|
"typescript": "^5.1.0",
|
|
117
117
|
"vite": "^5.1.0 || ^6.0.0 || ^7.0.0",
|
|
118
118
|
"wrangler": "^3.28.2 || ^4.0.0",
|
|
119
|
-
"@react-router/serve": "^0.0.0-experimental-
|
|
120
|
-
"react-router": "^0.0.0-experimental-
|
|
119
|
+
"@react-router/serve": "^0.0.0-experimental-8265d95da",
|
|
120
|
+
"react-router": "^0.0.0-experimental-8265d95da"
|
|
121
121
|
},
|
|
122
122
|
"peerDependenciesMeta": {
|
|
123
123
|
"@react-router/serve": {
|