@tanstack/router-core 0.0.1-beta.154 → 0.0.1-beta.156

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.154",
4
+ "version": "0.0.1-beta.156",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -43,7 +43,7 @@
43
43
  "tiny-invariant": "^1.3.1",
44
44
  "tiny-warning": "^1.0.3",
45
45
  "@gisatcz/cross-package-react-context": "^0.2.0",
46
- "@tanstack/react-store": "0.0.1-beta.154"
46
+ "@tanstack/react-store": "0.0.1-beta.156"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "rollup --config rollup.config.js",
package/src/fileRoute.ts CHANGED
@@ -102,7 +102,7 @@ export class FileRoute<
102
102
  TParentContext extends RouteConstraints['TParentContext'] = TParentRoute['__types']['routeContext'],
103
103
  TAllParentContext extends RouteConstraints['TId'] = TParentRoute['__types']['context'],
104
104
  TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext,
105
- TContext extends RouteConstraints['TContext'] = MergeParamsFromParent<
105
+ TContext extends RouteConstraints['TAllContext'] = MergeParamsFromParent<
106
106
  TParentRoute['__types']['context'],
107
107
  TRouteContext
108
108
  >,
package/src/route.ts CHANGED
@@ -139,7 +139,7 @@ export type RouteOptions<
139
139
  TParentContext extends AnyContext = AnyContext,
140
140
  TAllParentContext extends AnyContext = AnyContext,
141
141
  TRouteContext extends RouteContext = RouteContext,
142
- TContext extends AnyContext = AnyContext,
142
+ TAllContext extends AnyContext = AnyContext,
143
143
  > = BaseRouteOptions<
144
144
  TParentRoute,
145
145
  TCustomId,
@@ -153,7 +153,7 @@ export type RouteOptions<
153
153
  TParentContext,
154
154
  TAllParentContext,
155
155
  TRouteContext,
156
- TContext
156
+ TAllContext
157
157
  > &
158
158
  UpdatableRouteOptions<
159
159
  TLoader,
@@ -161,7 +161,7 @@ export type RouteOptions<
161
161
  TFullSearchSchema,
162
162
  TAllParams,
163
163
  TRouteContext,
164
- TContext
164
+ TAllContext
165
165
  >
166
166
 
167
167
  export type ParamsFallback<
@@ -190,7 +190,7 @@ export type BaseRouteOptions<
190
190
  TParentContext extends AnyContext = AnyContext,
191
191
  TAllParentContext extends AnyContext = AnyContext,
192
192
  TRouteContext extends RouteContext = RouteContext,
