@solidjs/router 0.11.0 → 0.11.1
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/index.js +3 -3
- package/dist/routers/components.d.ts +1 -1
- package/dist/routers/components.jsx +1 -1
- package/dist/routing.js +2 -2
- package/dist/types.d.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -284,14 +284,14 @@ function createRoutes(routeDef, base = "") {
|
|
|
284
284
|
component,
|
|
285
285
|
load,
|
|
286
286
|
children,
|
|
287
|
-
|
|
287
|
+
info
|
|
288
288
|
} = routeDef;
|
|
289
289
|
const isLeaf = !children || Array.isArray(children) && !children.length;
|
|
290
290
|
const shared = {
|
|
291
291
|
key: routeDef,
|
|
292
292
|
component,
|
|
293
293
|
load,
|
|
294
|
-
|
|
294
|
+
info
|
|
295
295
|
};
|
|
296
296
|
return asArray(routeDef.path).reduce((acc, path) => {
|
|
297
297
|
for (const originalPath of expandOptionals(path)) {
|
|
@@ -672,7 +672,7 @@ function Routes(props) {
|
|
|
672
672
|
pattern: route.pattern,
|
|
673
673
|
match: path,
|
|
674
674
|
params,
|
|
675
|
-
|
|
675
|
+
info: route.info
|
|
676
676
|
}))));
|
|
677
677
|
}
|
|
678
678
|
const params = createMemoObject(() => {
|
|
@@ -15,6 +15,6 @@ export type RouteProps<S extends string, T = unknown> = {
|
|
|
15
15
|
load?: RouteLoadFunc<T>;
|
|
16
16
|
matchFilters?: MatchFilters<S>;
|
|
17
17
|
component?: Component<RouteSectionProps<T>>;
|
|
18
|
-
|
|
18
|
+
info?: Record<string, any>;
|
|
19
19
|
};
|
|
20
20
|
export declare const Route: <S extends string, T = unknown>(props: RouteProps<S, T>) => JSX.Element;
|
package/dist/routing.js
CHANGED
|
@@ -56,13 +56,13 @@ export const useBeforeLeave = (listener) => {
|
|
|
56
56
|
onCleanup(s);
|
|
57
57
|
};
|
|
58
58
|
export function createRoutes(routeDef, base = "") {
|
|
59
|
-
const { component, load, children,
|
|
59
|
+
const { component, load, children, info } = routeDef;
|
|
60
60
|
const isLeaf = !children || (Array.isArray(children) && !children.length);
|
|
61
61
|
const shared = {
|
|
62
62
|
key: routeDef,
|
|
63
63
|
component,
|
|
64
64
|
load,
|
|
65
|
-
|
|
65
|
+
info
|
|
66
66
|
};
|
|
67
67
|
return asArray(routeDef.path).reduce((acc, path) => {
|
|
68
68
|
for (const originalPath of expandOptionals(path)) {
|
package/dist/types.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export type RouteDefinition<S extends string | string[] = any, T = unknown> = {
|
|
|
67
67
|
load?: RouteLoadFunc<T>;
|
|
68
68
|
children?: RouteDefinition | RouteDefinition[];
|
|
69
69
|
component?: Component<RouteSectionProps<T>>;
|
|
70
|
-
|
|
70
|
+
info?: Record<string, any>;
|
|
71
71
|
};
|
|
72
72
|
export type MatchFilter = readonly string[] | RegExp | ((s: string) => boolean);
|
|
73
73
|
export type PathParams<P extends string | readonly string[]> = P extends `${infer Head}/${infer Tail}` ? [...PathParams<Head>, ...PathParams<Tail>] : P extends `:${infer S}?` ? [S] : P extends `:${infer S}` ? [S] : P extends `*${infer S}` ? [S] : [];
|
|
@@ -86,7 +86,7 @@ export interface OutputMatch {
|
|
|
86
86
|
pattern: string;
|
|
87
87
|
match: string;
|
|
88
88
|
params: Params;
|
|
89
|
-
|
|
89
|
+
info?: Record<string, any>;
|
|
90
90
|
}
|
|
91
91
|
export interface Route {
|
|
92
92
|
key: unknown;
|
|
@@ -96,7 +96,7 @@ export interface Route {
|
|
|
96
96
|
load?: RouteLoadFunc;
|
|
97
97
|
matcher: (location: string) => PathMatch | null;
|
|
98
98
|
matchFilters?: MatchFilters;
|
|
99
|
-
|
|
99
|
+
info?: Record<string, any>;
|
|
100
100
|
}
|
|
101
101
|
export interface Branch {
|
|
102
102
|
routes: Route[];
|