@react-router/dev 0.0.0-experimental-f7761f1cd → 0.0.0-experimental-63fd291ad

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.
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module";
2
- const nodeRequire = createRequire(import.meta.url);
3
- const moduleSyncEnabled = nodeRequire("#module-sync-enabled").default;
2
+ const require = createRequire(import.meta.url);
3
+ const moduleSyncEnabled = require("#module-sync-enabled").default;
4
4
  export { moduleSyncEnabled };
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/dev",
3
- "type": "module",
4
- "version": "0.0.0-experimental-f7761f1cd",
3
+ "version": "0.0.0-experimental-63fd291ad",
5
4
  "description": "Dev tools and CLI for React Router",
6
5
  "homepage": "https://reactrouter.com",
7
6
  "bugs": {
@@ -30,6 +29,10 @@
30
29
  "types": "./dist/vite.d.ts",
31
30
  "default": "./dist/vite.js"
32
31
  },
32
+ "./vite/cloudflare": {
33
+ "types": "./dist/vite/cloudflare.d.ts",
34
+ "default": "./dist/vite/cloudflare.js"
35
+ },
33
36
  "./package.json": "./package.json"
34
37
  },
35
38
  "imports": {
@@ -39,11 +42,11 @@
39
42
  }
40
43
  },
41
44
  "bin": {
42
- "react-router": "bin.cjs"
45
+ "react-router": "bin.js"
43
46
  },
44
47
  "wireit": {
45
48
  "build": {
46
- "command": "tsdown",
49
+ "command": "tsup",
47
50
  "files": [
48
51
  "../../pnpm-workspace.yaml",
49
52
  "cli/**",
@@ -52,7 +55,7 @@
52
55
  "typegen/**",
53
56
  "vite/**",
54
57
  "*.ts",
55
- "bin.cjs",
58
+ "bin.js",
56
59
  "tsconfig.json",
57
60
  "package.json"
58
61
  ],
@@ -62,65 +65,68 @@
62
65
  }
63
66
  },
64
67
  "dependencies": {
65
- "@babel/core": "^7.29.7",
66
- "@babel/generator": "^7.29.7",
67
- "@babel/parser": "^7.29.7",
68
- "@babel/plugin-syntax-jsx": "^7.29.7",
69
- "@babel/preset-typescript": "^7.29.7",
70
- "@babel/traverse": "^7.29.7",
71
- "@babel/types": "^7.29.7",
72
- "@remix-run/node-fetch-server": "^0.13.3",
68
+ "@babel/core": "^7.27.7",
69
+ "@babel/generator": "^7.27.5",
70
+ "@babel/parser": "^7.27.7",
71
+ "@babel/plugin-syntax-jsx": "^7.27.1",
72
+ "@babel/preset-typescript": "^7.27.1",
73
+ "@babel/traverse": "^7.27.7",
74
+ "@babel/types": "^7.27.7",
75
+ "@remix-run/node-fetch-server": "^0.13.0",
73
76
  "arg": "^5.0.1",
74
- "babel-dead-code-elimination": "^1.0.12",
75
- "chokidar": "^5.0.0",
76
- "dedent": "^1.7.2",
77
- "es-module-lexer": "^2.1.0",
78
- "exit-hook": "5.1.0",
79
- "isbot": "^5.1.40",
80
- "jsesc": "3.1.0",
81
- "lodash": "^4.18.1",
82
- "p-map": "^7.0.4",
83
- "pathe": "^2.0.3",
77
+ "babel-dead-code-elimination": "^1.0.6",
78
+ "chokidar": "^4.0.0",
79
+ "dedent": "^1.5.3",
80
+ "es-module-lexer": "^1.3.1",
81
+ "exit-hook": "2.2.1",
82
+ "isbot": "^5.1.11",
83
+ "jsesc": "3.0.2",
84
+ "lodash": "^4.17.21",
85
+ "p-map": "^7.0.3",
86
+ "pathe": "^1.1.2",
84
87
  "picocolors": "^1.1.1",
85
- "pkg-types": "^2.3.1",
86
- "prettier": "^3.8.3",
87
- "react-refresh": "^0.18.0",
88
- "semver": "^7.8.1",
89
- "tinyglobby": "^0.2.16",
90
- "valibot": "^1.4.1",
91
- "@react-router/node": "0.0.0-experimental-f7761f1cd"
88
+ "pkg-types": "^2.3.0",
89
+ "prettier": "^3.6.2",
90
+ "react-refresh": "^0.14.0",
91
+ "semver": "^7.3.7",
92
+ "tinyglobby": "^0.2.14",
93
+ "valibot": "^1.2.0",
94
+ "vite-node": "^3.2.2",
95
+ "@react-router/node": "0.0.0-experimental-63fd291ad"
92
96
  },
