@tramvai/module-child-app 5.53.155 → 5.53.156
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/lib/server/preload.es.js +1 -0
- package/lib/server/preload.js +1 -0
- package/lib/shared/child/extractorProviders.d.ts +6 -2
- package/lib/shared/child/extractorProviders.es.js +9 -4
- package/lib/shared/child/extractorProviders.js +8 -3
- package/lib/shared/child/singletonProviders.browser.js +1 -1
- package/lib/shared/child/singletonProviders.d.ts +1 -2
- package/lib/shared/child/singletonProviders.es.js +2 -2
- package/lib/shared/child/singletonProviders.js +2 -2
- package/lib/shared/singletonDi.browser.js +0 -1
- package/lib/shared/singletonDi.es.js +1 -2
- package/lib/shared/singletonDi.js +1 -2
- package/lib/unused.d.ts +5 -0
- package/package.json +22 -12
package/lib/server/preload.es.js
CHANGED
package/lib/server/preload.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ChunkExtractor } from '@loadable/server';
|
|
2
|
-
import
|
|
3
|
-
export declare const extractorProviders: (
|
|
2
|
+
import { Container } from '@tinkoff/dippy';
|
|
3
|
+
export declare const extractorProviders: (appDi: Container) => import("@tramvai/core").Provider<{
|
|
4
|
+
config: import("@tramvai/tokens-child-app").ChildAppFinalConfig & {
|
|
5
|
+
__type?: "base token" | undefined;
|
|
6
|
+
};
|
|
7
|
+
}, ChunkExtractor & {
|
|
4
8
|
__type?: "base token" | undefined;
|
|
5
9
|
}>[];
|
|
6
10
|
//# sourceMappingURL=extractorProviders.d.ts.map
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { provide, Scope } from '@tramvai/core';
|
|
2
|
-
import { CHILD_APP_INTERNAL_CHUNK_EXTRACTOR } from '@tramvai/tokens-child-app';
|
|
2
|
+
import { CHILD_APP_INTERNAL_CHUNK_EXTRACTOR, CHILD_APP_LOADER_TOKEN, CHILD_APP_INTERNAL_CONFIG_TOKEN } from '@tramvai/tokens-child-app';
|
|
3
3
|
import { ChunkExtractor } from '@loadable/server';
|
|
4
4
|
|
|
5
|
-
const extractorProviders = (
|
|
5
|
+
const extractorProviders = (appDi) => [
|
|
6
6
|
provide({
|
|
7
7
|
provide: CHILD_APP_INTERNAL_CHUNK_EXTRACTOR,
|
|
8
8
|
scope: Scope.REQUEST,
|
|
9
|
-
useFactory: () => {
|
|
10
|
-
|
|
9
|
+
useFactory: ({ config }) => {
|
|
10
|
+
const loader = appDi.get(CHILD_APP_LOADER_TOKEN);
|
|
11
|
+
const statsLoadable = 'getLoadableStats' in loader ? loader.getLoadableStats(config) : undefined;
|
|
12
|
+
return new ChunkExtractor({ stats: statsLoadable ?? {}, entrypoints: [] });
|
|
13
|
+
},
|
|
14
|
+
deps: {
|
|
15
|
+
config: CHILD_APP_INTERNAL_CONFIG_TOKEN,
|
|
11
16
|
},
|
|
12
17
|
}),
|
|
13
18
|
];
|
|
@@ -6,12 +6,17 @@ var core = require('@tramvai/core');
|
|
|
6
6
|
var tokensChildApp = require('@tramvai/tokens-child-app');
|
|
7
7
|
var server = require('@loadable/server');
|
|
8
8
|
|
|
9
|
-
const extractorProviders = (
|
|
9
|
+
const extractorProviders = (appDi) => [
|
|
10
10
|
core.provide({
|
|
11
11
|
provide: tokensChildApp.CHILD_APP_INTERNAL_CHUNK_EXTRACTOR,
|
|
12
12
|
scope: core.Scope.REQUEST,
|
|
13
|
-
useFactory: () => {
|
|
14
|
-
|
|
13
|
+
useFactory: ({ config }) => {
|
|
14
|
+
const loader = appDi.get(tokensChildApp.CHILD_APP_LOADER_TOKEN);
|
|
15
|
+
const statsLoadable = 'getLoadableStats' in loader ? loader.getLoadableStats(config) : undefined;
|
|
16
|
+
return new server.ChunkExtractor({ stats: statsLoadable ?? {}, entrypoints: [] });
|
|
17
|
+
},
|
|
18
|
+
deps: {
|
|
19
|
+
config: tokensChildApp.CHILD_APP_INTERNAL_CONFIG_TOKEN,
|
|
15
20
|
},
|
|
16
21
|
}),
|
|
17
22
|
];
|
|
@@ -10,7 +10,7 @@ import { getChildProviders as getChildProviders$1 } from '../../browser/child/si
|
|
|
10
10
|
import { extractorProviders } from './extractorProviders.browser.browser.js';
|
|
11
11
|
import { ChildAppPageService } from '../pageService.browser.js';
|
|
12
12
|
|
|
13
|
-
const getChildProviders = (appDi
|
|
13
|
+
const getChildProviders = (appDi) => {
|
|
14
14
|
const logger = appDi.get(LOGGER_TOKEN);
|
|
15
15
|
return [
|
|
16
16
|
provide({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Container } from '@tinkoff/dippy';
|
|
2
2
|
import type { Provider } from '@tramvai/core';
|
|
3
|
-
|
|
4
|
-
export declare const getChildProviders: (appDi: Container, loadableStats: LoadableStats) => Provider[];
|
|
3
|
+
export declare const getChildProviders: (appDi: Container) => Provider[];
|
|
5
4
|
//# sourceMappingURL=singletonProviders.d.ts.map
|
|
@@ -10,7 +10,7 @@ import { getChildProviders as getChildProviders$1 } from '../../server/child/sin
|
|
|
10
10
|
import { extractorProviders } from './extractorProviders.es.js';
|
|
11
11
|
import { ChildAppPageService } from '../pageService.es.js';
|
|
12
12
|
|
|
13
|
-
const getChildProviders = (appDi
|
|
13
|
+
const getChildProviders = (appDi) => {
|
|
14
14
|
const logger = appDi.get(LOGGER_TOKEN);
|
|
15
15
|
return [
|
|
16
16
|
provide({
|
|
@@ -69,7 +69,7 @@ const getChildProviders = (appDi, loadableStats) => {
|
|
|
69
69
|
],
|
|
70
70
|
}),
|
|
71
71
|
...getChildProviders$1(),
|
|
72
|
-
...extractorProviders(
|
|
72
|
+
...extractorProviders(appDi),
|
|
73
73
|
provide({
|
|
74
74
|
provide: DISPATCHER_CONTEXT_TOKEN,
|
|
75
75
|
scope: Scope.REQUEST,
|
|
@@ -18,7 +18,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
18
|
|
|
19
19
|
var flatten__default = /*#__PURE__*/_interopDefaultLegacy(flatten);
|
|
20
20
|
|
|
21
|
-
const getChildProviders = (appDi
|
|
21
|
+
const getChildProviders = (appDi) => {
|
|
22
22
|
const logger = appDi.get(tokensCommon.LOGGER_TOKEN);
|
|
23
23
|
return [
|
|
24
24
|
core.provide({
|
|
@@ -77,7 +77,7 @@ const getChildProviders = (appDi, loadableStats) => {
|
|
|
77
77
|
],
|
|
78
78
|
}),
|
|
79
79
|
...singletonProviders.getChildProviders(),
|
|
80
|
-
...extractorProviders.extractorProviders(
|
|
80
|
+
...extractorProviders.extractorProviders(appDi),
|
|
81
81
|
core.provide({
|
|
82
82
|
provide: tokensCommon.DISPATCHER_CONTEXT_TOKEN,
|
|
83
83
|
scope: core.Scope.REQUEST,
|
|
@@ -89,7 +89,6 @@ class SingletonDiManager {
|
|
|
89
89
|
},
|
|
90
90
|
], this.appDi);
|
|
91
91
|
}
|
|
92
|
-
'getLoadableStats' in this.loader ? this.loader.getLoadableStats(config) : undefined;
|
|
93
92
|
// add providers on the Singleton Level to make it possible to reuse providers from the root-app Container
|
|
94
93
|
const childProviders = getChildProviders(this.appDi);
|
|
95
94
|
childProviders.forEach((provider) => {
|
|
@@ -89,9 +89,8 @@ class SingletonDiManager {
|
|
|
89
89
|
},
|
|
90
90
|
], this.appDi);
|
|
91
91
|
}
|
|
92
|
-
const statsLoadable = 'getLoadableStats' in this.loader ? this.loader.getLoadableStats(config) : undefined;
|
|
93
92
|
// add providers on the Singleton Level to make it possible to reuse providers from the root-app Container
|
|
94
|
-
const childProviders = getChildProviders(this.appDi
|
|
93
|
+
const childProviders = getChildProviders(this.appDi);
|
|
95
94
|
childProviders.forEach((provider) => {
|
|
96
95
|
di.register(provider);
|
|
97
96
|
});
|
|
@@ -97,9 +97,8 @@ class SingletonDiManager {
|
|
|
97
97
|
},
|
|
98
98
|
], this.appDi);
|
|
99
99
|
}
|
|
100
|
-
const statsLoadable = 'getLoadableStats' in this.loader ? this.loader.getLoadableStats(config) : undefined;
|
|
101
100
|
// add providers on the Singleton Level to make it possible to reuse providers from the root-app Container
|
|
102
|
-
const childProviders = singletonProviders.getChildProviders(this.appDi
|
|
101
|
+
const childProviders = singletonProviders.getChildProviders(this.appDi);
|
|
103
102
|
childProviders.forEach((provider) => {
|
|
104
103
|
di.register(provider);
|
|
105
104
|
});
|
package/lib/unused.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-child-app",
|
|
3
|
-
"version": "5.53.
|
|
3
|
+
"version": "5.53.156",
|
|
4
4
|
"description": "Module for child apps",
|
|
5
5
|
"browser": {
|
|
6
6
|
"./lib/server.es.js": "./lib/browser.js",
|
|
@@ -35,27 +35,37 @@
|
|
|
35
35
|
"@tinkoff/module-loader-client": "0.7.9",
|
|
36
36
|
"@tinkoff/module-loader-server": "0.8.12",
|
|
37
37
|
"@tinkoff/url": "0.11.7",
|
|
38
|
-
"@tramvai/child-app-core": "5.53.
|
|
39
|
-
"@tramvai/module-common": "5.53.
|
|
40
|
-
"@tramvai/module-router": "5.53.
|
|
38
|
+
"@tramvai/child-app-core": "5.53.156",
|
|
39
|
+
"@tramvai/module-common": "5.53.156",
|
|
40
|
+
"@tramvai/module-router": "5.53.156",
|
|
41
41
|
"@tramvai/safe-strings": "0.8.8",
|
|
42
|
-
"@tramvai/tokens-child-app": "5.53.
|
|
42
|
+
"@tramvai/tokens-child-app": "5.53.156"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@tinkoff/dippy": "^1.0.0",
|
|
46
|
-
"@tinkoff/router": "0.5.
|
|
46
|
+
"@tinkoff/router": "0.5.280",
|
|
47
47
|
"@tinkoff/utils": "^2.1.2",
|
|
48
|
-
"@tramvai/core": "5.53.
|
|
49
|
-
"@tramvai/react": "5.53.
|
|
50
|
-
"@tramvai/state": "5.53.
|
|
51
|
-
"@tramvai/tokens-common": "5.53.
|
|
52
|
-
"@tramvai/tokens-render": "5.53.
|
|
53
|
-
"@tramvai/tokens-router": "5.53.
|
|
48
|
+
"@tramvai/core": "5.53.156",
|
|
49
|
+
"@tramvai/react": "5.53.156",
|
|
50
|
+
"@tramvai/state": "5.53.156",
|
|
51
|
+
"@tramvai/tokens-common": "5.53.156",
|
|
52
|
+
"@tramvai/tokens-render": "5.53.156",
|
|
53
|
+
"@tramvai/tokens-router": "5.53.156",
|
|
54
54
|
"object-assign": "^4.1.1",
|
|
55
55
|
"react": ">=16.14.0",
|
|
56
56
|
"react-dom": ">=16.14.0",
|
|
57
57
|
"semver": "^7.3.8",
|
|
58
58
|
"tslib": "^2.4.0"
|
|
59
59
|
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@tramvai/module-http-client": "5.53.156",
|
|
62
|
+
"@tramvai/module-react-query": "5.53.156",
|
|
63
|
+
"@tramvai/module-render": "5.53.156",
|
|
64
|
+
"@tramvai/module-router": "5.53.156",
|
|
65
|
+
"@tramvai/module-server": "5.53.156",
|
|
66
|
+
"@tramvai/react": "5.53.156",
|
|
67
|
+
"@tramvai/react-query": "5.53.156",
|
|
68
|
+
"@tramvai/state": "5.53.156"
|
|
69
|
+
},
|
|
60
70
|
"module": "lib/server.es.js"
|
|
61
71
|
}
|