193
- TContext extends AnyContext = AnyContext,
193
+ TAllContext extends AnyContext = AnyContext,
194
194
  > = RoutePathOptions<TCustomId, TPath> & {
195
195
  layoutLimit?: string
196
196
  getParentRoute: () => TParentRoute
@@ -201,7 +201,7 @@ export type BaseRouteOptions<
201
201
  TFullSearchSchema,
202
202
  TAllParams,
203
203
  NoInfer<TRouteContext>,
204
- TContext
204
+ TAllContext
205
205
  >
206
206
  } & (
207
207
  | {
@@ -530,7 +530,7 @@ export type RouteConstraints = {
530
530
  TParentContext: AnyContext
531
531
  TAllParentContext: AnyContext
532
532
  TRouteContext: RouteContext
533
- TContext: AnyContext
533
+ TAllContext: AnyContext
534
534
  TRouterContext: AnyContext
535
535
  TChildren: unknown
536
536
  TRouteTree: AnyRoute
@@ -566,7 +566,7 @@ export class Route<
566
566
  TParentContext extends RouteConstraints['TParentContext'] = TParentRoute['__types']['routeContext'],
567
567
  TAllParentContext extends RouteConstraints['TAllParentContext'] = TParentRoute['__types']['context'],
568
568
  TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext,
569
- TContext extends RouteConstraints['TContext'] = MergeParamsFromParent<
569
+ TAllContext extends RouteConstraints['TAllContext'] = MergeParamsFromParent<
570
570
  TParentRoute['__types']['context'],
571
571
  TRouteContext
572
572
  >,
@@ -589,7 +589,7 @@ export class Route<
589
589
  parentContext: TParentContext
590
590
  allParentContext: TAllParentContext
591
591
  routeContext: TRouteContext
592
- context: TContext
592
+ context: TAllContext
593
593
  children: TChildren
594
594
  routeTree: TRouteTree
595
595
  routerContext: TRouterContext
@@ -608,7 +608,7 @@ export class Route<
608
608
  TParentContext,
609
609
  TAllParentContext,
610
610
  TRouteContext,
611
- TContext
611
+ TAllContext
612
612
  > &
613
613
  UpdatableRouteOptions<
614
614
  TLoader,
@@ -616,7 +616,7 @@ export class Route<
616
616
  TFullSearchSchema,
617
617
  TAllParams,
618
618
  TRouteContext,
619
- TContext
619
+ TAllContext
620
620
  >
621
621
 
622
622
  // Set up in this.init()
@@ -647,7 +647,7 @@ export class Route<
647
647
  TParentContext,
648
648
  TAllParentContext,
649
649
  TRouteContext,
650
- TContext
650
+ TAllContext
651
651
  > &
652
652
  UpdatableRouteOptions<
653
653
  TLoader,
@@ -655,7 +655,7 @@ export class Route<
655
655
  TFullSearchSchema,
656
656
  TAllParams,
657
657
  TRouteContext,
658
- TContext
658
+ TAllContext
659
659
  >,
660
660
  ) {
661
661
  this.options = (options as any) || {}
@@ -743,7 +743,7 @@ export class Route<
743
743
  TParentContext,
744
744
  TAllParentContext,
745
745
  TRouteContext,
746
- TContext,
746
+ TAllContext,
747
747
  TRouterContext,
748
748
  TNewChildren,
749
749
  TRouteTree
@@ -759,7 +759,7 @@ export class Route<
759
759
  TFullSearchSchema,
760
760
  TAllParams,
761
761
  TRouteContext,
762
- TContext
762
+ TAllContext
763
763
  >,
764
764
  ) => {
765
765
  Object.assign(this.options, options)
@@ -780,10 +780,24 @@ export class RouterContext<TRouterContext extends {}> {
780
780
  createRootRoute = <
781
781
  TLoader = unknown,
782
782
  TSearchSchema extends AnySearchSchema = {},
783
- TContext extends RouteContext = RouteContext,
783
+ TRouteContext extends RouteContext = RouteContext,
784
784
  >(
785
785
  options?: Omit<
786
- RouteOptions<AnyRoute, RootRouteId, '', {}, TSearchSchema, {}>,
786
+ RouteOptions<
787
+ AnyRoute,
788
+ RootRouteId,
789
+ '',
790
+ TLoader,
791
+ TSearchSchema,
792
+ TSearchSchema,
793
+ TSearchSchema,
794
+ {},
795
+ {},
796
+ TRouterContext,
797
+ TRouterContext,
798
+ TRouteContext,
799
+ MergeParamsFromParent<TRouterContext, TRouteContext>
800
+ >,
787
801
  | 'path'
788
802
  | 'id'
789
803
  | 'getParentRoute'
@@ -792,7 +806,7 @@ export class RouterContext<TRouterContext extends {}> {
792
806
  | 'stringifyParams'
793
807
  >,
794
808
  ) => {
795
- return new RootRoute<TLoader, TSearchSchema, TContext, TRouterContext>(
809
+ return new RootRoute<TLoader, TSearchSchema, TRouteContext, TRouterContext>(
796
810
  options as any,
797
811
  )
798
812
  }
@@ -801,7 +815,7 @@ export class RouterContext<TRouterContext extends {}> {
801
815
  export class RootRoute<
802
816
  TLoader = unknown,
803
817
  TSearchSchema extends AnySearchSchema = {},
804
- TContext extends RouteContext = RouteContext,
818
+ TRouteContext extends RouteContext = RouteContext,
805
819
  TRouterContext extends {} = {},
806
820
  > extends Route<
807
821
  any,
@@ -816,15 +830,29 @@ export class RootRoute<
816
830
  {},
817
831
  TRouterContext,
818
832
  TRouterContext,
819
- MergeParamsFromParent<TRouterContext, TContext>,
820
- MergeParamsFromParent<TRouterContext, TContext>,
833
+ TRouteContext,
834
+ MergeParamsFromParent<TRouterContext, TRouteContext>,
821
835
  TRouterContext,
822
836
  any,
823
837
  any
824
838
  > {
825
839
  constructor(
826
840
  options?: Omit<
827
- RouteOptions<AnyRoute, RootRouteId, '', TLoader, TSearchSchema, {}>,
841
+ RouteOptions<
842
+ AnyRoute,
843
+ RootRouteId,
844
+ '',
845
+ TLoader,
846
+ TSearchSchema,
847
+ TSearchSchema,
848
+ TSearchSchema,
849
+ {},
850
+ {},
851
+ TRouterContext,
852
+ TRouterContext,
853
+ TRouteContext,
854
+ MergeParamsFromParent<TRouterContext, TRouteContext>
855
+ >,
828
856
  | 'path'
829
857
  | 'id'
830
858
  | 'getParentRoute'
package/src/router.ts CHANGED
@@ -1129,6 +1129,7 @@ export class Router<
1129
1129
  preload,
1130
1130
  preloadDelay: userPreloadDelay,
1131
1131
  disabled,
1132
+ state
1132
1133
  }: LinkOptions<TRouteTree, TFrom, TTo>): LinkInfo => {
1133
1134
  // If this link simply reloads the current route,
1134
1135
  // make sure it has a new key so it will trigger a data refresh
@@ -1151,6 +1152,7 @@ export class Router<
1151
1152
  params,
1152
1153
  hash,
1153
1154
  replace,
1155
+ state
1154
1156
  }
1155
1157
 
1156
1158
  const next = this.buildNext(nextOpts)