reactive-route 0.0.1-alpha.22 → 0.0.1-alpha.23

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.
Files changed (45) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/index.js +8 -15
  3. package/dist/cjs/preact/index.js +7 -9
  4. package/dist/cjs/react/index.js +7 -9
  5. package/dist/cjs/solid/index.js +16 -9
  6. package/dist/core/createRouter.d.ts +7 -2
  7. package/dist/core/createRouter.d.ts.map +1 -1
  8. package/dist/core/createRoutes.d.ts +1 -1
  9. package/dist/core/createRoutes.d.ts.map +1 -1
  10. package/dist/core/index.d.ts +3 -5
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/core/types/TypeAdapters.d.ts +9 -0
  13. package/dist/core/types/TypeAdapters.d.ts.map +1 -0
  14. package/dist/core/types/TypeCurrentRoute.d.ts +1 -1
  15. package/dist/core/types/TypeCurrentRoute.d.ts.map +1 -1
  16. package/dist/core/types/TypePropsRouter.d.ts +2 -2
  17. package/dist/core/types/TypePropsRouter.d.ts.map +1 -1
  18. package/dist/core/types/{TypeRedirectToParams.d.ts → TypeRedirectParams.d.ts} +2 -2
  19. package/dist/core/types/TypeRedirectParams.d.ts.map +1 -0
  20. package/dist/core/types/TypeRoute.d.ts +0 -1
  21. package/dist/core/types/TypeRoute.d.ts.map +1 -1
  22. package/dist/core/types/TypeRouteRaw.d.ts +1 -0
  23. package/dist/core/types/TypeRouteRaw.d.ts.map +1 -1
  24. package/dist/core/types/TypeRouter.d.ts +17 -0
  25. package/dist/core/types/TypeRouter.d.ts.map +1 -0
  26. package/dist/core/utils/getInitialRoute.d.ts +2 -2
  27. package/dist/core/utils/getInitialRoute.d.ts.map +1 -1
  28. package/dist/core/utils/loadComponentToConfig.d.ts.map +1 -1
  29. package/dist/core/utils/replaceDynamicValues.d.ts +1 -2
  30. package/dist/core/utils/replaceDynamicValues.d.ts.map +1 -1
  31. package/dist/esm/index.js +8 -15
  32. package/dist/esm/preact/index.js +8 -10
  33. package/dist/esm/react/index.js +8 -10
  34. package/dist/esm/solid/index.js +17 -10
  35. package/dist/preact/Router.d.ts.map +1 -1
  36. package/dist/react/Router.d.ts.map +1 -1
  37. package/dist/solid/Router.d.ts.map +1 -1
  38. package/dist/tsconfig.types.react.tsbuildinfo +1 -1
  39. package/package.json +2 -1
  40. package/pnpm-workspace.yaml +5 -0
  41. package/dist/core/types/InterfaceRouterStore.d.ts +0 -28
  42. package/dist/core/types/InterfaceRouterStore.d.ts.map +0 -1
  43. package/dist/core/types/TypeRedirectToParams.d.ts.map +0 -1
  44. package/dist/core/types/TypeRouteWithParams.d.ts +0 -6
  45. package/dist/core/types/TypeRouteWithParams.d.ts.map +0 -1
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![npm](https://img.shields.io/npm/v/reactive-route)](https://www.npmjs.com/package/reactive-route)
5
5
  ![size-core](https://github.com/dkazakov8/reactive-route/blob/master/assets/core.svg)
6
6
  ![size-react](https://github.com/dkazakov8/reactive-route/blob/master/assets/react.svg)
7
+ ![size-preact](https://github.com/dkazakov8/reactive-route/blob/master/assets/preact.svg)
7
8
  ![size-solid](https://github.com/dkazakov8/reactive-route/blob/master/assets/solid.svg)
8
9
 
9
10
  > [!WARNING]
package/dist/cjs/index.js CHANGED
@@ -23,10 +23,7 @@ __export(core_exports, {
23
23
  RedirectError: () => RedirectError,
24
24
  createRouter: () => createRouter,
25
25
  createRoutes: () => createRoutes,
26
- findRouteByPathname: () => findRouteByPathname,
27
- getInitialRoute: () => getInitialRoute,
28
26
  history: () => history,
29
- isDynamicRoute: () => isDynamicRoute,
30
27
  loadComponentToConfig: () => loadComponentToConfig,
31
28
  replaceDynamicValues: () => replaceDynamicValues
32
29
  });
@@ -46,9 +43,6 @@ function isDynamic(param) {
46
43
  function clearDynamic(param) {
47
44
  return param.replace(new RegExp(`^${constants.dynamicSeparator}`), "");
48
45
  }
49
- function isDynamicRoute(route) {
50
- return "params" in route;
51
- }
52
46
 
53
47
  // packages/core/utils/getDynamicValues.ts
54
48
  function getDynamicValues(params) {
@@ -151,10 +145,9 @@ function loadComponentToConfig(params) {
151
145
  if (!route.component && route.loader) {
152
146
  const loadingFn = route.loader;
153
147
  return loadingFn().then((module2) => {
154
- const { default: component, pageName, ...rest } = module2;
148
+ const { default: component, ...rest } = module2;
155
149
  route.component = component;
156
150
  route.otherExports = rest;
157
- route.pageName = pageName;
158
151
  });
159
152
  }
160
153
  return Promise.resolve();
@@ -196,15 +189,15 @@ function replaceDynamicValues({
196
189
 
197
190
  // packages/core/createRouter.ts
198
191
  function createRouter({
199
- adapters,
200
192
  routes,
193
+ adapters,
201
194
  lifecycleParams
202
195
  }) {
203
196
  const router = adapters.makeObservable({
204
197
  routesHistory: [],
205
198
  currentRoute: {},
206
199
  isRedirecting: false,
207
- redirectTo: void 0,
200
+ redirect: void 0,
208
201
  restoreFromURL: void 0,
209
202
  restoreFromServer: void 0,
210
203
  get adapters() {
@@ -222,9 +215,9 @@ function createRouter({
222
215
  return loadComponentToConfig({ route: routes[preloadedRouteName] });
223
216
  };
224
217
  router.restoreFromURL = function restoreFromURL(params) {
225
- return router.redirectTo(getInitialRoute({ routes, pathname: params.pathname }));
218
+ return router.redirect(getInitialRoute({ routes, ...params }));
226
219
  };
227
- router.redirectTo = async function redirectTo(config) {
220
+ router.redirect = async function redirect(config) {
228
221
  const { route: routeName, noHistoryPush } = config;
229
222
  let currentRoute;
230
223
  let currentPathname;
@@ -320,7 +313,7 @@ function createRouter({
320
313
  };
321
314
  await currentRoute?.beforeLeave?.(config2, ...lifecycleParams || []);
322
315
  const redirectConfig = await nextRoute.beforeEnter?.(config2, ...lifecycleParams || []);
323
- if (redirectConfig) return redirectTo(redirectConfig);
316
+ if (redirectConfig) return redirect(redirectConfig);
324
317
  await loadComponentToConfig({ route: routes[nextRoute.name] });
325
318
  } catch (error) {
326
319
  if (error instanceof PreventError) {
@@ -338,7 +331,7 @@ function createRouter({
338
331
  props: routes[routes.internalError.name].props,
339
332
  query: adapters.makeObservable({}),
340
333
  params: adapters.makeObservable({}),
341
- pageName: routes[routes.internalError.name].pageName
334
+ pageId: routes[routes.internalError.name].pageId
342
335
  });
343
336
  router.isRedirecting = false;
344
337
  });
@@ -351,7 +344,7 @@ function createRouter({
351
344
  props: routes[nextRoute.name].props,
352
345
  query: getQueryValues({ route: nextRoute, pathname: nextUrl }),
353
346
  params: getDynamicValues({ route: nextRoute, pathname: nextUrl }),
354
- pageName: routes[nextRoute.name].pageName
347
+ pageId: routes[nextRoute.name].pageId
355
348
  });
356
349
  const lastUrl = router.routesHistory[router.routesHistory.length - 1];
357
350
  if (lastUrl !== nextUrl) {
@@ -38,12 +38,9 @@ function RouterInner(props) {
38
38
  if (previousRoutePathname === params.location.pathname) {
39
39
  props.router.adapters.batch(() => props.router.routesHistory.pop());
40
40
  }
41
- void props.router.redirectTo({
42
- noHistoryPush: true,
43
- ...(0, import_reactive_route.getInitialRoute)({
44
- routes: props.routes,
45
- pathname: import_reactive_route.history.location.pathname
46
- })
41
+ void props.router.restoreFromURL({
42
+ pathname: import_reactive_route.history.location.pathname,
43
+ noHistoryPush: true
47
44
  });
48
45
  });
49
46
  }, []);
@@ -62,7 +59,7 @@ function RouterInner(props) {
62
59
  if (isRedirecting) preventRedirect = true;
63
60
  else if (loadedComponentName === currentRoute.name) preventRedirect = true;
64
61
  else if (loadedComponentPage != null && currentRoute.name != null) {
65
- if (loadedComponentPage === currentRoute.pageName) {
62
+ if (loadedComponentPage === currentRoute.pageId) {
66
63
  props.router.adapters.batch(() => {
67
64
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
68
65
  });
@@ -75,7 +72,7 @@ function RouterInner(props) {
75
72
  props.beforeSetPageComponent?.(componentConfig);
76
73
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
77
74
  config.loadedComponentName = currentRoute.name;
78
- config.loadedComponentPage = componentConfig.pageName;
75
+ config.loadedComponentPage = componentConfig.pageId;
79
76
  });
80
77
  }, []);
81
78
  (0, import_hooks.useState)(() => {
@@ -93,7 +90,8 @@ function RouterInner(props) {
93
90
  }, []);
94
91
  if (!config.loadedComponentName) return null;
95
92
  const LoadedComponent = props.routes[config.loadedComponentName]?.component || null;
96
- if (LoadedComponent) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadedComponent, { ...config.currentProps });
93
+ if (LoadedComponent)
94
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadedComponent, { ...config.currentProps, router: props.router });
97
95
  return null;
98
96
  }
99
97
  function Router(props) {
@@ -38,12 +38,9 @@ function RouterInner(props) {
38
38
  if (previousRoutePathname === params.location.pathname) {
39
39
  props.router.adapters.batch(() => props.router.routesHistory.pop());
40
40
  }
41
- void props.router.redirectTo({
42
- noHistoryPush: true,
43
- ...(0, import_reactive_route.getInitialRoute)({
44
- routes: props.routes,
45
- pathname: import_reactive_route.history.location.pathname
46
- })
41
+ void props.router.restoreFromURL({
42
+ pathname: import_reactive_route.history.location.pathname,
43
+ noHistoryPush: true
47
44
  });
48
45
  });
49
46
  }, []);
@@ -62,7 +59,7 @@ function RouterInner(props) {
62
59
  if (isRedirecting) preventRedirect = true;
63
60
  else if (loadedComponentName === currentRoute.name) preventRedirect = true;
64
61
  else if (loadedComponentPage != null && currentRoute.name != null) {
65
- if (loadedComponentPage === currentRoute.pageName) {
62
+ if (loadedComponentPage === currentRoute.pageId) {
66
63
  props.router.adapters.batch(() => {
67
64
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
68
65
  });
@@ -75,7 +72,7 @@ function RouterInner(props) {
75
72
  props.beforeSetPageComponent?.(componentConfig);
76
73
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
77
74
  config.loadedComponentName = currentRoute.name;
78
- config.loadedComponentPage = componentConfig.pageName;
75
+ config.loadedComponentPage = componentConfig.pageId;
79
76
  });
80
77
  }, []);
81
78
  (0, import_react.useState)(() => {
@@ -93,7 +90,8 @@ function RouterInner(props) {
93
90
  }, []);
94
91
  if (!config.loadedComponentName) return null;
95
92
  const LoadedComponent = props.routes[config.loadedComponentName]?.component || null;
96
- if (LoadedComponent) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadedComponent, { ...config.currentProps });
93
+ if (LoadedComponent)
94
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadedComponent, { ...config.currentProps, router: props.router });
97
95
  return null;
98
96
  }
99
97
  function RouterWrapper(props) {
@@ -36,6 +36,7 @@ function Router(props) {
36
36
  loadedComponentPage: void 0,
37
37
  currentProps: {}
38
38
  });
39
+ let currentProps = {};
39
40
  function redirectOnHistoryPop() {
40
41
  if (!import_reactive_route.history) return;
41
42
  import_reactive_route.history.listen((params) => {
@@ -44,18 +45,15 @@ function Router(props) {
44
45
  if (previousRoutePathname === params.location.pathname) {
45
46
  props.router.routesHistory.pop();
46
47
  }
47
- void props.router.redirectTo({
48
- noHistoryPush: true,
49
- ...(0, import_reactive_route.getInitialRoute)({
50
- routes: props.routes,
51
- pathname: import_reactive_route.history.location.pathname
52
- })
48
+ void props.router.restoreFromURL({
49
+ pathname: import_reactive_route.history.location.pathname,
50
+ noHistoryPush: true
53
51
  });
54
52
  });
55
53
  }
56
54
  function setLoadedComponent() {
57
55
  const currentRouteName = props.router.currentRoute.name;
58
- const currentRoutePage = props.router.currentRoute.pageName;
56
+ const currentRoutePage = props.router.currentRoute.pageId;
59
57
  const componentConfig = props.routes[currentRouteName];
60
58
  let preventRedirect = false;
61
59
  if (props.router.isRedirecting) preventRedirect = true;
@@ -64,6 +62,7 @@ function Router(props) {
64
62
  } else if (config.loadedComponentPage != null && currentRouteName != null) {
65
63
  if (config.loadedComponentPage === currentRoutePage) {
66
64
  props.router.adapters.replaceObject(config.currentProps, "props" in componentConfig ? componentConfig.props : {});
65
+ currentProps = "props" in componentConfig ? componentConfig.props : {};
67
66
  preventRedirect = true;
68
67
  }
69
68
  }
@@ -75,8 +74,9 @@ function Router(props) {
75
74
  props.beforeSetPageComponent?.(componentConfig);
76
75
  props.router.adapters.batch(() => {
77
76
  props.router.adapters.replaceObject(config.currentProps, "props" in componentConfig ? componentConfig.props : {});
77
+ currentProps = "props" in componentConfig ? componentConfig.props : {};
78
78
  config.loadedComponentName = currentRouteName;
79
- config.loadedComponentPage = componentConfig.pageName;
79
+ config.loadedComponentPage = componentConfig.pageId;
80
80
  });
81
81
  });
82
82
  }
@@ -99,7 +99,14 @@ function Router(props) {
99
99
  get component() {
100
100
  return props.routes[config.loadedComponentName]?.component || void 0;
101
101
  }
102
- }, () => config.currentProps));
102
+ }, () => Object.keys(config.currentProps).reduce((acc, key) => {
103
+ acc[key] = currentProps[key];
104
+ return acc;
105
+ }, {}), {
106
+ get router() {
107
+ return props.router;
108
+ }
109
+ }));
103
110
  }
104
111
  })
105
112
  );
@@ -1,4 +1,9 @@
1
- import { InterfaceRouterStore, TypeCreateRouterStore } from './types/InterfaceRouterStore';
1
+ import { TypeAdapters } from './types/TypeAdapters';
2
2
  import { TypeRoute } from './types/TypeRoute';
3
- export declare function createRouter<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>>({ adapters, routes, lifecycleParams, }: TypeCreateRouterStore<TRoutes>): InterfaceRouterStore<TRoutes>;
3
+ import { TypeRouter } from './types/TypeRouter';
4
+ export declare function createRouter<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>>({ routes, adapters, lifecycleParams, }: {
5
+ routes: TRoutes;
6
+ adapters: TypeAdapters;
7
+ lifecycleParams?: Array<any>;
8
+ }): TypeRouter<TRoutes>;
4
9
  //# sourceMappingURL=createRouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRouter.d.ts","sourceRoot":"","sources":["../../packages/core/createRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAG3F,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAY9C,wBAAgB,YAAY,CAC1B,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,EACxE,EACA,QAAQ,EACR,MAAM,EACN,eAAe,GAChB,EAAE,qBAAqB,CAAC,OAAO,CAAC,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAiPhE"}
1
+ {"version":3,"file":"createRouter.d.ts","sourceRoot":"","sources":["../../packages/core/createRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAYhD,wBAAgB,YAAY,CAC1B,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,EACxE,EACA,MAAM,EACN,QAAQ,EACR,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CAC9B,GAAG,UAAU,CAAC,OAAO,CAAC,CAiPtB"}
@@ -4,7 +4,7 @@ export declare function createRoutes<TConfig extends {
4
4
  }>(config: TConfig): {
5
5
  [Key in keyof TConfig]: TConfig[Key] & {
6
6
  name: Key;
7
- pageName?: string;
7
+ pageId?: string;
8
8
  component?: any;
9
9
  otherExports?: Record<string, any>;
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createRoutes.d.ts","sourceRoot":"","sources":["../../packages/core/createRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,wBAAgB,YAAY,CAC1B,OAAO,SAAS;KAAG,GAAG,IAAI,MAAM,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY;CAAE,EAEvF,MAAM,EAAE,OAAO,GACd;KACA,GAAG,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG;QACrC,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;CACF,CAEA"}
1
+ {"version":3,"file":"createRoutes.d.ts","sourceRoot":"","sources":["../../packages/core/createRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,wBAAgB,YAAY,CAC1B,OAAO,SAAS;KAAG,GAAG,IAAI,MAAM,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY;CAAE,EAEvF,MAAM,EAAE,OAAO,GACd;KACA,GAAG,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG;QACrC,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;CACF,CAEA"}
@@ -1,13 +1,11 @@
1
1
  export { createRouter } from './createRouter';
2
2
  export { createRoutes } from './createRoutes';
3
- export type { InterfaceRouterStore, TypeAdapters } from './types/InterfaceRouterStore';
3
+ export type { TypeAdapters } from './types/TypeAdapters';
4
4
  export type { TypeCurrentRoute } from './types/TypeCurrentRoute';
5
5
  export type { TypePropsRouter } from './types/TypePropsRouter';
6
- export type { TypeRedirectToParams } from './types/TypeRedirectToParams';
6
+ export type { TypeRedirectParams } from './types/TypeRedirectParams';
7
7
  export type { TypeRoute } from './types/TypeRoute';
8
- export { isDynamicRoute } from './utils/dynamic';
9
- export { findRouteByPathname } from './utils/findRouteByPathname';
10
- export { getInitialRoute } from './utils/getInitialRoute';
8
+ export type { TypeRouter } from './types/TypeRouter';
11
9
  export { history } from './utils/history';
12
10
  export { loadComponentToConfig } from './utils/loadComponentToConfig';
13
11
  export { RedirectError } from './utils/RedirectError';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACvF,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type TypeAdapters = {
2
+ batch: (cb: () => void) => void;
3
+ autorun: (cb: () => void) => any;
4
+ replaceObject: <TObj extends Record<string, any>>(obj: TObj, newObj: TObj) => void;
5
+ makeObservable: <TObj extends Record<string, any>>(obj: TObj) => TObj;
6
+ observer?: (comp: any) => any;
7
+ immediateSetComponent?: boolean;
8
+ };
9
+ //# sourceMappingURL=TypeAdapters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeAdapters.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeAdapters.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,GAAG,CAAC;IACjC,aAAa,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;IACnF,cAAc,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -5,6 +5,6 @@ export type TypeCurrentRoute<TRoute extends TypeRoute> = {
5
5
  props: TRoute['props'];
6
6
  query: Partial<Record<keyof TRoute['query'], string>>;
7
7
  params: Record<keyof TRoute['params'], string>;
8
- pageName: TRoute['pageName'];
8
+ pageId: TRoute['pageId'];
9
9
  };
10
10
  //# sourceMappingURL=TypeCurrentRoute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeCurrentRoute.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeCurrentRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,SAAS,IAAI;IACvD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"TypeCurrentRoute.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeCurrentRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,SAAS,IAAI;IACvD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;CAC1B,CAAC"}
@@ -1,8 +1,8 @@
1
- import { InterfaceRouterStore } from './InterfaceRouterStore';
2
1
  import { TypeRoute } from './TypeRoute';
2
+ import { TypeRouter } from './TypeRouter';
3
3
  export type TypePropsRouter<TRoutes extends Record<string, TypeRoute>> = {
4
4
  routes: TRoutes;
5
- router: InterfaceRouterStore<TRoutes>;
5
+ router: TypeRouter<TRoutes>;
6
6
  beforeMount?: () => void;
7
7
  beforeSetPageComponent?: (componentConfig: TRoutes[keyof TRoutes]) => void;
8
8
  beforeUpdatePageComponent?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"TypePropsRouter.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypePropsRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IACvE,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;CACxC,CAAC"}
1
+ {"version":3,"file":"TypePropsRouter.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypePropsRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IACvE,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;CACxC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { TypeRoute } from './TypeRoute';
2
2
  import { TypeValidator } from './TypeValidator';
3
- export type TypeRedirectToParams<TRoutes extends Record<string, TypeRoute>, TRouteName extends keyof TRoutes> = TRoutes[TRouteName]['params'] extends Record<string, TypeValidator> ? TRoutes[TRouteName]['query'] extends Record<string, TypeValidator> ? {
3
+ export type TypeRedirectParams<TRoutes extends Record<string, TypeRoute>, TRouteName extends keyof TRoutes> = TRoutes[TRouteName]['params'] extends Record<string, TypeValidator> ? TRoutes[TRouteName]['query'] extends Record<string, TypeValidator> ? {
4
4
  route: TRouteName;
5
5
  params: Record<keyof TRoutes[TRouteName]['params'], string>;
6
6
  query?: Partial<Record<keyof TRoutes[TRouteName]['query'], string>>;
@@ -17,4 +17,4 @@ export type TypeRedirectToParams<TRoutes extends Record<string, TypeRoute>, TRou
17
17
  route: TRouteName;
18
18
  noHistoryPush?: boolean;
19
19
  };
20
- //# sourceMappingURL=TypeRedirectToParams.d.ts.map
20
+ //# sourceMappingURL=TypeRedirectParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeRedirectParams.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeRedirectParams.ts"],"names":[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AC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { TypeRouteRaw } from './TypeRouteRaw';
2
2
  export type TypeRoute = TypeRouteRaw & {
3
3
  name: string;
4
- pageName?: string;
5
4
  component?: any;
6
5
  otherExports?: Record<string, any>;
7
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TypeRoute.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC,CAAC"}
1
+ {"version":3,"file":"TypeRoute.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC,CAAC"}
@@ -5,6 +5,7 @@ export type TypeRouteRaw = {
5
5
  loader: () => Promise<{
6
6
  default: any;
7
7
  }>;
8
+ pageId?: string;
8
9
  props?: Record<string, any>;
9
10
  query?: Record<string, TypeValidator>;
10
11
  params?: Record<string, TypeValidator>;
@@ -1 +1 @@
1
- {"version":3,"file":"TypeRouteRaw.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeRouteRaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,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EAAE,aAAa,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACjF,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACzF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { TypeAdapters } from './TypeAdapters';
2
+ import { TypeCurrentRoute } from './TypeCurrentRoute';
3
+ import { TypeRedirectParams } from './TypeRedirectParams';
4
+ import { TypeRoute } from './TypeRoute';
5
+ export type TypeRouter<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>> = {
6
+ adapters: TypeAdapters;
7
+ currentRoute: TypeCurrentRoute<TRoutes[keyof TRoutes]>;
8
+ routesHistory: Array<string>;
9
+ isRedirecting: boolean;
10
+ redirect<TRouteName extends keyof TRoutes>(config: TypeRedirectParams<TRoutes, TRouteName>): Promise<void>;
11
+ restoreFromURL(params: {
12
+ pathname: string;
13
+ noHistoryPush?: boolean;
14
+ }): Promise<void>;
15
+ restoreFromServer(obj: TypeRouter<TRoutes>): Promise<void>;
16
+ };
17
+ //# sourceMappingURL=TypeRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeRouter.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,IAAI;IACjG,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC;IACvD,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,UAAU,SAAS,MAAM,OAAO,EACvC,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrF,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D,CAAC"}
@@ -1,7 +1,7 @@
1
- import { TypeRedirectToParams } from '../types/TypeRedirectToParams';
1
+ import { TypeRedirectParams } from '../types/TypeRedirectParams';
2
2
  import { TypeRoute } from '../types/TypeRoute';
3
3
  export declare function getInitialRoute<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>>(params: {
4
4
  routes: TRoutes;
5
5
  pathname: string;
6
- }): TypeRedirectToParams<TRoutes, keyof TRoutes>;
6
+ }): TypeRedirectParams<TRoutes, keyof TRoutes>;
7
7
  //# sourceMappingURL=getInitialRoute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getInitialRoute.d.ts","sourceRoot":"","sources":["../../../packages/core/utils/getInitialRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,wBAAgB,eAAe,CAC7B,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,EACxE,MAAM,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,CAU7F"}
1
+ {"version":3,"file":"getInitialRoute.d.ts","sourceRoot":"","sources":["../../../packages/core/utils/getInitialRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,wBAAgB,eAAe,CAC7B,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,EACxE,MAAM,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,CAU3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"loadComponentToConfig.d.ts","sourceRoot":"","sources":["../../../packages/core/utils/loadComponentToConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBjF"}
1
+ {"version":3,"file":"loadComponentToConfig.d.ts","sourceRoot":"","sources":["../../../packages/core/utils/loadComponentToConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAejF"}
@@ -1,7 +1,6 @@
1
1
  import { TypeCurrentRoute } from '../types/TypeCurrentRoute';
2
2
  import { TypeRoute } from '../types/TypeRoute';
3
- import { TypeRouteWithParams } from '../types/TypeRouteWithParams';
4
- export declare function replaceDynamicValues<TRouteItem extends TypeRoute | TypeRouteWithParams | TypeCurrentRoute<TypeRoute>>({ route, params, }: {
3
+ export declare function replaceDynamicValues<TRouteItem extends TypeRoute | TypeCurrentRoute<TypeRoute>>({ route, params, }: {
5
4
  route: TRouteItem;
6
5
  params?: Record<keyof TRouteItem['params'], string>;
7
6
  }): string;
@@ -1 +1 @@
1
- {"version":3,"file":"replaceDynamicValues.d.ts","sourceRoot":"","sources":["../../../packages/core/utils/replaceDynamicValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMnE,wBAAgB,oBAAoB,CAClC,UAAU,SAAS,SAAS,GAAG,mBAAmB,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAChF,EACA,KAAK,EACL,MAAkB,GACnB,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;CACrD,GAAG,MAAM,CAcT"}
1
+ {"version":3,"file":"replaceDynamicValues.d.ts","sourceRoot":"","sources":["../../../packages/core/utils/replaceDynamicValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C,wBAAgB,oBAAoB,CAAC,UAAU,SAAS,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAAE,EAC/F,KAAK,EACL,MAAkB,GACnB,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;CACrD,GAAG,MAAM,CAcT"}
package/dist/esm/index.js CHANGED
@@ -12,9 +12,6 @@ function isDynamic(param) {
12
12
  function clearDynamic(param) {
13
13
  return param.replace(new RegExp(`^${constants.dynamicSeparator}`), "");
14
14
  }
15
- function isDynamicRoute(route) {
16
- return "params" in route;
17
- }
18
15
 
19
16
  // packages/core/utils/getDynamicValues.ts
20
17
  function getDynamicValues(params) {
@@ -117,10 +114,9 @@ function loadComponentToConfig(params) {
117
114
  if (!route.component && route.loader) {
118
115
  const loadingFn = route.loader;
119
116
  return loadingFn().then((module) => {
120
- const { default: component, pageName, ...rest } = module;
117
+ const { default: component, ...rest } = module;
121
118
  route.component = component;
122
119
  route.otherExports = rest;
123
- route.pageName = pageName;
124
120
  });
125
121
  }
126
122
  return Promise.resolve();
@@ -162,15 +158,15 @@ function replaceDynamicValues({
162
158
 
163
159
  // packages/core/createRouter.ts
164
160
  function createRouter({
165
- adapters,
166
161
  routes,
162
+ adapters,
167
163
  lifecycleParams
168
164
  }) {
169
165
  const router = adapters.makeObservable({
170
166
  routesHistory: [],
171
167
  currentRoute: {},
172
168
  isRedirecting: false,
173
- redirectTo: void 0,
169
+ redirect: void 0,
174
170
  restoreFromURL: void 0,
175
171
  restoreFromServer: void 0,
176
172
  get adapters() {
@@ -188,9 +184,9 @@ function createRouter({
188
184
  return loadComponentToConfig({ route: routes[preloadedRouteName] });
189
185
  };
190
186
  router.restoreFromURL = function restoreFromURL(params) {
191
- return router.redirectTo(getInitialRoute({ routes, pathname: params.pathname }));
187
+ return router.redirect(getInitialRoute({ routes, ...params }));
192
188
  };
193
- router.redirectTo = async function redirectTo(config) {
189
+ router.redirect = async function redirect(config) {
194
190
  const { route: routeName, noHistoryPush } = config;
195
191
  let currentRoute;
196
192
  let currentPathname;
@@ -286,7 +282,7 @@ function createRouter({
286
282
  };
287
283
  await currentRoute?.beforeLeave?.(config2, ...lifecycleParams || []);
288
284
  const redirectConfig = await nextRoute.beforeEnter?.(config2, ...lifecycleParams || []);
289
- if (redirectConfig) return redirectTo(redirectConfig);
285
+ if (redirectConfig) return redirect(redirectConfig);
290
286
  await loadComponentToConfig({ route: routes[nextRoute.name] });
291
287
  } catch (error) {
292
288
  if (error instanceof PreventError) {
@@ -304,7 +300,7 @@ function createRouter({
304
300
  props: routes[routes.internalError.name].props,
305
301
  query: adapters.makeObservable({}),
306
302
  params: adapters.makeObservable({}),
307
- pageName: routes[routes.internalError.name].pageName
303
+ pageId: routes[routes.internalError.name].pageId
308
304
  });
309
305
  router.isRedirecting = false;
310
306
  });
@@ -317,7 +313,7 @@ function createRouter({
317
313
  props: routes[nextRoute.name].props,
318
314
  query: getQueryValues({ route: nextRoute, pathname: nextUrl }),
319
315
  params: getDynamicValues({ route: nextRoute, pathname: nextUrl }),
320
- pageName: routes[nextRoute.name].pageName
316
+ pageId: routes[nextRoute.name].pageId
321
317
  });
322
318
  const lastUrl = router.routesHistory[router.routesHistory.length - 1];
323
319
  if (lastUrl !== nextUrl) {
@@ -353,10 +349,7 @@ export {
353
349
  RedirectError,
354
350
  createRouter,
355
351
  createRoutes,
356
- findRouteByPathname,
357
- getInitialRoute,
358
352
  history,
359
- isDynamicRoute,
360
353
  loadComponentToConfig,
361
354
  replaceDynamicValues
362
355
  };
@@ -1,6 +1,6 @@
1
1
  // packages/preact/Router.tsx
2
2
  import { useCallback, useEffect, useRef, useState } from "preact/hooks";
3
- import { getInitialRoute, history } from "reactive-route";
3
+ import { history } from "reactive-route";
4
4
  import { jsx } from "preact/jsx-runtime";
5
5
  function RouterInner(props) {
6
6
  const disposerRef = useRef(null);
@@ -12,12 +12,9 @@ function RouterInner(props) {
12
12
  if (previousRoutePathname === params.location.pathname) {
13
13
  props.router.adapters.batch(() => props.router.routesHistory.pop());
14
14
  }
15
- void props.router.redirectTo({
16
- noHistoryPush: true,
17
- ...getInitialRoute({
18
- routes: props.routes,
19
- pathname: history.location.pathname
20
- })
15
+ void props.router.restoreFromURL({
16
+ pathname: history.location.pathname,
17
+ noHistoryPush: true
21
18
  });
22
19
  });
23
20
  }, []);
@@ -36,7 +33,7 @@ function RouterInner(props) {
36
33
  if (isRedirecting) preventRedirect = true;
37
34
  else if (loadedComponentName === currentRoute.name) preventRedirect = true;
38
35
  else if (loadedComponentPage != null && currentRoute.name != null) {
39
- if (loadedComponentPage === currentRoute.pageName) {
36
+ if (loadedComponentPage === currentRoute.pageId) {
40
37
  props.router.adapters.batch(() => {
41
38
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
42
39
  });
@@ -49,7 +46,7 @@ function RouterInner(props) {
49
46
  props.beforeSetPageComponent?.(componentConfig);
50
47
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
51
48
  config.loadedComponentName = currentRoute.name;
52
- config.loadedComponentPage = componentConfig.pageName;
49
+ config.loadedComponentPage = componentConfig.pageId;
53
50
  });
54
51
  }, []);
55
52
  useState(() => {
@@ -67,7 +64,8 @@ function RouterInner(props) {
67
64
  }, []);
68
65
  if (!config.loadedComponentName) return null;
69
66
  const LoadedComponent = props.routes[config.loadedComponentName]?.component || null;
70
- if (LoadedComponent) return /* @__PURE__ */ jsx(LoadedComponent, { ...config.currentProps });
67
+ if (LoadedComponent)
68
+ return /* @__PURE__ */ jsx(LoadedComponent, { ...config.currentProps, router: props.router });
71
69
  return null;
72
70
  }
73
71
  function Router(props) {
@@ -1,6 +1,6 @@
1
1
  // packages/react/Router.tsx
2
2
  import { memo, useCallback, useEffect, useRef, useState } from "react";
3
- import { getInitialRoute, history } from "reactive-route";
3
+ import { history } from "reactive-route";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  function RouterInner(props) {
6
6
  const disposerRef = useRef(null);
@@ -12,12 +12,9 @@ function RouterInner(props) {
12
12
  if (previousRoutePathname === params.location.pathname) {
13
13
  props.router.adapters.batch(() => props.router.routesHistory.pop());
14
14
  }
15
- void props.router.redirectTo({
16
- noHistoryPush: true,
17
- ...getInitialRoute({
18
- routes: props.routes,
19
- pathname: history.location.pathname
20
- })
15
+ void props.router.restoreFromURL({
16
+ pathname: history.location.pathname,
17
+ noHistoryPush: true
21
18
  });
22
19
  });
23
20
  }, []);
@@ -36,7 +33,7 @@ function RouterInner(props) {
36
33
  if (isRedirecting) preventRedirect = true;
37
34
  else if (loadedComponentName === currentRoute.name) preventRedirect = true;
38
35
  else if (loadedComponentPage != null && currentRoute.name != null) {
39
- if (loadedComponentPage === currentRoute.pageName) {
36
+ if (loadedComponentPage === currentRoute.pageId) {
40
37
  props.router.adapters.batch(() => {
41
38
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
42
39
  });
@@ -49,7 +46,7 @@ function RouterInner(props) {
49
46
  props.beforeSetPageComponent?.(componentConfig);
50
47
  config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
51
48
  config.loadedComponentName = currentRoute.name;
52
- config.loadedComponentPage = componentConfig.pageName;
49
+ config.loadedComponentPage = componentConfig.pageId;
53
50
  });
54
51
  }, []);
55
52
  useState(() => {
@@ -67,7 +64,8 @@ function RouterInner(props) {
67
64
  }, []);
68
65
  if (!config.loadedComponentName) return null;
69
66
  const LoadedComponent = props.routes[config.loadedComponentName]?.component || null;
70
- if (LoadedComponent) return /* @__PURE__ */ jsx(LoadedComponent, { ...config.currentProps });
67
+ if (LoadedComponent)
68
+ return /* @__PURE__ */ jsx(LoadedComponent, { ...config.currentProps, router: props.router });
71
69
  return null;
72
70
  }
73
71
  function RouterWrapper(props) {
@@ -1,7 +1,7 @@
1
1
  // packages/solid/Router.tsx
2
2
  import { createComponent as _$createComponent } from "solid-js/web";
3
3
  import { mergeProps as _$mergeProps } from "solid-js/web";
4
- import { getInitialRoute, history } from "reactive-route";
4
+ import { history } from "reactive-route";
5
5
  import { Show } from "solid-js";
6
6
  import { Dynamic } from "solid-js/web";
7
7
  function Router(props) {
@@ -10,6 +10,7 @@ function Router(props) {
10
10
  loadedComponentPage: void 0,
11
11
  currentProps: {}
12
12
  });
13
+ let currentProps = {};
13
14
  function redirectOnHistoryPop() {
14
15
  if (!history) return;
15
16
  history.listen((params) => {
@@ -18,18 +19,15 @@ function Router(props) {
18
19
  if (previousRoutePathname === params.location.pathname) {
19
20
  props.router.routesHistory.pop();
20
21
  }
21
- void props.router.redirectTo({
22
- noHistoryPush: true,
23
- ...getInitialRoute({
24
- routes: props.routes,
25
- pathname: history.location.pathname
26
- })
22
+ void props.router.restoreFromURL({
23
+ pathname: history.location.pathname,
24
+ noHistoryPush: true
27
25
  });
28
26
  });
29
27
  }
30
28
  function setLoadedComponent() {
31
29
  const currentRouteName = props.router.currentRoute.name;
32
- const currentRoutePage = props.router.currentRoute.pageName;
30
+ const currentRoutePage = props.router.currentRoute.pageId;
33
31
  const componentConfig = props.routes[currentRouteName];
34
32
  let preventRedirect = false;
35
33
  if (props.router.isRedirecting) preventRedirect = true;
@@ -38,6 +36,7 @@ function Router(props) {
38
36
  } else if (config.loadedComponentPage != null && currentRouteName != null) {
39
37
  if (config.loadedComponentPage === currentRoutePage) {
40
38
  props.router.adapters.replaceObject(config.currentProps, "props" in componentConfig ? componentConfig.props : {});
39
+ currentProps = "props" in componentConfig ? componentConfig.props : {};
41
40
  preventRedirect = true;
42
41
  }
43
42
  }
@@ -49,8 +48,9 @@ function Router(props) {
49
48
  props.beforeSetPageComponent?.(componentConfig);
50
49
  props.router.adapters.batch(() => {
51
50
  props.router.adapters.replaceObject(config.currentProps, "props" in componentConfig ? componentConfig.props : {});
51
+ currentProps = "props" in componentConfig ? componentConfig.props : {};
52
52
  config.loadedComponentName = currentRouteName;
53
- config.loadedComponentPage = componentConfig.pageName;
53
+ config.loadedComponentPage = componentConfig.pageId;
54
54
  });
55
55
  });
56
56
  }
@@ -73,7 +73,14 @@ function Router(props) {
73
73
  get component() {
74
74
  return props.routes[config.loadedComponentName]?.component || void 0;
75
75
  }
76
- }, () => config.currentProps));
76
+ }, () => Object.keys(config.currentProps).reduce((acc, key) => {
77
+ acc[key] = currentProps[key];
78
+ return acc;
79
+ }, {}), {
80
+ get router() {
81
+ return props.router;
82
+ }
83
+ }));
77
84
  }
78
85
  })
79
86
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/preact/Router.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkGtF,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,GAK1D,GAAG,CACzC"}
1
+ {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/preact/Router.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAgGrE,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,GAK1D,GAAG,CACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/react/Router.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAuGtF,iBAAS,aAAa,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,GAK1D,GAAG,CACzC;AAED,eAAO,MAAM,MAAM,EAA0B,OAAO,aAAa,CAAC"}
1
+ {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/react/Router.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAgGrE,iBAAS,aAAa,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,GAK1D,GAAG,CACzC;AAED,eAAO,MAAM,MAAM,EAA0B,OAAO,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/solid/Router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAItF,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,kCAgGhG"}
1
+ {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/solid/Router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIrE,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,kCAsGhG"}
@@ -1 +1 @@
1
- {"root":["../packages/adapters/kr-observable-preact.ts","../packages/adapters/kr-observable-react.ts","../packages/adapters/kr-observable-solid.ts","../packages/adapters/mobx-preact.ts","../packages/adapters/mobx-react.ts","../packages/adapters/mobx-solid.ts","../packages/adapters/solid.ts","../packages/core/createRouter.ts","../packages/core/createRoutes.ts","../packages/core/index.ts","../packages/core/types/InterfaceRouterStore.ts","../packages/core/types/TypeCurrentRoute.ts","../packages/core/types/TypeLifecycleConfig.ts","../packages/core/types/TypePropsRouter.ts","../packages/core/types/TypeRedirectToParams.ts","../packages/core/types/TypeRoute.ts","../packages/core/types/TypeRouteRaw.ts","../packages/core/types/TypeRouteWithParams.ts","../packages/core/types/TypeValidator.ts","../packages/core/utils/PreventError.ts","../packages/core/utils/RedirectError.ts","../packages/core/utils/addNames.ts","../packages/core/utils/constants.ts","../packages/core/utils/dynamic.ts","../packages/core/utils/findRouteByPathname.ts","../packages/core/utils/getDynamicValues.ts","../packages/core/utils/getInitialRoute.ts","../packages/core/utils/getQueryValues.ts","../packages/core/utils/getTypedEntries.ts","../packages/core/utils/history.ts","../packages/core/utils/loadComponentToConfig.ts","../packages/core/utils/queryString.ts","../packages/core/utils/replaceDynamicValues.ts","../packages/preact/Router.tsx","../packages/preact/index.ts","../packages/react/Router.tsx","../packages/react/index.ts"],"version":"5.9.2"}
1
+ {"root":["../packages/adapters/kr-observable-preact.ts","../packages/adapters/kr-observable-react.ts","../packages/adapters/kr-observable-solid.ts","../packages/adapters/mobx-preact.ts","../packages/adapters/mobx-react.ts","../packages/adapters/mobx-solid.ts","../packages/adapters/solid.ts","../packages/core/createRouter.ts","../packages/core/createRoutes.ts","../packages/core/index.ts","../packages/core/types/TypeAdapters.ts","../packages/core/types/TypeCurrentRoute.ts","../packages/core/types/TypeLifecycleConfig.ts","../packages/core/types/TypePropsRouter.ts","../packages/core/types/TypeRedirectParams.ts","../packages/core/types/TypeRoute.ts","../packages/core/types/TypeRouteRaw.ts","../packages/core/types/TypeRouter.ts","../packages/core/types/TypeValidator.ts","../packages/core/utils/PreventError.ts","../packages/core/utils/RedirectError.ts","../packages/core/utils/addNames.ts","../packages/core/utils/constants.ts","../packages/core/utils/dynamic.ts","../packages/core/utils/findRouteByPathname.ts","../packages/core/utils/getDynamicValues.ts","../packages/core/utils/getInitialRoute.ts","../packages/core/utils/getQueryValues.ts","../packages/core/utils/getTypedEntries.ts","../packages/core/utils/history.ts","../packages/core/utils/loadComponentToConfig.ts","../packages/core/utils/queryString.ts","../packages/core/utils/replaceDynamicValues.ts","../packages/preact/Router.tsx","../packages/preact/index.ts","../packages/react/Router.tsx","../packages/react/index.ts"],"version":"5.9.2"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "reactive-route",
3
3
  "author": "Dmitry Kazakov",
4
4
  "license": "MIT",
5
- "version": "0.0.1-alpha.22",
5
+ "version": "0.0.1-alpha.23",
6
6
  "description": "Reactive Router for different frameworks",
7
7
  "repository": {
8
8
  "type": "git",
@@ -40,6 +40,7 @@
40
40
  "vite-plugin-babel": "1.3.2",
41
41
  "@biomejs/biome": "2.2.2",
42
42
  "@espcom/esbuild-plugin-replace": "1.3.1",
43
+ "@espcom/esbuild-plugin-compress": "1.2.0",
43
44
  "@solidjs/testing-library": "0.8.10",
44
45
  "@testing-library/react": "16.3.0",
45
46
  "@testing-library/preact": "3.2.4",
@@ -0,0 +1,5 @@
1
+ ignoredBuiltDependencies:
2
+ - esbuild
3
+
4
+ onlyBuiltDependencies:
5
+ - '@mongodb-js/zstd'
@@ -1,28 +0,0 @@
1
- import { TypeCurrentRoute } from './TypeCurrentRoute';
2
- import { TypeRedirectToParams } from './TypeRedirectToParams';
3
- import { TypeRoute } from './TypeRoute';
4
- export type TypeAdapters = {
5
- batch: (cb: () => void) => void;
6
- autorun: (cb: () => void) => any;
7
- replaceObject: <TObj extends Record<string, any>>(obj: TObj, newObj: TObj) => void;
8
- makeObservable: <TObj extends Record<string, any>>(obj: TObj) => TObj;
9
- observer?: (comp: any) => any;
10
- immediateSetComponent?: boolean;
11
- };
12
- export type TypeCreateRouterStore<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>> = {
13
- routes: TRoutes;
14
- lifecycleParams?: Array<any>;
15
- adapters: TypeAdapters;
16
- };
17
- export type InterfaceRouterStore<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>> = {
18
- adapters: TypeAdapters;
19
- currentRoute: TypeCurrentRoute<TRoutes[keyof TRoutes]>;
20
- routesHistory: Array<string>;
21
- isRedirecting: boolean;
22
- redirectTo<TRouteName extends keyof TRoutes>(config: TypeRedirectToParams<TRoutes, TRouteName>): Promise<void>;
23
- restoreFromURL(params: {
24
- pathname: string;
25
- }): Promise<void>;
26
- restoreFromServer(obj: InterfaceRouterStore<TRoutes>): Promise<void>;
27
- };
28
- //# sourceMappingURL=InterfaceRouterStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InterfaceRouterStore.d.ts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AAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACH,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAChE;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACD;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -1,6 +0,0 @@
1
- import { TypeRoute } from './TypeRoute';
2
- export type TypeRouteWithParams = Omit<TypeRoute, 'params'> & {
3
- params: Record<string, string>;
4
- query: Record<string, string>;
5
- };
6
- //# sourceMappingURL=TypeRouteWithParams.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeRouteWithParams.d.ts","sourceRoot":"","sources":["../../../packages/core/types/TypeRouteWithParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG;IAC5D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC"}