@tramvai/module-router 2.49.0 → 2.49.3

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.
@@ -8,7 +8,7 @@ export * from '@tramvai/tokens-router';
8
8
  import { EXTEND_RENDER, TRAMVAI_RENDER_MODE } from '@tramvai/tokens-render';
9
9
  import { createEvent, createReducer } from '@tramvai/state';
10
10
  import flatten from '@tinkoff/utils/array/flatten';
11
- import { createToken } from '@tinkoff/dippy';
11
+ import { createToken, optional } from '@tinkoff/dippy';
12
12
  import isArray from '@tinkoff/utils/is/array';
13
13
  import { resolveLazyComponent, useDi } from '@tramvai/react';
14
14
  import identity from '@tinkoff/utils/function/identity';
@@ -833,9 +833,9 @@ const isUserNetworkConditionsSuitableForPrefetch = () => {
833
833
  return !saveData && !(effectiveType === '2g' || effectiveType === 'slow-2g');
834
834
  };
835
835
  const usePrefetch = ({ url, target, prefetch, }) => {
836
- const linkPrefetchManager = useDi(LINK_PREFETCH_MANAGER_TOKEN);
836
+ const linkPrefetchManager = useDi(optional(LINK_PREFETCH_MANAGER_TOKEN));
837
837
  useEffect(() => {
838
- if (!target || !prefetch) {
838
+ if (!target || !prefetch || !linkPrefetchManager) {
839
839
  return;
840
840
  }
841
841
  let idleId = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-router",
3
- "version": "2.49.0",
3
+ "version": "2.49.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "browser": {
@@ -29,24 +29,24 @@
29
29
  "@tinkoff/errors": "0.3.5",
30
30
  "@tinkoff/router": "0.2.5",
31
31
  "@tinkoff/url": "0.8.4",
32
- "@tramvai/react": "2.49.0",
33
- "@tramvai/tokens-child-app": "2.49.0",
34
- "@tramvai/tokens-render": "2.49.0",
35
- "@tramvai/tokens-router": "2.49.0",
36
- "@tramvai/tokens-server": "2.49.0",
37
- "@tramvai/experiments": "2.49.0"
32
+ "@tramvai/react": "2.49.3",
33
+ "@tramvai/tokens-child-app": "2.49.3",
34
+ "@tramvai/tokens-render": "2.49.3",
35
+ "@tramvai/tokens-router": "2.49.3",
36
+ "@tramvai/tokens-server": "2.49.3",
37
+ "@tramvai/experiments": "2.49.3"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@tinkoff/utils": "^2.1.2",
41
- "@tramvai/cli": "2.49.0",
42
- "@tramvai/core": "2.49.0",
43
- "@tramvai/module-log": "2.49.0",
44
- "@tramvai/module-server": "2.49.0",
45
- "@tramvai/papi": "2.49.0",
46
- "@tramvai/state": "2.49.0",
47
- "@tramvai/test-helpers": "2.49.0",
48
- "@tramvai/test-mocks": "2.49.0",
49
- "@tramvai/tokens-common": "2.49.0",
41
+ "@tramvai/cli": "2.49.3",
42
+ "@tramvai/core": "2.49.3",
43
+ "@tramvai/module-log": "2.49.3",
44
+ "@tramvai/module-server": "2.49.3",
45
+ "@tramvai/papi": "2.49.3",
46
+ "@tramvai/state": "2.49.3",
47
+ "@tramvai/test-helpers": "2.49.3",
48
+ "@tramvai/test-mocks": "2.49.3",
49
+ "@tramvai/tokens-common": "2.49.3",
50
50
  "@tinkoff/dippy": "0.8.9",
51
51
  "react": "*",
52
52
  "tslib": "^2.4.0"