@tanstack/router-core 1.132.0-alpha.4 → 1.132.0-alpha.8
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/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +2 -2
- package/dist/cjs/config.cjs +10 -0
- package/dist/cjs/config.cjs.map +1 -0
- package/dist/cjs/config.d.cts +17 -0
- package/dist/cjs/fileRoute.d.cts +3 -2
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +3 -2
- package/dist/cjs/load-matches.cjs.map +1 -1
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +42 -37
- package/dist/cjs/router.cjs +25 -26
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +19 -13
- package/dist/cjs/ssr/serializer/transformer.cjs +14 -12
- package/dist/cjs/ssr/serializer/transformer.cjs.map +1 -1
- package/dist/cjs/ssr/serializer/transformer.d.cts +53 -15
- package/dist/cjs/ssr/server.d.cts +5 -0
- package/dist/cjs/ssr/ssr-client.cjs.map +1 -1
- package/dist/cjs/ssr/ssr-server.cjs.map +1 -1
- package/dist/esm/Matches.d.ts +2 -2
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/config.d.ts +17 -0
- package/dist/esm/config.js +10 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/fileRoute.d.ts +3 -2
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/load-matches.js.map +1 -1
- package/dist/esm/route.d.ts +42 -37
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.d.ts +19 -13
- package/dist/esm/router.js +25 -26
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/ssr/serializer/transformer.d.ts +53 -15
- package/dist/esm/ssr/serializer/transformer.js +14 -12
- package/dist/esm/ssr/serializer/transformer.js.map +1 -1
- package/dist/esm/ssr/server.d.ts +5 -0
- package/dist/esm/ssr/ssr-client.js.map +1 -1
- package/dist/esm/ssr/ssr-server.js.map +1 -1
- package/package.json +1 -1
- package/src/Matches.ts +2 -2
- package/src/config.ts +42 -0
- package/src/fileRoute.ts +15 -3
- package/src/index.ts +13 -1
- package/src/load-matches.ts +2 -2
- package/src/route.ts +136 -33
- package/src/router.ts +59 -64
- package/src/ssr/serializer/transformer.ts +168 -31
- package/src/ssr/server.ts +6 -0
- package/src/ssr/ssr-client.ts +2 -2
- package/src/ssr/ssr-server.ts +2 -2
package/src/route.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
} from './Matches'
|
|
16
16
|
import type { RootRouteId } from './root'
|
|
17
17
|
import type { ParseRoute, RouteById, RoutePaths } from './routeInfo'
|
|
18
|
-
import type { AnyRouter, RegisteredRouter } from './router'
|
|
18
|
+
import type { AnyRouter, Register, RegisteredRouter, SSROption } from './router'
|
|
19
19
|
import type { BuildLocationFn, NavigateFn } from './RouterProvider'
|
|
20
20
|
import type {
|
|
21
21
|
Assign,
|
|
@@ -41,6 +41,7 @@ import type {
|
|
|
41
41
|
ValidatorFn,
|
|
42
42
|
ValidatorObj,
|
|
43
43
|
} from './validators'
|
|
44
|
+
import type { ValidateSerializableLifecycleResult } from './ssr/serializer/transformer'
|
|
44
45
|
|
|
45
46
|
export type AnyPathParams = {}
|
|
46
47
|
|
|
@@ -391,6 +392,7 @@ export interface RouteTypes<
|
|
|
391
392
|
in out TLoaderFn,
|
|
392
393
|
in out TChildren,
|
|
393
394
|
in out TFileRouteTypes,
|
|
395
|
+
in out TSSR,
|
|
394
396
|
> {
|
|
395
397
|
parentRoute: TParentRoute
|
|
396
398
|
path: TPath
|
|
@@ -422,8 +424,23 @@ export interface RouteTypes<
|
|
|
422
424
|
loaderData: ResolveLoaderData<TLoaderFn>
|
|
423
425
|
loaderDeps: TLoaderDeps
|
|
424
426
|
fileRouteTypes: TFileRouteTypes
|
|
427
|
+
ssr: ResolveSSR<TSSR>
|
|
428
|
+
allSsr: ResolveAllSSR<TParentRoute, TSSR>
|
|
425
429
|
}
|
|
426
430
|
|
|
431
|
+
export type ResolveSSR<TSSR> = TSSR extends (...args: ReadonlyArray<any>) => any
|
|
432
|
+
? LooseReturnType<TSSR>
|
|
433
|
+
: TSSR
|
|
434
|
+
|
|
435
|
+
export type ResolveAllSSR<
|
|
436
|
+
TParentRoute extends AnyRoute,
|
|
437
|
+
TSSR,
|
|
438
|
+
> = unknown extends TParentRoute
|
|
439
|
+
? ResolveSSR<TSSR>
|
|
440
|
+
: unknown extends TSSR
|
|
441
|
+
? TParentRoute['types']['ssr']
|
|
442
|
+
: ResolveSSR<TSSR>
|
|
443
|
+
|
|
427
444
|
export type ResolveFullPath<
|
|
428
445
|
TParentRoute extends AnyRoute,
|
|
429
446
|
TPath extends string,
|
|
@@ -440,6 +457,7 @@ export type RouteLazyFn<TRoute extends AnyRoute> = (
|
|
|
440
457
|
) => TRoute
|
|
441
458
|
|
|
442
459
|
export type RouteAddChildrenFn<
|
|
460
|
+
in out TRegister extends Register,
|
|
443
461
|
in out TParentRoute extends AnyRoute,
|
|
444
462
|
in out TPath extends string,
|
|
445
463
|
in out TFullPath extends string,
|
|
@@ -453,12 +471,14 @@ export type RouteAddChildrenFn<
|
|
|
453
471
|
in out TLoaderDeps extends Record<string, any>,
|
|
454
472
|
in out TLoaderFn,
|
|
455
473
|
in out TFileRouteTypes,
|
|
474
|
+
in out TSSR,
|
|
456
475
|
> = <const TNewChildren>(
|
|
457
476
|
children: Constrain<
|
|
458
477
|
TNewChildren,
|
|
459
478
|
ReadonlyArray<AnyRoute> | Record<string, AnyRoute>
|
|
460
479
|
>,
|
|
461
480
|
) => Route<
|
|
481
|
+
TRegister,
|
|
462
482
|
TParentRoute,
|
|
463
483
|
TPath,
|
|
464
484
|
TFullPath,
|
|
@@ -472,10 +492,12 @@ export type RouteAddChildrenFn<
|
|
|
472
492
|
TLoaderDeps,
|
|
473
493
|
TLoaderFn,
|
|
474
494
|
TNewChildren,
|
|
475
|
-
TFileRouteTypes
|
|
495
|
+
TFileRouteTypes,
|
|
496
|
+
TSSR
|
|
476
497
|
>
|
|
477
498
|
|
|
478
499
|
export type RouteAddFileChildrenFn<
|
|
500
|
+
in out TRegister extends Register,
|
|
479
501
|
in out TParentRoute extends AnyRoute,
|
|
480
502
|
in out TPath extends string,
|
|
481
503
|
in out TFullPath extends string,
|
|
@@ -489,9 +511,11 @@ export type RouteAddFileChildrenFn<
|
|
|
489
511
|
in out TLoaderDeps extends Record<string, any>,
|
|
490
512
|
in out TLoaderFn,
|
|
491
513
|
in out TFileRouteTypes,
|
|
514
|
+
in out TSSR,
|
|
492
515
|
> = <const TNewChildren>(
|
|
493
516
|
children: TNewChildren,
|
|
494
517
|
) => Route<
|
|
518
|
+
TRegister,
|
|
495
519
|
TParentRoute,
|
|
496
520
|
TPath,
|
|
497
521
|
TFullPath,
|
|
@@ -505,10 +529,12 @@ export type RouteAddFileChildrenFn<
|
|
|
505
529
|
TLoaderDeps,
|
|
506
530
|
TLoaderFn,
|
|
507
531
|
TNewChildren,
|
|
508
|
-
TFileRouteTypes
|
|
532
|
+
TFileRouteTypes,
|
|
533
|
+
TSSR
|
|
509
534
|
>
|
|
510
535
|
|
|
511
536
|
export type RouteAddFileTypesFn<
|
|
537
|
+
TRegister extends Register,
|
|
512
538
|
TParentRoute extends AnyRoute,
|
|
513
539
|
TPath extends string,
|
|
514
540
|
TFullPath extends string,
|
|
@@ -522,7 +548,9 @@ export type RouteAddFileTypesFn<
|
|
|
522
548
|
TLoaderDeps extends Record<string, any>,
|
|
523
549
|
TLoaderFn,
|
|
524
550
|
TChildren,
|
|
551
|
+
TSSR,
|
|
525
552
|
> = <TNewFileRouteTypes>() => Route<
|
|
553
|
+
TRegister,
|
|
526
554
|
TParentRoute,
|
|
527
555
|
TPath,
|
|
528
556
|
TFullPath,
|
|
@@ -536,10 +564,12 @@ export type RouteAddFileTypesFn<
|
|
|
536
564
|
TLoaderDeps,
|
|
537
565
|
TLoaderFn,
|
|
538
566
|
TChildren,
|
|
539
|
-
TNewFileRouteTypes
|
|
567
|
+
TNewFileRouteTypes,
|
|
568
|
+
TSSR
|
|
540
569
|
>
|
|
541
570
|
|
|
542
571
|
export interface Route<
|
|
572
|
+
in out TRegister extends Register,
|
|
543
573
|
in out TParentRoute extends AnyRoute,
|
|
544
574
|
in out TPath extends string,
|
|
545
575
|
in out TFullPath extends string,
|
|
@@ -554,6 +584,7 @@ export interface Route<
|
|
|
554
584
|
in out TLoaderFn,
|
|
555
585
|
in out TChildren,
|
|
556
586
|
in out TFileRouteTypes,
|
|
587
|
+
in out TSSR,
|
|
557
588
|
> extends RouteExtensions<TId, TFullPath> {
|
|
558
589
|
path: TPath
|
|
559
590
|
parentRoute: TParentRoute
|
|
@@ -572,9 +603,11 @@ export interface Route<
|
|
|
572
603
|
TLoaderDeps,
|
|
573
604
|
TLoaderFn,
|
|
574
605
|
TChildren,
|
|
575
|
-
TFileRouteTypes
|
|
606
|
+
TFileRouteTypes,
|
|
607
|
+
TSSR
|
|
576
608
|
>
|
|
577
609
|
options: RouteOptions<
|
|
610
|
+
TRegister,
|
|
578
611
|
TParentRoute,
|
|
579
612
|
TId,
|
|
580
613
|
TCustomId,
|
|
@@ -586,7 +619,8 @@ export interface Route<
|
|
|
586
619
|
TLoaderFn,
|
|
587
620
|
TRouterContext,
|
|
588
621
|
TRouteContextFn,
|
|
589
|
-
TBeforeLoadFn
|
|
622
|
+
TBeforeLoadFn,
|
|
623
|
+
TSSR
|
|
590
624
|
>
|
|
591
625
|
isRoot: TParentRoute extends AnyRoute ? true : false
|
|
592
626
|
/** @internal */
|
|
@@ -596,6 +630,7 @@ export interface Route<
|
|
|
596
630
|
lazyFn?: () => Promise<
|
|
597
631
|
LazyRoute<
|
|
598
632
|
Route<
|
|
633
|
+
TRegister,
|
|
599
634
|
TParentRoute,
|
|
600
635
|
TPath,
|
|
601
636
|
TFullPath,
|
|
@@ -609,7 +644,8 @@ export interface Route<
|
|
|
609
644
|
TLoaderDeps,
|
|
610
645
|
TLoaderFn,
|
|
611
646
|
TChildren,
|
|
612
|
-
TFileRouteTypes
|
|
647
|
+
TFileRouteTypes,
|
|
648
|
+
TSSR
|
|
613
649
|
>
|
|
614
650
|
>
|
|
615
651
|
>
|
|
@@ -636,6 +672,7 @@ export interface Route<
|
|
|
636
672
|
) => this
|
|
637
673
|
lazy: RouteLazyFn<
|
|
638
674
|
Route<
|
|
675
|
+
TRegister,
|
|
639
676
|
TParentRoute,
|
|
640
677
|
TPath,
|
|
641
678
|
TFullPath,
|
|
@@ -649,10 +686,12 @@ export interface Route<
|
|
|
649
686
|
TLoaderDeps,
|
|
650
687
|
TLoaderFn,
|
|
651
688
|
TChildren,
|
|
652
|
-
TFileRouteTypes
|
|
689
|
+
TFileRouteTypes,
|
|
690
|
+
TSSR
|
|
653
691
|
>
|
|
654
692
|
>
|
|
655
693
|
addChildren: RouteAddChildrenFn<
|
|
694
|
+
TRegister,
|
|
656
695
|
TParentRoute,
|
|
657
696
|
TPath,
|
|
658
697
|
TFullPath,
|
|
@@ -665,9 +704,11 @@ export interface Route<
|
|
|
665
704
|
TBeforeLoadFn,
|
|
666
705
|
TLoaderDeps,
|
|
667
706
|
TLoaderFn,
|
|
668
|
-
TFileRouteTypes
|
|
707
|
+
TFileRouteTypes,
|
|
708
|
+
TSSR
|
|
669
709
|
>
|
|
670
710
|
_addFileChildren: RouteAddFileChildrenFn<
|
|
711
|
+
TRegister,
|
|
671
712
|
TParentRoute,
|
|
672
713
|
TPath,
|
|
673
714
|
TFullPath,
|
|
@@ -680,9 +721,11 @@ export interface Route<
|
|
|
680
721
|
TBeforeLoadFn,
|
|
681
722
|
TLoaderDeps,
|
|
682
723
|
TLoaderFn,
|
|
683
|
-
TFileRouteTypes
|
|
724
|
+
TFileRouteTypes,
|
|
725
|
+
TSSR
|
|
684
726
|
>
|
|
685
727
|
_addFileTypes: RouteAddFileTypesFn<
|
|
728
|
+
TRegister,
|
|
686
729
|
TParentRoute,
|
|
687
730
|
TPath,
|
|
688
731
|
TFullPath,
|
|
@@ -695,7 +738,8 @@ export interface Route<
|
|
|
695
738
|
TBeforeLoadFn,
|
|
696
739
|
TLoaderDeps,
|
|
697
740
|
TLoaderFn,
|
|
698
|
-
TChildren
|
|
741
|
+
TChildren,
|
|
742
|
+
TSSR
|
|
699
743
|
>
|
|
700
744
|
}
|
|
701
745
|
|
|
@@ -713,6 +757,8 @@ export type AnyRoute = Route<
|
|
|
713
757
|
any,
|
|
714
758
|
any,
|
|
715
759
|
any,
|
|
760
|
+
any,
|
|
761
|
+
any,
|
|
716
762
|
any
|
|
717
763
|
>
|
|
718
764
|
|
|
@@ -721,6 +767,7 @@ export type AnyRouteWithContext<TContext> = AnyRoute & {
|
|
|
721
767
|
}
|
|
722
768
|
|
|
723
769
|
export type RouteOptions<
|
|
770
|
+
TRegister extends Register,
|
|
724
771
|
TParentRoute extends AnyRoute = AnyRoute,
|
|
725
772
|
TId extends string = string,
|
|
726
773
|
TCustomId extends string = string,
|
|
@@ -733,7 +780,9 @@ export type RouteOptions<
|
|
|
733
780
|
TRouterContext = {},
|
|
734
781
|
TRouteContextFn = AnyContext,
|
|
735
782
|
TBeforeLoadFn = AnyContext,
|
|
783
|
+
TSSR = unknown,
|
|
736
784
|
> = BaseRouteOptions<
|
|
785
|
+
TRegister,
|
|
737
786
|
TParentRoute,
|
|
738
787
|
TId,
|
|
739
788
|
TCustomId,
|
|
@@ -744,7 +793,8 @@ export type RouteOptions<
|
|
|
744
793
|
TLoaderFn,
|
|
745
794
|
TRouterContext,
|
|
746
795
|
TRouteContextFn,
|
|
747
|
-
TBeforeLoadFn
|
|
796
|
+
TBeforeLoadFn,
|
|
797
|
+
TSSR
|
|
748
798
|
> &
|
|
749
799
|
UpdatableRouteOptions<
|
|
750
800
|
NoInfer<TParentRoute>,
|
|
@@ -790,6 +840,7 @@ export type BeforeLoadFn<
|
|
|
790
840
|
) => any
|
|
791
841
|
|
|
792
842
|
export type FileBaseRouteOptions<
|
|
843
|
+
TRegister extends Register,
|
|
793
844
|
TParentRoute extends AnyRoute = AnyRoute,
|
|
794
845
|
TId extends string = string,
|
|
795
846
|
TPath extends string = string,
|
|
@@ -801,6 +852,7 @@ export type FileBaseRouteOptions<
|
|
|
801
852
|
TRouteContextFn = AnyContext,
|
|
802
853
|
TBeforeLoadFn = AnyContext,
|
|
803
854
|
TRemountDepsFn = AnyContext,
|
|
855
|
+
TSSR = unknown,
|
|
804
856
|
> = ParamsOptions<TPath, TParams> & {
|
|
805
857
|
validateSearch?: Constrain<TSearchValidator, AnyValidator, DefaultValidator>
|
|
806
858
|
|
|
@@ -830,13 +882,14 @@ export type FileBaseRouteOptions<
|
|
|
830
882
|
) => any
|
|
831
883
|
>
|
|
832
884
|
|
|
833
|
-
ssr?:
|
|
885
|
+
ssr?: Constrain<
|
|
886
|
+
TSSR,
|
|
834
887
|
| undefined
|
|
835
|
-
|
|
|
836
|
-
| 'data-only'
|
|
888
|
+
| SSROption
|
|
837
889
|
| ((
|
|
838
890
|
ctx: SsrContextOptions<TParentRoute, TSearchValidator, TParams>,
|
|
839
|
-
) => Awaitable<undefined |
|
|
891
|
+
) => Awaitable<undefined | SSROption>)
|
|
892
|
+
>
|
|
840
893
|
|
|
841
894
|
// This async function is called before a route is loaded.
|
|
842
895
|
// If an error is thrown here, the route's loader will not be called.
|
|
@@ -852,7 +905,12 @@ export type FileBaseRouteOptions<
|
|
|
852
905
|
TRouterContext,
|
|
853
906
|
TRouteContextFn
|
|
854
907
|
>,
|
|
855
|
-
) =>
|
|
908
|
+
) => ValidateSerializableLifecycleResult<
|
|
909
|
+
TRegister,
|
|
910
|
+
TParentRoute,
|
|
911
|
+
TSSR,
|
|
912
|
+
TBeforeLoadFn
|
|
913
|
+
>
|
|
856
914
|
>
|
|
857
915
|
|
|
858
916
|
loaderDeps?: (
|
|
@@ -883,11 +941,17 @@ export type FileBaseRouteOptions<
|
|
|
883
941
|
TRouteContextFn,
|
|
884
942
|
TBeforeLoadFn
|
|
885
943
|
>,
|
|
886
|
-
) =>
|
|
944
|
+
) => ValidateSerializableLifecycleResult<
|
|
945
|
+
TRegister,
|
|
946
|
+
TParentRoute,
|
|
947
|
+
TSSR,
|
|
948
|
+
TLoaderFn
|
|
949
|
+
>
|
|
887
950
|
>
|
|
888
951
|
}
|
|
889
952
|
|
|
890
953
|
export type BaseRouteOptions<
|
|
954
|
+
TRegister extends Register,
|
|
891
955
|
TParentRoute extends AnyRoute = AnyRoute,
|
|
892
956
|
TId extends string = string,
|
|
893
957
|
TCustomId extends string = string,
|
|
@@ -899,8 +963,10 @@ export type BaseRouteOptions<
|
|
|
899
963
|
TRouterContext = {},
|
|
900
964
|
TRouteContextFn = AnyContext,
|
|
901
965
|
TBeforeLoadFn = AnyContext,
|
|
966
|
+
TSSR = unknown,
|
|
902
967
|
> = RoutePathOptions<TCustomId, TPath> &
|
|
903
968
|
FileBaseRouteOptions<
|
|
969
|
+
TRegister,
|
|
904
970
|
TParentRoute,
|
|
905
971
|
TId,
|
|
906
972
|
TPath,
|
|
@@ -910,7 +976,9 @@ export type BaseRouteOptions<
|
|
|
910
976
|
TLoaderFn,
|
|
911
977
|
TRouterContext,
|
|
912
978
|
TRouteContextFn,
|
|
913
|
-
TBeforeLoadFn
|
|
979
|
+
TBeforeLoadFn,
|
|
980
|
+
AnyContext,
|
|
981
|
+
TSSR
|
|
914
982
|
> & {
|
|
915
983
|
getParentRoute: () => TParentRoute
|
|
916
984
|
}
|
|
@@ -1249,14 +1317,17 @@ export interface RootRouteOptionsExtensions
|
|
|
1249
1317
|
extends DefaultRootRouteOptionsExtensions {}
|
|
1250
1318
|
|
|
1251
1319
|
export type RootRouteOptions<
|
|
1320
|
+
TRegister extends Register = Register,
|
|
1252
1321
|
TSearchValidator = undefined,
|
|
1253
1322
|
TRouterContext = {},
|
|
1254
1323
|
TRouteContextFn = AnyContext,
|
|
1255
1324
|
TBeforeLoadFn = AnyContext,
|
|
1256
1325
|
TLoaderDeps extends Record<string, any> = {},
|
|
1257
1326
|
TLoaderFn = undefined,
|
|
1327
|
+
TSSR = unknown,
|
|
1258
1328
|
> = Omit<
|
|
1259
1329
|
RouteOptions<
|
|
1330
|
+
TRegister,
|
|
1260
1331
|
any, // TParentRoute
|
|
1261
1332
|
RootRouteId, // TId
|
|
1262
1333
|
RootRouteId, // TCustomId
|
|
@@ -1268,7 +1339,8 @@ export type RootRouteOptions<
|
|
|
1268
1339
|
TLoaderFn,
|
|
1269
1340
|
TRouterContext,
|
|
1270
1341
|
TRouteContextFn,
|
|
1271
|
-
TBeforeLoadFn
|
|
1342
|
+
TBeforeLoadFn,
|
|
1343
|
+
TSSR
|
|
1272
1344
|
>,
|
|
1273
1345
|
| 'path'
|
|
1274
1346
|
| 'id'
|
|
@@ -1334,6 +1406,7 @@ export type NotFoundRouteProps = {
|
|
|
1334
1406
|
}
|
|
1335
1407
|
|
|
1336
1408
|
export class BaseRoute<
|
|
1409
|
+
in out TRegister extends Register,
|
|
1337
1410
|
in out TParentRoute extends AnyRoute = AnyRoute,
|
|
1338
1411
|
in out TPath extends string = '/',
|
|
1339
1412
|
in out TFullPath extends string = ResolveFullPath<TParentRoute, TPath>,
|
|
@@ -1348,9 +1421,11 @@ export class BaseRoute<
|
|
|
1348
1421
|
in out TLoaderFn = undefined,
|
|
1349
1422
|
in out TChildren = unknown,
|
|
1350
1423
|
in out TFileRouteTypes = unknown,
|
|
1424
|
+
in out TSSR = unknown,
|
|
1351
1425
|
> {
|
|
1352
1426
|
isRoot: TParentRoute extends AnyRoute ? true : false
|
|
1353
1427
|
options: RouteOptions<
|
|
1428
|
+
TRegister,
|
|
1354
1429
|
TParentRoute,
|
|
1355
1430
|
TId,
|
|
1356
1431
|
TCustomId,
|
|
@@ -1362,7 +1437,8 @@ export class BaseRoute<
|
|
|
1362
1437
|
TLoaderFn,
|
|
1363
1438
|
TRouterContext,
|
|
1364
1439
|
TRouteContextFn,
|
|
1365
|
-
TBeforeLoadFn
|
|
1440
|
+
TBeforeLoadFn,
|
|
1441
|
+
TSSR
|
|
1366
1442
|
>
|
|
1367
1443
|
|
|
1368
1444
|
// The following properties are set up in this.init()
|
|
@@ -1395,6 +1471,7 @@ export class BaseRoute<
|
|
|
1395
1471
|
lazyFn?: () => Promise<
|
|
1396
1472
|
LazyRoute<
|
|
1397
1473
|
Route<
|
|
1474
|
+
TRegister,
|
|
1398
1475
|
TParentRoute,
|
|
1399
1476
|
TPath,
|
|
1400
1477
|
TFullPath,
|
|
@@ -1408,7 +1485,8 @@ export class BaseRoute<
|
|
|
1408
1485
|
TLoaderDeps,
|
|
1409
1486
|
TLoaderFn,
|
|
1410
1487
|
TChildren,
|
|
1411
|
-
TFileRouteTypes
|
|
1488
|
+
TFileRouteTypes,
|
|
1489
|
+
TSSR
|
|
1412
1490
|
>
|
|
1413
1491
|
>
|
|
1414
1492
|
>
|
|
@@ -1419,6 +1497,7 @@ export class BaseRoute<
|
|
|
1419
1497
|
|
|
1420
1498
|
constructor(
|
|
1421
1499
|
options?: RouteOptions<
|
|
1500
|
+
TRegister,
|
|
1422
1501
|
TParentRoute,
|
|
1423
1502
|
TId,
|
|
1424
1503
|
TCustomId,
|
|
@@ -1430,7 +1509,8 @@ export class BaseRoute<
|
|
|
1430
1509
|
TLoaderFn,
|
|
1431
1510
|
TRouterContext,
|
|
1432
1511
|
TRouteContextFn,
|
|
1433
|
-
TBeforeLoadFn
|
|
1512
|
+
TBeforeLoadFn,
|
|
1513
|
+
TSSR
|
|
1434
1514
|
>,
|
|
1435
1515
|
) {
|
|
1436
1516
|
this.options = (options as any) || {}
|
|
@@ -1455,7 +1535,8 @@ export class BaseRoute<
|
|
|
1455
1535
|
TLoaderDeps,
|
|
1456
1536
|
TLoaderFn,
|
|
1457
1537
|
TChildren,
|
|
1458
|
-
TFileRouteTypes
|
|
1538
|
+
TFileRouteTypes,
|
|
1539
|
+
TSSR
|
|
1459
1540
|
>
|
|
1460
1541
|
|
|
1461
1542
|
init = (opts: { originalIndex: number }): void => {
|
|
@@ -1463,6 +1544,7 @@ export class BaseRoute<
|
|
|
1463
1544
|
|
|
1464
1545
|
const options = this.options as
|
|
1465
1546
|
| (RouteOptions<
|
|
1547
|
+
TRegister,
|
|
1466
1548
|
TParentRoute,
|
|
1467
1549
|
TId,
|
|
1468
1550
|
TCustomId,
|
|
@@ -1474,7 +1556,8 @@ export class BaseRoute<
|
|
|
1474
1556
|
TLoaderFn,
|
|
1475
1557
|
TRouterContext,
|
|
1476
1558
|
TRouteContextFn,
|
|
1477
|
-
TBeforeLoadFn
|
|
1559
|
+
TBeforeLoadFn,
|
|
1560
|
+
TSSR
|
|
1478
1561
|
> &
|
|
1479
1562
|
RoutePathOptionsIntersection<TCustomId, TPath>)
|
|
1480
1563
|
| undefined
|
|
@@ -1536,6 +1619,7 @@ export class BaseRoute<
|
|
|
1536
1619
|
}
|
|
1537
1620
|
|
|
1538
1621
|
addChildren: RouteAddChildrenFn<
|
|
1622
|
+
TRegister,
|
|
1539
1623
|
TParentRoute,
|
|
1540
1624
|
TPath,
|
|
1541
1625
|
TFullPath,
|
|
@@ -1548,12 +1632,14 @@ export class BaseRoute<
|
|
|
1548
1632
|
TBeforeLoadFn,
|
|
1549
1633
|
TLoaderDeps,
|
|
1550
1634
|
TLoaderFn,
|
|
1551
|
-
TFileRouteTypes
|
|
1635
|
+
TFileRouteTypes,
|
|
1636
|
+
TSSR
|
|
1552
1637
|
> = (children) => {
|
|
1553
1638
|
return this._addFileChildren(children) as any
|
|
1554
1639
|
}
|
|
1555
1640
|
|
|
1556
1641
|
_addFileChildren: RouteAddFileChildrenFn<
|
|
1642
|
+
TRegister,
|
|
1557
1643
|
TParentRoute,
|
|
1558
1644
|
TPath,
|
|
1559
1645
|
TFullPath,
|
|
@@ -1566,7 +1652,8 @@ export class BaseRoute<
|
|
|
1566
1652
|
TBeforeLoadFn,
|
|
1567
1653
|
TLoaderDeps,
|
|
1568
1654
|
TLoaderFn,
|
|
1569
|
-
TFileRouteTypes
|
|
1655
|
+
TFileRouteTypes,
|
|
1656
|
+
TSSR
|
|
1570
1657
|
> = (children) => {
|
|
1571
1658
|
if (Array.isArray(children)) {
|
|
1572
1659
|
this.children = children as TChildren
|
|
@@ -1580,6 +1667,7 @@ export class BaseRoute<
|
|
|
1580
1667
|
}
|
|
1581
1668
|
|
|
1582
1669
|
_addFileTypes: RouteAddFileTypesFn<
|
|
1670
|
+
TRegister,
|
|
1583
1671
|
TParentRoute,
|
|
1584
1672
|
TPath,
|
|
1585
1673
|
TFullPath,
|
|
@@ -1592,7 +1680,8 @@ export class BaseRoute<
|
|
|
1592
1680
|
TBeforeLoadFn,
|
|
1593
1681
|
TLoaderDeps,
|
|
1594
1682
|
TLoaderFn,
|
|
1595
|
-
TChildren
|
|
1683
|
+
TChildren,
|
|
1684
|
+
TSSR
|
|
1596
1685
|
> = () => {
|
|
1597
1686
|
return this as any
|
|
1598
1687
|
}
|
|
@@ -1613,6 +1702,7 @@ export class BaseRoute<
|
|
|
1613
1702
|
}) => {
|
|
1614
1703
|
Object.assign(this.options, options)
|
|
1615
1704
|
return this as unknown as BaseRoute<
|
|
1705
|
+
TRegister,
|
|
1616
1706
|
TParentRoute,
|
|
1617
1707
|
TPath,
|
|
1618
1708
|
TFullPath,
|
|
@@ -1626,7 +1716,8 @@ export class BaseRoute<
|
|
|
1626
1716
|
TLoaderDeps,
|
|
1627
1717
|
TNewLoaderFn,
|
|
1628
1718
|
TChildren,
|
|
1629
|
-
TFileRouteTypes
|
|
1719
|
+
TFileRouteTypes,
|
|
1720
|
+
TSSR
|
|
1630
1721
|
>
|
|
1631
1722
|
}
|
|
1632
1723
|
|
|
@@ -1650,6 +1741,7 @@ export class BaseRoute<
|
|
|
1650
1741
|
|
|
1651
1742
|
lazy: RouteLazyFn<
|
|
1652
1743
|
Route<
|
|
1744
|
+
TRegister,
|
|
1653
1745
|
TParentRoute,
|
|
1654
1746
|
TPath,
|
|
1655
1747
|
TFullPath,
|
|
@@ -1663,7 +1755,8 @@ export class BaseRoute<
|
|
|
1663
1755
|
TLoaderDeps,
|
|
1664
1756
|
TLoaderFn,
|
|
1665
1757
|
TChildren,
|
|
1666
|
-
TFileRouteTypes
|
|
1758
|
+
TFileRouteTypes,
|
|
1759
|
+
TSSR
|
|
1667
1760
|
>
|
|
1668
1761
|
> = (lazyFn) => {
|
|
1669
1762
|
this.lazyFn = lazyFn
|
|
@@ -1684,6 +1777,7 @@ export class BaseRouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> {
|
|
|
1684
1777
|
}
|
|
1685
1778
|
|
|
1686
1779
|
export interface RootRoute<
|
|
1780
|
+
in out TRegister extends Register,
|
|
1687
1781
|
in out TSearchValidator = undefined,
|
|
1688
1782
|
in out TRouterContext = {},
|
|
1689
1783
|
in out TRouteContextFn = AnyContext,
|
|
@@ -1692,7 +1786,9 @@ export interface RootRoute<
|
|
|
1692
1786
|
in out TLoaderFn = undefined,
|
|
1693
1787
|
in out TChildren = unknown,
|
|
1694
1788
|
in out TFileRouteTypes = unknown,
|
|
1789
|
+
in out TSSR = unknown,
|
|
1695
1790
|
> extends Route<
|
|
1791
|
+
TRegister,
|
|
1696
1792
|
any, // TParentRoute
|
|
1697
1793
|
'/', // TPath
|
|
1698
1794
|
'/', // TFullPath
|
|
@@ -1706,10 +1802,12 @@ export interface RootRoute<
|
|
|
1706
1802
|
TLoaderDeps,
|
|
1707
1803
|
TLoaderFn,
|
|
1708
1804
|
TChildren, // TChildren
|
|
1709
|
-
TFileRouteTypes
|
|
1805
|
+
TFileRouteTypes,
|
|
1806
|
+
TSSR
|
|
1710
1807
|
> {}
|
|
1711
1808
|
|
|
1712
1809
|
export class BaseRootRoute<
|
|
1810
|
+
in out TRegister extends Register,
|
|
1713
1811
|
in out TSearchValidator = undefined,
|
|
1714
1812
|
in out TRouterContext = {},
|
|
1715
1813
|
in out TRouteContextFn = AnyContext,
|
|
@@ -1718,7 +1816,9 @@ export class BaseRootRoute<
|
|
|
1718
1816
|
in out TLoaderFn = undefined,
|
|
1719
1817
|
in out TChildren = unknown,
|
|
1720
1818
|
in out TFileRouteTypes = unknown,
|
|
1819
|
+
in out TSSR = unknown,
|
|
1721
1820
|
> extends BaseRoute<
|
|
1821
|
+
TRegister,
|
|
1722
1822
|
any, // TParentRoute
|
|
1723
1823
|
'/', // TPath
|
|
1724
1824
|
'/', // TFullPath
|
|
@@ -1732,16 +1832,19 @@ export class BaseRootRoute<
|
|
|
1732
1832
|
TLoaderDeps,
|
|
1733
1833
|
TLoaderFn,
|
|
1734
1834
|
TChildren, // TChildren
|
|
1735
|
-
TFileRouteTypes
|
|
1835
|
+
TFileRouteTypes,
|
|
1836
|
+
TSSR
|
|
1736
1837
|
> {
|
|
1737
1838
|
constructor(
|
|
1738
1839
|
options?: RootRouteOptions<
|
|
1840
|
+
TRegister,
|
|
1739
1841
|
TSearchValidator,
|
|
1740
1842
|
TRouterContext,
|
|
1741
1843
|
TRouteContextFn,
|
|
1742
1844
|
TBeforeLoadFn,
|
|
1743
1845
|
TLoaderDeps,
|
|
1744
|
-
TLoaderFn
|
|
1846
|
+
TLoaderFn,
|
|
1847
|
+
TSSR
|
|
1745
1848
|
>,
|
|
1746
1849
|
) {
|
|
1747
1850
|
super(options as any)
|