react-router
Advanced tools
Comparing version 7.0.2-pre.0 to 7.0.2
# `react-router` | ||
## 7.0.2-pre.0 | ||
## 7.0.2 | ||
@@ -8,6 +8,6 @@ ### 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)) | ||
- Generate wide `matches` and `params` types for child routes ([#12397](https://github.com/remix-run/react-router/pull/12397)) | ||
- 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 and the current route in `matches` and `params`. | ||
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. | ||
@@ -34,3 +34,3 @@ | ||
- 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)) | ||
@@ -37,0 +37,0 @@ - Drop support for Node 16, React Router SSR now requires Node 18 or higher ([#11391](https://github.com/remix-run/react-router/pull/11391)) |
@@ -37,3 +37,3 @@ import { av as LinkDescriptor, as as MetaDescriptor, aJ as ServerDataFrom, aK as ClientDataFrom, aL as Func, aM as Equal, aN as Pretty } from '../../route-data-DuV3tXo2.js'; | ||
}>; | ||
type MetaMatches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [MetaMatch<F>, ...MetaMatches<R>] : MetaMatch<RouteInfo>[]; | ||
type MetaMatches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<RouteInfo> | undefined>; | ||
type CreateMetaArgs<T extends RouteInfo> = { | ||
@@ -44,3 +44,3 @@ location: Location; | ||
error?: unknown; | ||
matches: MetaMatches<T["parents"]>; | ||
matches: MetaMatches<[...T["parents"], T]>; | ||
}; | ||
@@ -97,3 +97,3 @@ type MetaDescriptors = MetaDescriptor[]; | ||
}>; | ||
type Matches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [Match<F>, ...Matches<R>] : Match<RouteInfo>[]; | ||
type Matches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [Match<F>, ...Matches<R>] : Array<Match<RouteInfo> | undefined>; | ||
type CreateComponentProps<T extends RouteInfo> = { | ||
@@ -103,3 +103,3 @@ params: T["params"]; | ||
actionData?: T["actionData"]; | ||
matches: Matches<T["parents"]>; | ||
matches: Matches<[...T["parents"], T]>; | ||
}; | ||
@@ -106,0 +106,0 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = { |
/** | ||
* react-router v7.0.2-pre.0 | ||
* react-router v7.0.2 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
@@ -37,3 +37,3 @@ import { av as LinkDescriptor, as as MetaDescriptor, aJ as ServerDataFrom, aK as ClientDataFrom, aL as Func, aM as Equal, aN as Pretty } from '../../route-data-DuV3tXo2.js'; | ||
}>; | ||
type MetaMatches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [MetaMatch<F>, ...MetaMatches<R>] : MetaMatch<RouteInfo>[]; | ||
type MetaMatches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<RouteInfo> | undefined>; | ||
type CreateMetaArgs<T extends RouteInfo> = { | ||
@@ -44,3 +44,3 @@ location: Location; | ||
error?: unknown; | ||
matches: MetaMatches<T["parents"]>; | ||
matches: MetaMatches<[...T["parents"], T]>; | ||
}; | ||
@@ -97,3 +97,3 @@ type MetaDescriptors = MetaDescriptor[]; | ||
}>; | ||
type Matches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [Match<F>, ...Matches<R>] : Match<RouteInfo>[]; | ||
type Matches<T extends RouteInfo[]> = T extends [infer F extends RouteInfo, ...infer R extends RouteInfo[]] ? [Match<F>, ...Matches<R>] : Array<Match<RouteInfo> | undefined>; | ||
type CreateComponentProps<T extends RouteInfo> = { | ||
@@ -103,3 +103,3 @@ params: T["params"]; | ||
actionData?: T["actionData"]; | ||
matches: Matches<T["parents"]>; | ||
matches: Matches<[...T["parents"], T]>; | ||
}; | ||
@@ -106,0 +106,0 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = { |
/** | ||
* react-router v7.0.2-pre.0 | ||
* react-router v7.0.2 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
{ | ||
"name": "react-router", | ||
"version": "7.0.2-pre.0", | ||
"version": "7.0.2", | ||
"description": "Declarative routing for React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2270456
1