93
97
  "devDependencies": {
94
98
  "@types/babel__core": "^7.20.5",
95
99
  "@types/babel__generator": "^7.27.0",
96
- "@types/babel__traverse": "^7.28.0",
100
+ "@types/babel__traverse": "^7.20.7",
97
101
  "@types/dedent": "^0.7.0",
98
- "@types/jest": "^30.0.0",
102
+ "@types/express": "^4.17.9",
103
+ "@types/jest": "^29.5.4",
99
104
  "@types/jsesc": "^3.0.1",
100
- "@types/lodash": "^4.17.24",
101
- "@types/node": "^22.19.19",
105
+ "@types/lodash": "^4.14.182",
106
+ "@types/node": "^20.0.0",
102
107
  "@types/npmcli__package-json": "^4.0.0",
103
- "@types/semver": "^7.7.1",
104
- "@vitejs/plugin-rsc": "~0.5.26",
108
+ "@types/semver": "^7.7.0",
109
+ "@vitejs/plugin-rsc": "~0.5.21",
105
110
  "esbuild-register": "^3.6.0",
106
- "execa": "9.6.1",
107
- "fast-glob": "3.3.3",
108
- "tsdown": "^0.22.0",
109
- "typescript": "^6.0.3",
110
- "vite": "^7.0.0",
111
- "wireit": "0.14.12",
112
- "wrangler": "^4.95.0",
113
- "@react-router/serve": "0.0.0-experimental-f7761f1cd",
114
- "react-router": "^0.0.0-experimental-f7761f1cd"
111
+ "execa": "5.1.1",
112
+ "express": "^4.19.2",
113
+ "fast-glob": "3.2.11",
114
+ "tsup": "^8.3.0",
115
+ "typescript": "^5.4.5",
116
+ "vite": "^6.3.0",
117
+ "wireit": "0.14.9",
118
+ "wrangler": "^4.23.0",
119
+ "@react-router/serve": "0.0.0-experimental-63fd291ad",
120
+ "react-router": "^0.0.0-experimental-63fd291ad"
115
121
  },
116
122
  "peerDependencies": {
117
- "@vitejs/plugin-rsc": "~0.5.26",
118
- "react-server-dom-webpack": "^19.2.6",
123
+ "@vitejs/plugin-rsc": "~0.5.21",
124
+ "react-server-dom-webpack": "^19.2.3",
119
125
  "typescript": "^5.1.0 || ^6.0.0",
120
- "vite": "^7.0.0 || ^8.0.0",
121
- "wrangler": "^4.0.0",
122
- "@react-router/serve": "^0.0.0-experimental-f7761f1cd",
123
- "react-router": "^0.0.0-experimental-f7761f1cd"
126
+ "vite": "^5.1.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
127
+ "wrangler": "^3.28.2 || ^4.0.0",
128
+ "@react-router/serve": "^0.0.0-experimental-63fd291ad",
129
+ "react-router": "^0.0.0-experimental-63fd291ad"
124
130
  },
