@react-router/dev 7.0.1 → 7.0.2-pre.0

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # `@react-router/dev`
2
2
 
3
+ ## 7.0.2-pre.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Support `moduleResolution` `Node16` and `NodeNext` ([#12440](https://github.com/remix-run/react-router/pull/12440))
8
+ - Generate wide `matches` and `params` types for child routes ([#12397](https://github.com/remix-run/react-router/pull/12397))
9
+
10
+ At runtime, `matches` includes child route matches and `params` include child route path parameters.
11
+ But previously, we only generated types for parent routes and the current route in `matches` and `params`.
12
+ To align our generated types more closely to the runtime behavior, we now generate more permissive, wider types when accessing child route information.
13
+
14
+ - Updated dependencies:
15
+ - `react-router@7.0.2-pre.0`
16
+ - `@react-router/node@7.0.2-pre.0`
17
+ - `@react-router/serve@7.0.2-pre.0`
18
+
3
19
  ## 7.0.1
4
20
 
5
21
  ### Patch Changes
@@ -26,7 +42,7 @@
26
42
  +import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
27
43
  ```
28
44
 
29
- - Remove single\_fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
45
+ - Remove single_fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
30
46
 
31
47
  - update minimum node version to 18 ([#11690](https://github.com/remix-run/react-router/pull/11690))
32
48
 
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @react-router/dev v7.0.1
3
+ * @react-router/dev v7.0.2-pre.0
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -600,7 +600,7 @@ function generate(ctx, route) {
600
600
  const indent = i === 0 ? "" : " ".repeat(2);
601
601
  let source = noExtension(rel);
602
602
  if (!source.startsWith("../")) source = "./" + source;
603
- return `${indent}import type { Info as Parent${i} } from "${source}"`;
603
+ return `${indent}import type { Info as Parent${i} } from "${source}.js"`;
604
604
  }).join("\n");
605
605
  return import_dedent.default`
606
606
  // React Router generated types for route:
@@ -610,14 +610,16 @@ function generate(ctx, route) {
610
610
 
611
611
  ${parentTypeImports}
612
612
 
613
- type Module = typeof import("../${Pathe2.filename(route.file)}")
613
+ type Module = typeof import("../${Pathe2.filename(route.file)}.js")
614
614
 
615
615
  export type Info = {
616
616
  parents: [${parents.map((_, i) => `Parent${i}`).join(", ")}],
617
617
  id: "${route.id}"
618
618
  file: "${route.file}"
619
619
  path: "${route.path}"
620
- params: {${formatParamProperties(urlpath)}}
620
+ params: {${formatParamProperties(
621
+ urlpath
622
+ )}} & { [key: string]: string | undefined }
621
623
  module: Module
622
624
  loaderData: T.CreateLoaderData<Module>
623
625
  actionData: T.CreateActionData<Module>
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.0.1
2
+ * @react-router/dev v7.0.2-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/routes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.0.1
2
+ * @react-router/dev v7.0.2-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.0.1
2
+ * @react-router/dev v7.0.2-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.0.1
2
+ * @react-router/dev v7.0.2-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -641,7 +641,7 @@ function generate(ctx, route) {
641
641
  const indent = i === 0 ? "" : " ".repeat(2);
642
642
  let source = noExtension(rel);
643
643
  if (!source.startsWith("../")) source = "./" + source;
644
- return `${indent}import type { Info as Parent${i} } from "${source}"`;
644
+ return `${indent}import type { Info as Parent${i} } from "${source}.js"`;
645
645
  }).join("\n");
646
646
  return import_dedent.default`
647
647
  // React Router generated types for route:
@@ -651,14 +651,16 @@ function generate(ctx, route) {
651
651
 
652
652
  ${parentTypeImports}
653
653
 
654
- type Module = typeof import("../${Pathe2.filename(route.file)}")
654
+ type Module = typeof import("../${Pathe2.filename(route.file)}.js")
655
655
 
656
656
  export type Info = {
657
657
  parents: [${parents.map((_, i) => `Parent${i}`).join(", ")}],
658
658
  id: "${route.id}"
659
659
  file: "${route.file}"
660
660
  path: "${route.path}"
661
- params: {${formatParamProperties(urlpath)}}
661
+ params: {${formatParamProperties(
662
+ urlpath
663
+ )}} & { [key: string]: string | undefined }
662
664
  module: Module
663
665
  loaderData: T.CreateLoaderData<Module>
664
666
  actionData: T.CreateActionData<Module>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/dev",
3
- "version": "7.0.1",
3
+ "version": "7.0.2-pre.0",
4
4
  "description": "Dev tools and CLI for React Router",
5
5
  "homepage": "https://reactrouter.com",
6
6
  "bugs": {
@@ -81,7 +81,7 @@
81
81
  "set-cookie-parser": "^2.6.0",
82
82
  "valibot": "^0.41.0",
83
83
  "vite-node": "^1.6.0",
84
- "@react-router/node": "7.0.1"
84
+ "@react-router/node": "7.0.2-pre.0"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@types/babel__core": "^7.20.5",
@@ -110,15 +110,15 @@
110
110
  "vite": "^5.1.0",
111
111
  "wireit": "0.14.9",
112
112
  "wrangler": "^3.28.2",
113
- "@react-router/serve": "7.0.1",
114
- "react-router": "^7.0.1"
113
+ "@react-router/serve": "7.0.2-pre.0",
114
+ "react-router": "^7.0.2-pre.0"
115
115
  },
116
116
  "peerDependencies": {
117
117
  "typescript": "^5.1.0",
118
118
  "vite": "^5.1.0",
119
119
  "wrangler": "^3.28.2",
120
- "@react-router/serve": "^7.0.1",
121
- "react-router": "^7.0.1"
120
+ "@react-router/serve": "^7.0.2-pre.0",
121
+ "react-router": "^7.0.2-pre.0"
122
122
  },
123
123
  "peerDependenciesMeta": {
124
124
  "@react-router/serve": {