@react-router/dev 0.0.0-experimental-ae6d61df4 → 0.0.0-experimental-61f2749d7
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 +39 -0
- package/dist/cli/index.js +10 -3
- package/dist/config.d.ts +0 -4
- package/dist/config.js +1 -1
- package/dist/internal.js +40 -7
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.js +1 -2
- package/dist/vite.js +27 -14
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
+
## 7.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix internal `Future` interface naming from `middleware` -> `v8_middleware` ([#14327](https://github.com/remix-run/react-router/pull/14327))
|
|
8
|
+
- Updated dependencies:
|
|
9
|
+
- `react-router@7.9.1`
|
|
10
|
+
- `@react-router/node@7.9.1`
|
|
11
|
+
- `@react-router/serve@7.9.1`
|
|
12
|
+
|
|
13
|
+
## 7.9.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
18
|
+
|
|
19
|
+
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
20
|
+
|
|
21
|
+
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
22
|
+
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
23
|
+
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
24
|
+
- `<HydratedRouter>` [`getContext`](https://reactrouter.com/api/framework-routers/HydratedRouter#getcontext) prop
|
|
25
|
+
|
|
26
|
+
Please see the [Middleware Docs](https://reactrouter.com/how-to/middleware), the [Middleware RFC](https://github.com/remix-run/remix/discussions/7642), and the [Client-side Context RFC](https://github.com/remix-run/react-router/discussions/9856) for more information.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies:
|
|
31
|
+
- `react-router@7.9.0`
|
|
32
|
+
- `@react-router/node@7.9.0`
|
|
33
|
+
- `@react-router/serve@7.9.0`
|
|
34
|
+
|
|
3
35
|
## 7.8.2
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -728,6 +760,7 @@
|
|
|
728
760
|
```
|
|
729
761
|
|
|
730
762
|
This initial implementation targets type inference for:
|
|
763
|
+
|
|
731
764
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
732
765
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
733
766
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -742,6 +775,7 @@
|
|
|
742
775
|
```
|
|
743
776
|
|
|
744
777
|
Check out our docs for more:
|
|
778
|
+
|
|
745
779
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
746
780
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
747
781
|
|
|
@@ -941,6 +975,7 @@
|
|
|
941
975
|
- Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654))
|
|
942
976
|
|
|
943
977
|
- Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613))
|
|
978
|
+
|
|
944
979
|
- `--sourcemapClient`
|
|
945
980
|
|
|
946
981
|
- `--sourcemapClient=inline`
|
|
@@ -1277,6 +1312,7 @@
|
|
|
1277
1312
|
- Add support for `clientLoader`/`clientAction`/`HydrateFallback` route exports ([RFC](https://github.com/remix-run/remix/discussions/7634)) ([#8173](https://github.com/remix-run/remix/pull/8173))
|
|
1278
1313
|
|
|
1279
1314
|
Remix now supports loaders/actions that run on the client (in addition to, or instead of the loader/action that runs on the server). While we still recommend server loaders/actions for the majority of your data needs in a Remix app - these provide some levers you can pull for more advanced use-cases such as:
|
|
1315
|
+
|
|
1280
1316
|
- Leveraging a data source local to the browser (i.e., `localStorage`)
|
|
1281
1317
|
- Managing a client-side cache of server data (like `IndexedDB`)
|
|
1282
1318
|
- Bypassing the Remix server in a BFF setup and hitting your API directly from the browser
|
|
@@ -1680,6 +1716,7 @@
|
|
|
1680
1716
|
- Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772))
|
|
1681
1717
|
|
|
1682
1718
|
Written to server build directory (`build/` by default):
|
|
1719
|
+
|
|
1683
1720
|
- `metafile.css.json`
|
|
1684
1721
|
- `metafile.js.json` (browser JS)
|
|
1685
1722
|
- `metafile.server.json` (server JS)
|
|
@@ -1777,6 +1814,7 @@
|
|
|
1777
1814
|
- built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483))
|
|
1778
1815
|
|
|
1779
1816
|
New options:
|
|
1817
|
+
|
|
1780
1818
|
- `--tls-key` / `tlsKey`: TLS key
|
|
1781
1819
|
- `--tls-cert` / `tlsCert`: TLS Certificate
|
|
1782
1820
|
|
|
@@ -2047,6 +2085,7 @@
|
|
|
2047
2085
|
```
|
|
2048
2086
|
|
|
2049
2087
|
The dev server will:
|
|
2088
|
+
|
|
2050
2089
|
- force `NODE_ENV=development` and warn you if it was previously set to something else
|
|
2051
2090
|
- rebuild your app whenever your Remix app code changes
|
|
2052
2091
|
- restart your app server whenever rebuilds succeed
|
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-61f2749d7
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -503,7 +503,6 @@ async function resolveConfig({
|
|
|
503
503
|
serverBundles,
|
|
504
504
|
serverModuleFormat,
|
|
505
505
|
ssr,
|
|
506
|
-
unstable_rootRouteFile: rootRouteFile,
|
|
507
506
|
unstable_routeConfig: routeConfig
|
|
508
507
|
});
|
|
509
508
|
for (let preset of reactRouterUserConfig.presets ?? []) {
|
|
@@ -914,7 +913,7 @@ function generateFuture(ctx) {
|
|
|
914
913
|
|
|
915
914
|
declare module "react-router" {
|
|
916
915
|
interface Future {
|
|
917
|
-
|
|
916
|
+
v8_middleware: ${ctx.config.future.v8_middleware}
|
|
918
917
|
}
|
|
919
918
|
}
|
|
920
919
|
`;
|
|
@@ -1492,6 +1491,13 @@ var init_with_props = __esm({
|
|
|
1492
1491
|
}
|
|
1493
1492
|
});
|
|
1494
1493
|
|
|
1494
|
+
// vite/load-dotenv.ts
|
|
1495
|
+
var init_load_dotenv = __esm({
|
|
1496
|
+
"vite/load-dotenv.ts"() {
|
|
1497
|
+
"use strict";
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
|
|
1495
1501
|
// vite/plugins/validate-plugin-order.ts
|
|
1496
1502
|
var init_validate_plugin_order = __esm({
|
|
1497
1503
|
"vite/plugins/validate-plugin-order.ts"() {
|
|
@@ -1779,6 +1785,7 @@ var init_plugin = __esm({
|
|
|
1779
1785
|
init_config();
|
|
1780
1786
|
init_optimize_deps_entries();
|
|
1781
1787
|
init_with_props();
|
|
1788
|
+
init_load_dotenv();
|
|
1782
1789
|
init_validate_plugin_order();
|
|
1783
1790
|
init_warn_on_client_source_maps();
|
|
1784
1791
|
CLIENT_NON_COMPONENT_EXPORTS = [
|
package/dist/config.d.ts
CHANGED
|
@@ -202,10 +202,6 @@ type ResolvedReactRouterConfig = Readonly<{
|
|
|
202
202
|
* SPA without server-rendering. Default's to `true`.
|
|
203
203
|
*/
|
|
204
204
|
ssr: boolean;
|
|
205
|
-
/**
|
|
206
|
-
* The absolute path to the root route file.
|
|
207
|
-
*/
|
|
208
|
-
unstable_rootRouteFile: string;
|
|
209
205
|
/**
|
|
210
206
|
* The resolved array of route config entries exported from `routes.ts`
|
|
211
207
|
*/
|
package/dist/config.js
CHANGED
package/dist/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-61f2749d7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -46,6 +46,7 @@ module.exports = __toCommonJS(internal_exports);
|
|
|
46
46
|
|
|
47
47
|
// vite/rsc/plugin.ts
|
|
48
48
|
var import_es_module_lexer2 = require("es-module-lexer");
|
|
49
|
+
var Path5 = __toESM(require("pathe"));
|
|
49
50
|
var babel = __toESM(require("@babel/core"));
|
|
50
51
|
var import_picocolors4 = __toESM(require("picocolors"));
|
|
51
52
|
|
|
@@ -536,7 +537,6 @@ async function resolveConfig({
|
|
|
536
537
|
serverBundles,
|
|
537
538
|
serverModuleFormat,
|
|
538
539
|
ssr,
|
|
539
|
-
unstable_rootRouteFile: rootRouteFile,
|
|
540
540
|
unstable_routeConfig: routeConfig
|
|
541
541
|
});
|
|
542
542
|
for (let preset of reactRouterUserConfig.presets ?? []) {
|
|
@@ -818,7 +818,7 @@ function generateFuture(ctx) {
|
|
|
818
818
|
|
|
819
819
|
declare module "react-router" {
|
|
820
820
|
interface Future {
|
|
821
|
-
|
|
821
|
+
v8_middleware: ${ctx.config.future.v8_middleware}
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
824
|
`;
|
|
@@ -1689,6 +1689,26 @@ function isRootRouteFile({
|
|
|
1689
1689
|
return filePath === rootRouteFile;
|
|
1690
1690
|
}
|
|
1691
1691
|
|
|
1692
|
+
// vite/load-dotenv.ts
|
|
1693
|
+
async function loadDotenv({
|
|
1694
|
+
rootDirectory,
|
|
1695
|
+
viteUserConfig,
|
|
1696
|
+
mode
|
|
1697
|
+
}) {
|
|
1698
|
+
const vite2 = await import("vite");
|
|
1699
|
+
Object.assign(
|
|
1700
|
+
process.env,
|
|
1701
|
+
vite2.loadEnv(
|
|
1702
|
+
mode,
|
|
1703
|
+
viteUserConfig.envDir ?? rootDirectory,
|
|
1704
|
+
// We override the default prefix of "VITE_" with a blank string since
|
|
1705
|
+
// we're targeting the server, so we want to load all environment
|
|
1706
|
+
// variables, not just those explicitly marked for the client
|
|
1707
|
+
""
|
|
1708
|
+
)
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1692
1712
|
// vite/plugins/validate-plugin-order.ts
|
|
1693
1713
|
function validatePluginOrder() {
|
|
1694
1714
|
return {
|
|
@@ -1759,12 +1779,20 @@ function warnOnClientSourceMaps() {
|
|
|
1759
1779
|
// vite/rsc/plugin.ts
|
|
1760
1780
|
function reactRouterRSCVitePlugin() {
|
|
1761
1781
|
let configLoader;
|
|
1762
|
-
let config;
|
|
1763
1782
|
let typegenWatcherPromise;
|
|
1764
1783
|
let viteCommand;
|
|
1765
1784
|
let routeIdByFile;
|
|
1766
1785
|
let logger;
|
|
1767
1786
|
const defaultEntries = getDefaultEntries();
|
|
1787
|
+
let config;
|
|
1788
|
+
let rootRouteFile;
|
|
1789
|
+
function updateConfig(newConfig) {
|
|
1790
|
+
config = newConfig;
|
|
1791
|
+
rootRouteFile = Path5.resolve(
|
|
1792
|
+
newConfig.appDirectory,
|
|
1793
|
+
newConfig.routes.root.file
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1768
1796
|
return [
|
|
1769
1797
|
{
|
|
1770
1798
|
name: "react-router/rsc",
|
|
@@ -1803,12 +1831,17 @@ ${errors.map((x) => ` - ${x}`).join("\n")}
|
|
|
1803
1831
|
});
|
|
1804
1832
|
const configResult = await configLoader.getConfig();
|
|
1805
1833
|
if (!configResult.ok) throw new Error(configResult.error);
|
|
1806
|
-
|
|
1834
|
+
updateConfig(configResult.value);
|
|
1807
1835
|
if (viteUserConfig.base && config.basename !== "/" && viteCommand === "serve" && !viteUserConfig.server?.middlewareMode && !config.basename.startsWith(viteUserConfig.base)) {
|
|
1808
1836
|
throw new Error(
|
|
1809
1837
|
"When using the React Router `basename` and the Vite `base` config, the `basename` config must begin with `base` for the default Vite dev server."
|
|
1810
1838
|
);
|
|
1811
1839
|
}
|
|
1840
|
+
await loadDotenv({
|
|
1841
|
+
rootDirectory,
|
|
1842
|
+
viteUserConfig,
|
|
1843
|
+
mode
|
|
1844
|
+
});
|
|
1812
1845
|
const vite2 = await import("vite");
|
|
1813
1846
|
logger = vite2.createLogger(viteUserConfig.logLevel, {
|
|
1814
1847
|
prefix: "[react-router]"
|
|
@@ -1942,7 +1975,7 @@ ${errors.map((x) => ` - ${x}`).join("\n")}
|
|
|
1942
1975
|
clear: true,
|
|
1943
1976
|
timestamp: true
|
|
1944
1977
|
});
|
|
1945
|
-
|
|
1978
|
+
updateConfig(result.value);
|
|
1946
1979
|
if (configChanged || routeConfigChanged) {
|
|
1947
1980
|
invalidateVirtualModules(viteDevServer);
|
|
1948
1981
|
}
|
|
@@ -2009,7 +2042,7 @@ ${errors.map((x) => ` - ${x}`).join("\n")}
|
|
|
2009
2042
|
id,
|
|
2010
2043
|
viteCommand,
|
|
2011
2044
|
routeIdByFile,
|
|
2012
|
-
rootRouteFile
|
|
2045
|
+
rootRouteFile,
|
|
2013
2046
|
viteEnvironment: this.environment
|
|
2014
2047
|
});
|
|
2015
2048
|
}
|
package/dist/routes.js
CHANGED
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-61f2749d7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -599,7 +599,6 @@ async function resolveConfig({
|
|
|
599
599
|
serverBundles,
|
|
600
600
|
serverModuleFormat,
|
|
601
601
|
ssr,
|
|
602
|
-
unstable_rootRouteFile: rootRouteFile,
|
|
603
602
|
unstable_routeConfig: routeConfig
|
|
604
603
|
});
|
|
605
604
|
for (let preset of reactRouterUserConfig.presets ?? []) {
|
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-61f2749d7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -558,7 +558,6 @@ async function resolveConfig({
|
|
|
558
558
|
serverBundles,
|
|
559
559
|
serverModuleFormat,
|
|
560
560
|
ssr,
|
|
561
|
-
unstable_rootRouteFile: rootRouteFile,
|
|
562
561
|
unstable_routeConfig: routeConfig
|
|
563
562
|
});
|
|
564
563
|
for (let preset of reactRouterUserConfig.presets ?? []) {
|
|
@@ -899,7 +898,7 @@ function generateFuture(ctx) {
|
|
|
899
898
|
|
|
900
899
|
declare module "react-router" {
|
|
901
900
|
interface Future {
|
|
902
|
-
|
|
901
|
+
v8_middleware: ${ctx.config.future.v8_middleware}
|
|
903
902
|
}
|
|
904
903
|
}
|
|
905
904
|
`;
|
|
@@ -2391,6 +2390,26 @@ function toFunctionExpression(decl) {
|
|
|
2391
2390
|
);
|
|
2392
2391
|
}
|
|
2393
2392
|
|
|
2393
|
+
// vite/load-dotenv.ts
|
|
2394
|
+
async function loadDotenv({
|
|
2395
|
+
rootDirectory,
|
|
2396
|
+
viteUserConfig,
|
|
2397
|
+
mode
|
|
2398
|
+
}) {
|
|
2399
|
+
const vite2 = await import("vite");
|
|
2400
|
+
Object.assign(
|
|
2401
|
+
process.env,
|
|
2402
|
+
vite2.loadEnv(
|
|
2403
|
+
mode,
|
|
2404
|
+
viteUserConfig.envDir ?? rootDirectory,
|
|
2405
|
+
// We override the default prefix of "VITE_" with a blank string since
|
|
2406
|
+
// we're targeting the server, so we want to load all environment
|
|
2407
|
+
// variables, not just those explicitly marked for the client
|
|
2408
|
+
""
|
|
2409
|
+
)
|
|
2410
|
+
);
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2394
2413
|
// vite/plugins/validate-plugin-order.ts
|
|
2395
2414
|
function validatePluginOrder() {
|
|
2396
2415
|
return {
|
|
@@ -3166,17 +3185,11 @@ var reactRouterVitePlugin = () => {
|
|
|
3166
3185
|
watch: viteCommand === "serve"
|
|
3167
3186
|
});
|
|
3168
3187
|
await updatePluginContext();
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
// We override the default prefix of "VITE_" with a blank string since
|
|
3175
|
-
// we're targeting the server, so we want to load all environment
|
|
3176
|
-
// variables, not just those explicitly marked for the client
|
|
3177
|
-
""
|
|
3178
|
-
)
|
|
3179
|
-
);
|
|
3188
|
+
await loadDotenv({
|
|
3189
|
+
rootDirectory,
|
|
3190
|
+
viteUserConfig,
|
|
3191
|
+
mode
|
|
3192
|
+
});
|
|
3180
3193
|
let environments = await getEnvironmentsOptions(ctx, viteCommand, {
|
|
3181
3194
|
viteUserConfig
|
|
3182
3195
|
});
|
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-61f2749d7",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"tinyglobby": "^0.2.14",
|
|
91
91
|
"valibot": "^0.41.0",
|
|
92
92
|
"vite-node": "^3.2.2",
|
|
93
|
-
"@react-router/node": "0.0.0-experimental-
|
|
93
|
+
"@react-router/node": "0.0.0-experimental-61f2749d7"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/babel__core": "^7.20.5",
|
|
@@ -114,16 +114,16 @@
|
|
|
114
114
|
"vite": "^6.1.0",
|
|
115
115
|
"wireit": "0.14.9",
|
|
116
116
|
"wrangler": "^4.23.0",
|
|
117
|
-
"
|
|
118
|
-
"react-router": "
|
|
117
|
+
"react-router": "^0.0.0-experimental-61f2749d7",
|
|
118
|
+
"@react-router/serve": "0.0.0-experimental-61f2749d7"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"@vitejs/plugin-rsc": "*",
|
|
122
122
|
"typescript": "^5.1.0",
|
|
123
123
|
"vite": "^5.1.0 || ^6.0.0 || ^7.0.0",
|
|
124
124
|
"wrangler": "^3.28.2 || ^4.0.0",
|
|
125
|
-
"react-router": "^0.0.0-experimental-
|
|
126
|
-
"
|
|
125
|
+
"@react-router/serve": "^0.0.0-experimental-61f2749d7",
|
|
126
|
+
"react-router": "^0.0.0-experimental-61f2749d7"
|
|
127
127
|
},
|
|
128
128
|
"peerDependenciesMeta": {
|
|
129
129
|
"@vitejs/plugin-rsc": {
|