@tramvai/module-router 2.92.1 → 2.94.0

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.
@@ -27,7 +27,11 @@ const providers = [
27
27
  });
28
28
  if (routeResolve) {
29
29
  router.registerHook('beforeResolve', async (navigation) => {
30
- if (!router.resolve(navigation.url.href)) {
30
+ var _a;
31
+ const existingRoute = router.resolve(navigation.url.href);
32
+ // forceRouteResolve exists as a fallback property in case we have any conflicts
33
+ // in external routes definition and we need to force route resolving is some cases
34
+ if (!existingRoute || ((_a = existingRoute.config) === null || _a === void 0 ? void 0 : _a.forceRouteResolve)) {
31
35
  const route = await routeResolve(navigation);
32
36
  if (route) {
33
37
  router.addRoute(routeTransform(route));
@@ -1,2 +1,7 @@
1
1
  import type { Provider } from '@tinkoff/dippy';
2
+ declare module '@tinkoff/router' {
3
+ interface RouteConfig {
4
+ forceRouteResolve?: boolean;
5
+ }
6
+ }
2
7
  export declare const providers: Provider[];
@@ -27,7 +27,11 @@ const providers = [
27
27
  });
28
28
  if (routeResolve) {
29
29
  router.registerHook('beforeResolve', async (navigation) => {
30
- if (!router.resolve(navigation.url.href)) {
30
+ var _a;
31
+ const existingRoute = router.resolve(navigation.url.href);
32
+ // forceRouteResolve exists as a fallback property in case we have any conflicts
33
+ // in external routes definition and we need to force route resolving is some cases
34
+ if (!existingRoute || ((_a = existingRoute.config) === null || _a === void 0 ? void 0 : _a.forceRouteResolve)) {
31
35
  const route = await routeResolve(navigation);
32
36
  if (route) {
33
37
  router.addRoute(routeTransform(route));
@@ -35,7 +35,11 @@ const providers = [
35
35
  });
36
36
  if (routeResolve) {
37
37
  router.registerHook('beforeResolve', async (navigation) => {
38
- if (!router.resolve(navigation.url.href)) {
38
+ var _a;
39
+ const existingRoute = router.resolve(navigation.url.href);
40
+ // forceRouteResolve exists as a fallback property in case we have any conflicts
41
+ // in external routes definition and we need to force route resolving is some cases
42
+ if (!existingRoute || ((_a = existingRoute.config) === null || _a === void 0 ? void 0 : _a.forceRouteResolve)) {
39
43
  const route = await routeResolve(navigation);
40
44
  if (route) {
41
45
  router.addRoute(routeTransform(route));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-router",
3
- "version": "2.92.1",
3
+ "version": "2.94.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "browser": {
@@ -26,26 +26,26 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@tinkoff/errors": "0.3.8",
29
- "@tinkoff/router": "0.2.12",
29
+ "@tinkoff/router": "0.2.13",
30
30
  "@tinkoff/url": "0.8.6",
31
- "@tramvai/react": "2.92.1",
32
- "@tramvai/tokens-child-app": "2.92.1",
33
- "@tramvai/tokens-render": "2.92.1",
34
- "@tramvai/tokens-router": "2.92.1",
35
- "@tramvai/tokens-server": "2.92.1",
36
- "@tramvai/experiments": "2.92.1"
31
+ "@tramvai/react": "2.94.0",
32
+ "@tramvai/tokens-child-app": "2.94.0",
33
+ "@tramvai/tokens-render": "2.94.0",
34
+ "@tramvai/tokens-router": "2.94.0",
35
+ "@tramvai/tokens-server": "2.94.0",
36
+ "@tramvai/experiments": "2.94.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@tinkoff/utils": "^2.1.2",
40
- "@tramvai/cli": "2.92.1",
41
- "@tramvai/core": "2.92.1",
42
- "@tramvai/module-log": "2.92.1",
43
- "@tramvai/module-server": "2.92.1",
44
- "@tramvai/papi": "2.92.1",
45
- "@tramvai/state": "2.92.1",
46
- "@tramvai/test-helpers": "2.92.1",
47
- "@tramvai/test-mocks": "2.92.1",
48
- "@tramvai/tokens-common": "2.92.1",
40
+ "@tramvai/cli": "2.94.0",
41
+ "@tramvai/core": "2.94.0",
42
+ "@tramvai/module-log": "2.94.0",
43
+ "@tramvai/module-server": "2.94.0",
44
+ "@tramvai/papi": "2.94.0",
45
+ "@tramvai/state": "2.94.0",
46
+ "@tramvai/test-helpers": "2.94.0",
47
+ "@tramvai/test-mocks": "2.94.0",
48
+ "@tramvai/tokens-common": "2.94.0",
49
49
  "@tinkoff/dippy": "0.8.15",
50
50
  "react": "*",
51
51
  "tslib": "^2.4.0"