125
131
  "peerDependenciesMeta": {
126
132
  "@vitejs/plugin-rsc": {
@@ -140,12 +146,12 @@
140
146
  }
141
147
  },
142
148
  "engines": {
143
- "node": ">=22.12.0"
149
+ "node": ">=20.0.0"
144
150
  },
145
151
  "files": [
146
152
  "dist/",
147
153
  "module-sync-enabled/",
148
- "bin.cjs",
154
+ "bin.js",
149
155
  "rsc-types.d.ts",
150
156
  "CHANGELOG.md",
151
157
  "LICENSE.md",
package/bin.cjs DELETED
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
- void (async () => {
3
- let { default: arg } = await import("arg");
4
-
5
- // Minimal replication of our actual parsing in `run.ts`. If not already set,
6
- // default `NODE_ENV` so React loads the proper version in its CJS entry script.
7
- // We have to do this before importing `run.ts` since that is what imports
8
- // `react` (indirectly via `react-router`)
9
- let args = arg({}, { argv: process.argv.slice(2), permissive: true });
10
- if (args._.length === 0 || args._[0] === "dev") {
11
- process.env.NODE_ENV = process.env.NODE_ENV ?? "development";
12
- } else {
13
- process.env.NODE_ENV = process.env.NODE_ENV ?? "production";
14
- }
15
-
16
- await import("./dist/cli/index.js");
17
- })().catch((error) => {
18
- if (error) console.error(error);
19
- process.exit(1);
20
- });
@@ -1,41 +0,0 @@
1
- /**
2
- * @react-router/dev v0.0.0-experimental-f7761f1cd
3
- *
4
- * Copyright (c) Remix Software Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- import { g as preloadVite, h as getVite } from "./typegen-DrKkP7mg.js";
12
- //#region vite/build.ts
13
- async function build(root, viteBuildOptions) {
14
- await preloadVite();
15
- let { assetsInlineLimit, clearScreen, config: configFile, emptyOutDir, force, logLevel, minify, mode, sourcemapClient, sourcemapServer } = viteBuildOptions;
16
- await (await getVite().createBuilder({
17
- root,
18
- mode,
19
- configFile,
20
- build: {
21
- assetsInlineLimit,
22
- emptyOutDir,
23
- minify
24
- },
25
- optimizeDeps: { force },
26
- clearScreen,
27
- logLevel,
28
- plugins: [{
29
- name: "react-router:cli-config",
30
- configEnvironment(name) {
31
- if (sourcemapClient && name === "client") return { build: { sourcemap: sourcemapClient } };
32
- if (sourcemapServer && name !== "client") return { build: { sourcemap: sourcemapServer } };
33
- },
34
- configResolved(config) {
35
- if (!config.plugins.find((plugin) => plugin.name === "react-router" || plugin.name === "react-router/rsc")) throw new Error("React Router Vite plugin not found in Vite config");
36
- }
37
- }]
38
- })).buildApp();
39
- }
40
- //#endregion
41
- export { build };
@@ -1,279 +0,0 @@
1
-
2
- import { i as RouteManifestEntry, n as RouteConfigEntry, r as RouteManifest } from "./routes-Kx8VZRs3.js";
3
- import * as Vite from "vite";
4
-
5
- //#region config/config.d.ts
6
- declare const excludedConfigPresetKeys: readonly ["presets"];
7
- type ExcludedConfigPresetKey = (typeof excludedConfigPresetKeys)[number];
8
- type ConfigPreset = Omit<ReactRouterConfig, ExcludedConfigPresetKey>;
9
- type Preset = {
10
- name: string;
11
- reactRouterConfig?: (args: {
12
- reactRouterUserConfig: ReactRouterConfig;
13
- }) => ConfigPreset | Promise<ConfigPreset>;
14
- reactRouterConfigResolved?: (args: {
15
- reactRouterConfig: ResolvedReactRouterConfig;
16
- }) => void | Promise<void>;
17
- };
18
- declare const branchRouteProperties: readonly ["id", "path", "file", "index"];
19
- type BranchRoute = Pick<RouteManifestEntry, (typeof branchRouteProperties)[number]>;
20
- type ServerBundlesFunction = (args: {
21
- branch: BranchRoute[];
22
- }) => string | Promise<string>;
23
- type BaseBuildManifest = {
24
- routes: RouteManifest;
25
- };
26
- type DefaultBuildManifest = BaseBuildManifest & {
27
- serverBundles?: never;
28
- routeIdToServerBundleId?: never;
29
- };
30
- type ServerBundlesBuildManifest = BaseBuildManifest & {
31
- serverBundles: {
32
- [serverBundleId: string]: {
33
- id: string;
34
- file: string;
35
- };
36
- };
37
- routeIdToServerBundleId: Record<string, string>;
38
- };
39
- type ServerModuleFormat = "esm" | "cjs";
40
- interface FutureConfig {
41
- unstable_optimizeDeps: boolean;
42
- }
43
- type SplitRouteModulesOption = boolean | "enforce";
44
- type BuildManifest = DefaultBuildManifest | ServerBundlesBuildManifest;
45
- type BuildEndHook = (args: {
46
- buildManifest: BuildManifest | undefined;
47
- reactRouterConfig: ResolvedReactRouterConfig;
48
- viteConfig: Vite.ResolvedConfig;
49
- }) => void | Promise<void>;
50
- type PrerenderPaths = boolean | Array<string> | ((args: {
51
- getStaticPaths: () => string[];
52
- }) => Array<string> | Promise<Array<string>>);
53
- /**
54
- * Config to be exported via the default export from `react-router.config.ts`.
55
- */
56
- type ReactRouterConfig = {
57
- /**
58
- * The path to the `app` directory, relative to the root directory. Defaults
59
- * to `"app"`.
60
- */
61
- appDirectory?: string;
62
- /**
63
- * The output format of the server build. Defaults to "esm".
64
- */
65
- serverModuleFormat?: ServerModuleFormat;
66
- /**
67
- * Enabled future flags
68
- */
69
- future?: [keyof FutureConfig] extends [never] ? {
70
- [key: string]: never;
71
- } : Partial<FutureConfig>;
72
- /**
73
- * Automatically split route modules into multiple chunks when possible.
74
- *
75
- * This can be set to `false` to keep route modules in a single chunk, or
76
- * `"enforce"` to require all routes to be splittable.
77
- *
78
- * Defaults to `true`.
79
- */
80
- splitRouteModules?: SplitRouteModulesOption;
81
- /**
82
- * The React Router app basename. Defaults to `"/"`.
83
- */
84
- basename?: string;
85
- /**
86
- * The path to the build directory, relative to the project. Defaults to
87
- * `"build"`.
88
- */
89
- buildDirectory?: string;
90
- /**
91
- * A function that is called after the full React Router build is complete.
92
- */
93
- buildEnd?: BuildEndHook;
94
- /**
95
- * An array of URLs to prerender to HTML files at build time. Can also be a
96
- * function returning an array to dynamically generate URLs.
97
- *
98
- * `concurrency` defaults to 1, which means "no concurrency" - fully serial execution.
99
- * Setting it to a value more than 1 enables concurrent prerendering.
100
- * Setting it to a value higher than one can increase the speed of the build,
101
- * but may consume more resources, and send more concurrent requests to the
102
- * server/CMS.
103
- */
104
- prerender?: PrerenderPaths | {
105
- paths: PrerenderPaths;
106
- concurrency?: number;
107
- };
108
- /**
109
- * An array of React Router plugin config presets to ease integration with
110
- * other platforms and tools.
111
- */
112
- presets?: Array<Preset>;
113
- /**
114
- * Control the "Lazy Route Discovery" behavior
115
- *
116
- * - `routeDiscovery.mode`: By default, this resolves to `lazy` which will
117
- * lazily discover routes as the user navigates around your application.
118
- * You can set this to `initial` to opt-out of this behavior and load all
119
- * routes with the initial HTML document load.
120
- * - `routeDiscovery.manifestPath`: The path to serve the manifest file from.
121
- * Only applies to `mode: "lazy"` and defaults to `/__manifest`.
122
- */
123
- routeDiscovery?: {
124
- mode: "lazy";
125
- manifestPath?: string;
126
- } | {
127
- mode: "initial";
128
- };
129
- /**
130
- * The file name of the server build output. This file
131
- * should end in a `.js` extension and should be deployed to your server.
132
- * Defaults to `"index.js"`.
133
- */
134
- serverBuildFile?: string;
135
- /**
136
- * A function for assigning routes to different server bundles. This
137
- * function should return a server bundle ID which will be used as the
138
- * bundle's directory name within the server build directory.
139
- */
140
- serverBundles?: ServerBundlesFunction;
141
- /**
142
- * Enable server-side rendering for your application. Disable to use "SPA
143
- * Mode", which will request the `/` path at build-time and save it as an
144
- * `index.html` file with your assets so your application can be deployed as a
145
- * SPA without server-rendering. Default's to `true`.
146
- */
147
- ssr?: boolean;
148
- /**
149
- * Enable subresource integrity hashes on asset script tags. Defaults to
150
- * `false`.
151
- */
152
- subResourceIntegrity?: boolean;
153
- /**
154
- * An array of allowed origin hosts for action submissions to UI routes (does not apply
155
- * to resource routes). Supports micromatch glob patterns (`*` to match one segment,
156
- * `**` to match multiple).
157
- *
158
- * ```tsx
159
- * export default {
160
- * allowedActionOrigins: [
161
- * "example.com",
162
- * "*.example.com", // sub.example.com
163
- * "**.example.com", // sub.domain.example.com
164
- * ],
165
- * } satisfies Config;
166
- * ```
167
- *
168
- * If you need to set this value at runtime, you can do in by setting the value
169
- * on the server build in your custom server. For example, when using `express`:
170
- *
171
- * ```ts
172
- * import express from "express";
173
- * import { createRequestHandler } from "@react-router/express";
174
- * import type { ServerBuild } from "react-router";
175
- *
176
- * export const app = express();
177
- *
178
- * async function getBuild() {
179
- * let build: ServerBuild = await import(
180
- * "virtual:react-router/server-build"
181
- * );
182
- * return {
183
- * ...build,
184
- * allowedActionOrigins:
185
- * process.env.NODE_ENV === "development"
186
- * ? undefined
187
- * : ["staging.example.com", "www.example.com"],
188
- * };
189
- * }
190
- *
191
- * app.use(createRequestHandler({ build: getBuild }));
192
- */
193
- allowedActionOrigins?: string[];
194
- };
195
- type ResolvedReactRouterConfig = Readonly<{
196
- /**
197
- * The absolute path to the application source directory.
198
- */
199
- appDirectory: string;
200
- /**
201
- * The React Router app basename. Defaults to `"/"`.
202
- */
203
- basename: string;
204
- /**
205
- * The absolute path to the build directory.
206
- */
207
- buildDirectory: string;
208
- /**
209
- * A function that is called after the full React Router build is complete.
210
- */
211
- buildEnd?: BuildEndHook;
212
- /**
213
- * Enabled future flags
214
- */
215
- future: FutureConfig;
216
- /**
217
- * Whether to automatically split route modules into multiple chunks when
218
- * possible.
219
- */
220
- splitRouteModules: SplitRouteModulesOption;
221
- /**
222
- * An array of URLs to prerender to HTML files at build time. Can also be a
223
- * function returning an array to dynamically generate URLs.
224
- */
225
- prerender: ReactRouterConfig["prerender"];
226
- /**
227
- * Control the "Lazy Route Discovery" behavior
228
- *
229
- * - `routeDiscovery.mode`: By default, this resolves to `lazy` which will
230
- * lazily discover routes as the user navigates around your application.
231
- * You can set this to `initial` to opt-out of this behavior and load all
232
- * routes with the initial HTML document load.
233
- * - `routeDiscovery.manifestPath`: The path to serve the manifest file from.
234
- * Only applies to `mode: "lazy"` and defaults to `/__manifest`.
235
- */
236
- routeDiscovery: ReactRouterConfig["routeDiscovery"];
237
- /**
238
- * An object of all available routes, keyed by route id.
239
- */
240
- routes: RouteManifest;
241
- /**
242
- * The file name of the server build output. This file
243
- * should end in a `.js` extension and should be deployed to your server.
244
- * Defaults to `"index.js"`.
245
- */
246
- serverBuildFile: string;
247
- /**
248
- * A function for assigning routes to different server bundles. This
249
- * function should return a server bundle ID which will be used as the
250
- * bundle's directory name within the server build directory.
251
- */
252
- serverBundles?: ServerBundlesFunction;
253
- /**
254
- * The output format of the server build. Defaults to "esm".
255
- */
256
- serverModuleFormat: ServerModuleFormat;
257
- /**
258
- * Enable server-side rendering for your application. Disable to use "SPA
259
- * Mode", which will request the `/` path at build-time and save it as an
260
- * `index.html` file with your assets so your application can be deployed as a
261
- * SPA without server-rendering. Default's to `true`.
262
- */
263
- ssr: boolean;
264
- /**
265
- * Whether to generate subresource integrity hashes for asset script tags.
266
- */
267
- subResourceIntegrity: boolean;
268
- /**
269
- * The allowed origins for actions / mutations. Does not apply to routes
270
- * without a component. micromatch glob patterns are supported.
271
- */
272
- allowedActionOrigins: string[] | false;
273
- /**
274
- * The resolved array of route config entries exported from `routes.ts`
275
- */
276
- unstable_routeConfig: RouteConfigEntry[];
277
- }>;
278
- //#endregion
279
- export { ServerBundlesFunction as i, Preset as n, ReactRouterConfig as r, BuildManifest as t };
@@ -1,53 +0,0 @@
1
- /**
2
- * @react-router/dev v0.0.0-experimental-f7761f1cd
3
- *
4
- * Copyright (c) Remix Software Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- import { g as preloadVite, h as getVite } from "./typegen-DrKkP7mg.js";
12
- import { n as start, r as stop, t as getSession } from "./cli/index.js";
13
- import colors from "picocolors";
14
- //#region vite/dev.ts
15
- async function dev(root, { clearScreen, config: configFile, cors, force, host, logLevel, mode, open, port, strictPort }) {
16
- await preloadVite();
17
- let server = await getVite().createServer({
18
- root,
19
- mode,
20
- configFile,
21
- server: {
22
- open,
23
- cors,
24
- host,
25
- port,
26
- strictPort
27
- },
28
- optimizeDeps: { force },
29
- clearScreen,
30
- logLevel
31
- });
32
- if (!server.config.plugins.find((plugin) => plugin.name === "react-router" || plugin.name === "react-router/rsc")) {
33
- console.error(colors.red("React Router Vite plugin not found in Vite config"));
34
- process.exit(1);
35
- }
36
- await server.listen();
37
- server.printUrls();
38
- server.bindCLIShortcuts({
39
- print: true,
40
- customShortcuts: [{
41
- key: "p",
42
- description: "start/stop the profiler",
43
- async action(server) {
44
- if (getSession()) await stop(server.config.logger.info);
45
- else await start(() => {
46
- server.config.logger.info("Profiler started");
47
- });
48
- }
49
- }]
50
- });
51
- }
52
- //#endregion
53
- export { dev };