@tramvai/module-child-app 7.3.0 → 7.4.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.
@@ -1,6 +1,7 @@
1
1
  import { provide } from '@tramvai/core';
2
2
  import { commandLineListTokens, CHILD_APP_PAGE_SERVICE_TOKEN } from '@tramvai/tokens-child-app';
3
3
  import { ACTION_PAGE_RUNNER_TOKEN } from '@tramvai/tokens-common';
4
+ import { stopRunAtError } from '@tramvai/module-router';
4
5
 
5
6
  const getChildProviders = (appDi) => {
6
7
  return [
@@ -10,7 +11,7 @@ const getChildProviders = (appDi) => {
10
11
  useFactory: ({ actionRunner, childAppPageService }) => {
11
12
  return async function childAppRunActions() {
12
13
  await childAppPageService.resolveComponent();
13
- return actionRunner.runActions(childAppPageService.getActions());
14
+ return actionRunner.runActions(childAppPageService.getActions(), stopRunAtError);
14
15
  };
15
16
  },
16
17
  deps: {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@tramvai/core');
6
6
  var tokensChildApp = require('@tramvai/tokens-child-app');
7
7
  var tokensCommon = require('@tramvai/tokens-common');
8
+ var moduleRouter = require('@tramvai/module-router');
8
9
 
9
10
  const getChildProviders = (appDi) => {
10
11
  return [
@@ -14,7 +15,7 @@ const getChildProviders = (appDi) => {
14
15
  useFactory: ({ actionRunner, childAppPageService }) => {
15
16
  return async function childAppRunActions() {
16
17
  await childAppPageService.resolveComponent();
17
- return actionRunner.runActions(childAppPageService.getActions());
18
+ return actionRunner.runActions(childAppPageService.getActions(), moduleRouter.stopRunAtError);
18
19
  };
19
20
  },
20
21
  deps: {
@@ -1,5 +1,6 @@
1
1
  import { isSilentError } from '@tinkoff/errors';
2
2
  import { COMMAND_LINE_RUNNER_TOKEN, provide } from '@tramvai/core';
3
+ import { stopRunAtError } from '@tramvai/module-router';
3
4
  import { ROOT_EXECUTION_CONTEXT_TOKEN } from '@tramvai/tokens-common';
4
5
 
5
6
  class CommandLineRunner {
@@ -55,15 +56,20 @@ class CommandLineRunner {
55
56
  }
56
57
  catch (error) {
57
58
  if (error.code !== 'E_STUB') {
58
- this.log[
59
- // for example, we don't need to log Child App run as failed in case of RedirectFoundError
60
- isSilentError(error) || (error.reason && isSilentError(error.reason)) ? 'debug' : 'error']({
61
- event: 'run-failed',
62
- error,
63
- type,
64
- status,
65
- childApp: { name: config.name, version: config.version, tag: config.tag },
66
- });
59
+ if (stopRunAtError(error)) {
60
+ throw error;
61
+ }
62
+ else {
63
+ this.log[isSilentError(error) || (error.reason && isSilentError(error.reason))
64
+ ? 'debug'
65
+ : 'error']({
66
+ event: 'run-failed',
67
+ error,
68
+ type,
69
+ status,
70
+ childApp: { name: config.name, version: config.version, tag: config.tag },
71
+ });
72
+ }
67
73
  }
68
74
  }
69
75
  }
@@ -1,5 +1,6 @@
1
1
  import { isSilentError } from '@tinkoff/errors';
2
2
  import { COMMAND_LINE_RUNNER_TOKEN, provide } from '@tramvai/core';
3
+ import { stopRunAtError } from '@tramvai/module-router';
3
4
  import { ROOT_EXECUTION_CONTEXT_TOKEN } from '@tramvai/tokens-common';
4
5
 
5
6
  class CommandLineRunner {
@@ -55,15 +56,20 @@ class CommandLineRunner {
55
56
  }
56
57
  catch (error) {
57
58
  if (error.code !== 'E_STUB') {
58
- this.log[
59
- // for example, we don't need to log Child App run as failed in case of RedirectFoundError
60
- isSilentError(error) || (error.reason && isSilentError(error.reason)) ? 'debug' : 'error']({
61
- event: 'run-failed',
62
- error,
63
- type,
64
- status,
65
- childApp: { name: config.name, version: config.version, tag: config.tag },
66
- });
59
+ if (stopRunAtError(error)) {
60
+ throw error;
61
+ }
62
+ else {
63
+ this.log[isSilentError(error) || (error.reason && isSilentError(error.reason))
64
+ ? 'debug'
65
+ : 'error']({
66
+ event: 'run-failed',
67
+ error,
68
+ type,
69
+ status,
70
+ childApp: { name: config.name, version: config.version, tag: config.tag },
71
+ });
72
+ }
67
73
  }
68
74
  }
69
75
  }
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var errors = require('@tinkoff/errors');
6
6
  var core = require('@tramvai/core');
7
+ var moduleRouter = require('@tramvai/module-router');
7
8
  var tokensCommon = require('@tramvai/tokens-common');
8
9
 
9
10
  class CommandLineRunner {
@@ -59,15 +60,20 @@ class CommandLineRunner {
59
60
  }
60
61
  catch (error) {
61
62
  if (error.code !== 'E_STUB') {
62
- this.log[
63
- // for example, we don't need to log Child App run as failed in case of RedirectFoundError
64
- errors.isSilentError(error) || (error.reason && errors.isSilentError(error.reason)) ? 'debug' : 'error']({
65
- event: 'run-failed',
66
- error,
67
- type,
68
- status,
69
- childApp: { name: config.name, version: config.version, tag: config.tag },
70
- });
63
+ if (moduleRouter.stopRunAtError(error)) {
64
+ throw error;
65
+ }
66
+ else {
67
+ this.log[errors.isSilentError(error) || (error.reason && errors.isSilentError(error.reason))
68
+ ? 'debug'
69
+ : 'error']({
70
+ event: 'run-failed',
71
+ error,
72
+ type,
73
+ status,
74
+ childApp: { name: config.name, version: config.version, tag: config.tag },
75
+ });
76
+ }
71
77
  }
72
78
  }
73
79
  }
@@ -1,4 +1,5 @@
1
1
  import { provide, commandLineListTokens } from '@tramvai/core';
2
+ import { stopRunAtError } from '@tramvai/module-router';
2
3
  import { resolveLazyComponent } from '@tramvai/react';
3
4
  import { CHILD_APP_PRELOAD_SOURCE_LIST_TOKEN, CHILD_APP_PRELOAD_MANAGER_TOKEN } from '@tramvai/tokens-child-app';
4
5
  import { PAGE_SERVICE_TOKEN, LINK_PREFETCH_HANDLER_TOKEN } from '@tramvai/tokens-router';
@@ -13,8 +14,10 @@ const pagePreload = async ({ preloadManager, preloadSourceList, }, mode, isSpaNa
13
14
  if (mode === 'preload' && isSpaNavigation && !preloadManager.isPreloaded(request)) {
14
15
  preloadManager.saveNotPreloadedForSpaNavigation(request);
15
16
  }
16
- return preloadManager[mode](request, route).catch(() => {
17
- // actual error will be logged internally
17
+ return preloadManager[mode](request, route).catch((error) => {
18
+ if (stopRunAtError(error)) {
19
+ throw error;
20
+ }
18
21
  });
19
22
  }));
20
23
  };
@@ -1,4 +1,5 @@
1
1
  import { provide, commandLineListTokens } from '@tramvai/core';
2
+ import { stopRunAtError } from '@tramvai/module-router';
2
3
  import { resolveLazyComponent } from '@tramvai/react';
3
4
  import { CHILD_APP_PRELOAD_SOURCE_LIST_TOKEN, CHILD_APP_PRELOAD_MANAGER_TOKEN } from '@tramvai/tokens-child-app';
4
5
  import { PAGE_SERVICE_TOKEN, LINK_PREFETCH_HANDLER_TOKEN } from '@tramvai/tokens-router';
@@ -13,8 +14,10 @@ const pagePreload = async ({ preloadManager, preloadSourceList, }, mode, isSpaNa
13
14
  if (mode === 'preload' && isSpaNavigation && !preloadManager.isPreloaded(request)) {
14
15
  preloadManager.saveNotPreloadedForSpaNavigation(request);
15
16
  }
16
- return preloadManager[mode](request, route).catch(() => {
17
- // actual error will be logged internally
17
+ return preloadManager[mode](request, route).catch((error) => {
18
+ if (stopRunAtError(error)) {
19
+ throw error;
20
+ }
18
21
  });
19
22
  }));
20
23
  };
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@tramvai/core');
6
+ var moduleRouter = require('@tramvai/module-router');
6
7
  var react = require('@tramvai/react');
7
8
  var tokensChildApp = require('@tramvai/tokens-child-app');
8
9
  var tokensRouter = require('@tramvai/tokens-router');
@@ -17,8 +18,10 @@ const pagePreload = async ({ preloadManager, preloadSourceList, }, mode, isSpaNa
17
18
  if (mode === 'preload' && isSpaNavigation && !preloadManager.isPreloaded(request)) {
18
19
  preloadManager.saveNotPreloadedForSpaNavigation(request);
19
20
  }
20
- return preloadManager[mode](request, route).catch(() => {
21
- // actual error will be logged internally
21
+ return preloadManager[mode](request, route).catch((error) => {
22
+ if (moduleRouter.stopRunAtError(error)) {
23
+ throw error;
24
+ }
22
25
  });
23
26
  }));
24
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-child-app",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Module for child apps",
5
5
  "browser": {
6
6
  "./lib/server.es.js": "./lib/browser.js",
@@ -35,21 +35,22 @@
35
35
  "@tinkoff/module-loader-client": "0.9.1",
36
36
  "@tinkoff/module-loader-server": "0.10.2",
37
37
  "@tinkoff/url": "0.13.1",
38
- "@tramvai/child-app-core": "7.3.0",
39
- "@tramvai/module-common": "7.3.0",
38
+ "@tramvai/child-app-core": "7.4.0",
39
+ "@tramvai/module-common": "7.4.0",
40
+ "@tramvai/module-router": "7.4.0",
40
41
  "@tramvai/safe-strings": "0.10.1",
41
- "@tramvai/tokens-child-app": "7.3.0"
42
+ "@tramvai/tokens-child-app": "7.4.0"
42
43
  },
43
44
  "peerDependencies": {
44
- "@tinkoff/dippy": "0.13.1",
45
- "@tinkoff/router": "0.7.9",
45
+ "@tinkoff/dippy": "0.13.2",
46
+ "@tinkoff/router": "0.7.11",
46
47
  "@tinkoff/utils": "^2.1.2",
47
- "@tramvai/core": "7.3.0",
48
- "@tramvai/react": "7.3.0",
49
- "@tramvai/state": "7.3.0",
50
- "@tramvai/tokens-common": "7.3.0",
51
- "@tramvai/tokens-render": "7.3.0",
52
- "@tramvai/tokens-router": "7.3.0",
48
+ "@tramvai/core": "7.4.0",
49
+ "@tramvai/react": "7.4.0",
50
+ "@tramvai/state": "7.4.0",
51
+ "@tramvai/tokens-common": "7.4.0",
52
+ "@tramvai/tokens-render": "7.4.0",
53
+ "@tramvai/tokens-router": "7.4.0",
53
54
  "object-assign": "^4.1.1",
54
55
  "react": ">=16.14.0",
55
56
  "react-dom": ">=16.14.0",