Skip to content

Commit

Permalink
Merge branch 'release-next'
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Dec 3, 2024
2 parents e01a4d7 + a51b35d commit 1a48ae5
Show file tree
Hide file tree
Showing 28 changed files with 217 additions and 59 deletions.
53 changes: 51 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ We manage release notes in this file instead of the paginated Github Releases Pa
- [Minor Changes](#minor-changes)
- [Patch Changes](#patch-changes)
- [Changes by Package](#changes-by-package)
- [**Full Changelog**: `v6.28.0...v7.0.0`](#full-changelog-v6280v700)
- [v6.28.0](#v6280)
- [What's Changed](#whats-changed)
- [Minor Changes](#minor-changes-1)
- [Patch Changes](#patch-changes-1)
- [\<\<\<\<\<\<\< HEAD](#-head)
- [v6.27.0](#v6270)
- [What's Changed](#whats-changed-1)
- [Stabilized APIs](#stabilized-apis)
Expand Down Expand Up @@ -248,6 +246,57 @@ Date: YYYY-MM-DD
**Full Changelog**: [`v7.X.Y...v7.X.Y`](/~https://github.com/remix-run/react-router/compare/react-router@7.X.Y...react-router@7.X.Y)
-->

## v7.0.2

Date: 2024-12-02

### Patch Changes

- Temporarily only use one build in export map so packages can have a peer dependency on react router ([#12437](/~https://github.com/remix-run/react-router/pull/12437))
- Support `moduleResolution` `Node16` and `NodeNext` ([#12440](/~https://github.com/remix-run/react-router/pull/12440))
- Generate wide `matches` and `params` types for child routes ([#12397](/~https://github.com/remix-run/react-router/pull/12397))

At runtime, `matches` includes child route matches and `params` include child route path parameters.
But previously, we only generated types for parent routes and the current route in `matches` and `params`.
To align our generated types more closely to the runtime behavior, we now generate more permissive, wider types when accessing child route information.

### Changes by Package

- [`react-router`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router/CHANGELOG.md#702)
- [`@react-router/architect`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-architect/CHANGELOG.md#702)
- [`@react-router/cloudflare`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-cloudflare/CHANGELOG.md#702)
- [`@react-router/dev`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-dev/CHANGELOG.md#702)
- [`@react-router/express`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-express/CHANGELOG.md#702)
- [`@react-router/fs-routes`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-fs-routes/CHANGELOG.md#702)
- [`@react-router/node`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-node/CHANGELOG.md#702)
- [`@react-router/remix-config-routes-adapter`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-remix-config-routes-adapter/CHANGELOG.md#702)
- [`@react-router/serve`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.2/packages/react-router-serve/CHANGELOG.md#702)

**Full Changelog**: [`v7.0.1...v7.0.2`](/~https://github.com/remix-run/react-router/compare/react-router@7.0.1...react-router@7.0.2)

## v7.0.1

Date: 2024-12-02

### Patch Changes

- Ensure typegen file watcher is cleaned up when Vite dev server restarts ([#12331](/~https://github.com/remix-run/react-router/pull/12331))
- Pass route error to ErrorBoundary as a prop ([#12338](/~https://github.com/remix-run/react-router/pull/12338))

### Changes by Package

- [`react-router`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router/CHANGELOG.md#701)
- [`@react-router/architect`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-architect/CHANGELOG.md#701)
- [`@react-router/cloudflare`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-cloudflare/CHANGELOG.md#701)
- [`@react-router/dev`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-dev/CHANGELOG.md#701)
- [`@react-router/express`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-express/CHANGELOG.md#701)
- [`@react-router/fs-routes`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-fs-routes/CHANGELOG.md#701)
- [`@react-router/node`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-node/CHANGELOG.md#701)
- [`@react-router/remix-config-routes-adapter`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-remix-config-routes-adapter/CHANGELOG.md#701)
- [`@react-router/serve`](/~https://github.com/remix-run/react-router/blob/react-router%407.0.1/packages/react-router-serve/CHANGELOG.md#701)

**Full Changelog**: [`v7.0.0...v7.0.1`](/~https://github.com/remix-run/react-router/compare/react-router@7.0.0...react-router@7.0.1)

## v7.0.0

Date: 2024-11-21
Expand Down
25 changes: 24 additions & 1 deletion integration/typegen-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ test.describe("typegen", () => {
import type { Route } from "./+types/product"
export function loader({ params }: Route.LoaderArgs) {
type Test = Expect<Equal<typeof params.id, string>>
type Test1 = Expect<Equal<typeof params.id, string>>
type Test2 = Expect<Equal<typeof params.asdf, string | undefined>>
return { planet: "world" }
}
Expand Down Expand Up @@ -281,12 +282,25 @@ test.describe("typegen", () => {
import { Expect, Equal } from "../expect-type"
import type { Route } from "./+types/current"
export function loader() {
return { current: 3 }
}
export function meta({ matches }: Route.MetaArgs) {
const parent1 = matches[1]
type Test1 = Expect<Equal<typeof parent1.data, { parent1: number }>>
const parent2 = matches[2]
type Test2 = Expect<Equal<typeof parent2.data, { parent2: number }>>
const current = matches[3]
type Test3 = Expect<Equal<typeof current.data, { current: number }>>
const child1 = matches[4]
type Test4a = Expect<undefined extends typeof child1 ? true : false>
if (child1) {
type Test4b = Expect<Equal<typeof child1.data, unknown>>
}
return []
}
Expand All @@ -296,6 +310,15 @@ test.describe("typegen", () => {
const parent2 = matches[2]
type Test2 = Expect<Equal<typeof parent2.data, { parent2: number }>>
const current = matches[3]
type Test3 = Expect<Equal<typeof current.data, { current: number }>>
const child1 = matches[4]
type Test4a = Expect<undefined extends typeof child1 ? true : false>
if (child1) {
type Test4b = Expect<Equal<typeof child1.data, unknown>>
}
}
`,
});
Expand Down
2 changes: 2 additions & 0 deletions packages/create-react-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `create-react-router`

## 7.0.2

## 7.0.1

## 7.0.0
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-router",
"version": "7.0.1",
"version": "7.0.2",
"description": "Create a new React Router app",
"homepage": "https://reactrouter.com",
"bugs": {
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-architect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `@react-router/architect`

## 7.0.2

### Patch Changes

- Updated dependencies:
- `react-router@7.0.2`
- `@react-router/node@7.0.2`

## 7.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-architect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/architect",
"version": "7.0.1",
"version": "7.0.2",
"description": "Architect server request handler for React Router",
"bugs": {
"url": "/~https://github.com/remix-run/react-router/issues"
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/cloudflare`

## 7.0.2

### Patch Changes

- Updated dependencies:
- `react-router@7.0.2`

## 7.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/cloudflare",
"version": "7.0.1",
"version": "7.0.2",
"description": "Cloudflare platform abstractions for React Router",
"bugs": {
"url": "/~https://github.com/remix-run/react-router/issues"
Expand Down
20 changes: 19 additions & 1 deletion packages/react-router-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# `@react-router/dev`

## 7.0.2

### Patch Changes

- Support `moduleResolution` `Node16` and `NodeNext` ([#12440](/~https://github.com/remix-run/react-router/pull/12440))

- Generate wide `matches` and `params` types for current route and child routes ([#12397](/~https://github.com/remix-run/react-router/pull/12397))

At runtime, `matches` includes child route matches and `params` include child route path parameters.
But previously, we only generated types for parent routes in `matches`; for `params`, we only considered the parent routes and the current route.
To align our generated types more closely to the runtime behavior, we now generate more permissive, wider types when accessing child route information.

- Updated dependencies:
- `react-router@7.0.2`
- `@react-router/node@7.0.2`
- `@react-router/serve@7.0.2`

## 7.0.1

### Patch Changes

- Pass route error to ErrorBoundary as a prop ([#12338](/~https://github.com/remix-run/react-router/pull/12338))
- Ensure typegen file watcher is cleaned up when Vite dev server restarts ([#12331](/~https://github.com/remix-run/react-router/pull/12331))
- Updated dependencies:
- `react-router@7.0.1`
Expand All @@ -26,7 +44,7 @@
+import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
```

- Remove single_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))
- Remove single\_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))

- update minimum node version to 18 ([#11690](/~https://github.com/remix-run/react-router/pull/11690))

Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/dev",
"version": "7.0.1",
"version": "7.0.2",
"description": "Dev tools and CLI for React Router",
"homepage": "https://reactrouter.com",
"bugs": {
Expand Down
8 changes: 5 additions & 3 deletions packages/react-router-dev/typegen/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function generate(ctx: Context, route: RouteManifestEntry): string {
const indent = i === 0 ? "" : " ".repeat(2);
let source = noExtension(rel);
if (!source.startsWith("../")) source = "./" + source;
return `${indent}import type { Info as Parent${i} } from "${source}"`;
return `${indent}import type { Info as Parent${i} } from "${source}.js"`;
})
.join("\n");

Expand All @@ -34,14 +34,16 @@ export function generate(ctx: Context, route: RouteManifestEntry): string {
${parentTypeImports}
type Module = typeof import("../${Pathe.filename(route.file)}")
type Module = typeof import("../${Pathe.filename(route.file)}.js")
export type Info = {
parents: [${parents.map((_, i) => `Parent${i}`).join(", ")}],
id: "${route.id}"
file: "${route.file}"
path: "${route.path}"
params: {${formatParamProperties(urlpath)}}
params: {${formatParamProperties(
urlpath
)}} & { [key: string]: string | undefined }
module: Module
loaderData: T.CreateLoaderData<Module>
actionData: T.CreateActionData<Module>
Expand Down
9 changes: 8 additions & 1 deletion packages/react-router-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# react-router-dom

## 7.0.2

### Patch Changes

- Updated dependencies:
- `react-router@7.0.2`

## 7.0.1

### Patch Changes
Expand All @@ -21,7 +28,7 @@

- Use `createRemixRouter`/`RouterProvider` in `entry.client` instead of `RemixBrowser` ([#11469](/~https://github.com/remix-run/react-router/pull/11469))

- Remove single_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))
- Remove single\_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))

- Remove `future.v7_startTransition` flag ([#11696](/~https://github.com/remix-run/react-router/pull/11696))

Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-dom",
"version": "7.0.1",
"version": "7.0.2",
"description": "Declarative routing for React web applications",
"keywords": [
"react",
Expand Down
10 changes: 9 additions & 1 deletion packages/react-router-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `@react-router/express`

## 7.0.2

### Patch Changes

- Updated dependencies:
- `react-router@7.0.2`
- `@react-router/node@7.0.2`

## 7.0.1

### Patch Changes
Expand All @@ -12,7 +20,7 @@

### Major Changes

- Remove single_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))
- Remove single\_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))
- update minimum node version to 18 ([#11690](/~https://github.com/remix-run/react-router/pull/11690))
- Add `exports` field to all packages ([#11675](/~https://github.com/remix-run/react-router/pull/11675))
- node package no longer re-exports from react-router ([#11702](/~https://github.com/remix-run/react-router/pull/11702))
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/express",
"version": "7.0.1",
"version": "7.0.2",
"description": "Express server request handler for React Router",
"bugs": {
"url": "/~https://github.com/remix-run/react-router/issues"
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-fs-routes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/fs-routes`

## 7.0.2

### Patch Changes

- Updated dependencies:
- `@react-router/dev@7.0.2`

## 7.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-fs-routes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/fs-routes",
"version": "7.0.1",
"version": "7.0.2",
"description": "File system routing conventions for React Router, for use within routes.ts",
"bugs": {
"url": "/~https://github.com/remix-run/react-router/issues"
Expand Down
9 changes: 8 additions & 1 deletion packages/react-router-node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/node`

## 7.0.2

### Patch Changes

- Updated dependencies:
- `react-router@7.0.2`

## 7.0.1

### Patch Changes
Expand All @@ -11,7 +18,7 @@

### Major Changes

- Remove single_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))
- Remove single\_fetch future flag. ([#11522](/~https://github.com/remix-run/react-router/pull/11522))

- For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](/~https://github.com/remix-run/react-router/pull/11837))

Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/node",
"version": "7.0.1",
"version": "7.0.2",
"description": "Node.js platform abstractions for React Router",
"bugs": {
"url": "/~https://github.com/remix-run/react-router/issues"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/remix-config-routes-adapter`

## 7.0.2

### Patch Changes

- Updated dependencies:
- `@react-router/dev@7.0.2`

## 7.0.1

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/remix-routes-option-adapter",
"version": "7.0.1",
"version": "7.0.2",
"description": "Adapter for Remix's \"routes\" config option, for use within routes.ts",
"bugs": {
"url": "/~https://github.com/remix-run/react-router/issues"
Expand Down
Loading

0 comments on commit 1a48ae5

Please sign in to comment.