@tramvai/module-child-app 7.21.1 → 7.26.8
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/react/ChildAppErrorBoundary/FallbackError.d.ts +2 -1
- package/lib/shared/react/ChildAppFallbackWrapper.d.ts +1 -1
- package/lib/shared/react/childAppErrorBoundaryWrapper.d.ts +1 -1
- package/lib/shared/react/component.d.ts +1 -1
- package/lib/shared/singletonDi.browser.js +1 -2
- 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
|
];
|
|
@@ -12,7 +12,7 @@ import { getChildProviders as getChildProviders$1 } from '../../browser/child/si
|
|
|
12
12
|
import { extractorProviders } from './extractorProviders.browser.browser.js';
|
|
13
13
|
import { ChildAppPageService } from '../pageService.browser.js';
|
|
14
14
|
|
|
15
|
-
const getChildProviders = (appDi,
|
|
15
|
+
const getChildProviders = (appDi, config) => {
|
|
16
16
|
const logger = appDi.get(LOGGER_TOKEN);
|
|
17
17
|
return [
|
|
18
18
|
provide({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Container } from '@tinkoff/dippy';
|
|
2
2
|
import type { Provider } from '@tramvai/core';
|
|
3
3
|
import { ChildAppFinalConfig } from '@tramvai/tokens-child-app';
|
|
4
|
-
|
|
5
|
-
export declare const getChildProviders: (appDi: Container, loadableStats: LoadableStats, config: ChildAppFinalConfig) => Provider[];
|
|
4
|
+
export declare const getChildProviders: (appDi: Container, config: ChildAppFinalConfig) => Provider[];
|
|
6
5
|
//# sourceMappingURL=singletonProviders.d.ts.map
|
|
@@ -12,7 +12,7 @@ import { getChildProviders as getChildProviders$1 } from '../../server/child/sin
|
|
|
12
12
|
import { extractorProviders } from './extractorProviders.es.js';
|
|
13
13
|
import { ChildAppPageService } from '../pageService.es.js';
|
|
14
14
|
|
|
15
|
-
const getChildProviders = (appDi,
|
|
15
|
+
const getChildProviders = (appDi, config) => {
|
|
16
16
|
const logger = appDi.get(LOGGER_TOKEN);
|
|
17
17
|
return [
|
|
18
18
|
provide({
|
|
@@ -89,7 +89,7 @@ const getChildProviders = (appDi, loadableStats, config) => {
|
|
|
89
89
|
],
|
|
90
90
|
}),
|
|
91
91
|
...getChildProviders$1(),
|
|
92
|
-
...extractorProviders(
|
|
92
|
+
...extractorProviders(appDi),
|
|
93
93
|
provide({
|
|
94
94
|
provide: DISPATCHER_CONTEXT_TOKEN,
|
|
95
95
|
scope: Scope.REQUEST,
|
|
@@ -21,7 +21,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
21
21
|
var flatten__default = /*#__PURE__*/_interopDefaultLegacy(flatten);
|
|
22
22
|
var noop__default = /*#__PURE__*/_interopDefaultLegacy(noop);
|
|
23
23
|
|
|
24
|
-
const getChildProviders = (appDi,
|
|
24
|
+
const getChildProviders = (appDi, config) => {
|
|
25
25
|
const logger$1 = appDi.get(tokensCommon.LOGGER_TOKEN);
|
|
26
26
|
return [
|
|
27
27
|
core.provide({
|
|
@@ -98,7 +98,7 @@ const getChildProviders = (appDi, loadableStats, config) => {
|
|
|
98
98
|
],
|
|
99
99
|
}),
|
|
100
100
|
...singletonProviders.getChildProviders(),
|
|
101
|
-
...extractorProviders.extractorProviders(
|
|
101
|
+
...extractorProviders.extractorProviders(appDi),
|
|
102
102
|
core.provide({
|
|
103
103
|
provide: tokensCommon.DISPATCHER_CONTEXT_TOKEN,
|
|
104
104
|
scope: core.Scope.REQUEST,
|
|
@@ -5,6 +5,6 @@ type AnyError = Error & {
|
|
|
5
5
|
interface Props extends ChildAppReactConfig {
|
|
6
6
|
error?: AnyError;
|
|
7
7
|
}
|
|
8
|
-
export declare const ChildAppFallbackWrapper: ({ name, fallback: Fallback, tag, version, error, }: Props) => import("react
|
|
8
|
+
export declare const ChildAppFallbackWrapper: ({ name, fallback: Fallback, tag, version, error, }: Props) => import("react").JSX.Element | null;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=ChildAppFallbackWrapper.d.ts.map
|
|
@@ -3,6 +3,6 @@ import type { ChildAppReactConfig } from '@tramvai/tokens-child-app';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
config: ChildAppReactConfig;
|
|
5
5
|
};
|
|
6
|
-
export declare const ChildAppErrorBoundaryWrapper: (props: PropsWithChildren<Props>) => import("react
|
|
6
|
+
export declare const ChildAppErrorBoundaryWrapper: (props: PropsWithChildren<Props>) => import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=childAppErrorBoundaryWrapper.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChildAppReactConfig } from '@tramvai/tokens-child-app';
|
|
2
|
-
export declare const ChildApp: import("react").MemoExoticComponent<(config: ChildAppReactConfig) => import("react
|
|
2
|
+
export declare const ChildApp: import("react").MemoExoticComponent<(config: ChildAppReactConfig) => import("react").JSX.Element>;
|
|
3
3
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -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, config);
|
|
95
94
|
childProviders.forEach((provider) => {
|
|
96
95
|
di.register(provider);
|
|
97
96
|
});
|
|
@@ -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, config);
|
|
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, config);
|
|
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": "7.
|
|
3
|
+
"version": "7.26.8",
|
|
4
4
|
"description": "Module for child apps",
|
|
5
5
|
"browser": {
|
|
6
6
|
"./lib/server.es.js": "./lib/browser.js",
|
|
@@ -36,27 +36,37 @@
|
|
|
36
36
|
"@tinkoff/module-loader-client": "0.9.1",
|
|
37
37
|
"@tinkoff/module-loader-server": "0.10.3",
|
|
38
38
|
"@tinkoff/url": "0.13.1",
|
|
39
|
-
"@tramvai/child-app-core": "7.
|
|
40
|
-
"@tramvai/module-common": "7.
|
|
41
|
-
"@tramvai/module-router": "7.
|
|
39
|
+
"@tramvai/child-app-core": "7.26.8",
|
|
40
|
+
"@tramvai/module-common": "7.26.8",
|
|
41
|
+
"@tramvai/module-router": "7.26.8",
|
|
42
42
|
"@tramvai/safe-strings": "0.10.1",
|
|
43
|
-
"@tramvai/tokens-child-app": "7.
|
|
43
|
+
"@tramvai/tokens-child-app": "7.26.8"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@tinkoff/dippy": "^1.0.0",
|
|
47
|
-
"@tinkoff/router": "0.7.
|
|
47
|
+
"@tinkoff/router": "0.7.106",
|
|
48
48
|
"@tinkoff/utils": "^2.1.2",
|
|
49
|
-
"@tramvai/core": "7.
|
|
50
|
-
"@tramvai/react": "7.
|
|
51
|
-
"@tramvai/state": "7.
|
|
52
|
-
"@tramvai/tokens-common": "7.
|
|
53
|
-
"@tramvai/tokens-render": "7.
|
|
54
|
-
"@tramvai/tokens-router": "7.
|
|
49
|
+
"@tramvai/core": "7.26.8",
|
|
50
|
+
"@tramvai/react": "7.26.8",
|
|
51
|
+
"@tramvai/state": "7.26.8",
|
|
52
|
+
"@tramvai/tokens-common": "7.26.8",
|
|
53
|
+
"@tramvai/tokens-render": "7.26.8",
|
|
54
|
+
"@tramvai/tokens-router": "7.26.8",
|
|
55
55
|
"object-assign": "^4.1.1",
|
|
56
56
|
"react": ">=16.14.0",
|
|
57
57
|
"react-dom": ">=16.14.0",
|
|
58
58
|
"semver": "^7.3.8",
|
|
59
59
|
"tslib": "^2.4.0"
|
|
60
60
|
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@tramvai/module-http-client": "7.26.8",
|
|
63
|
+
"@tramvai/module-react-query": "7.26.8",
|
|
64
|
+
"@tramvai/module-render": "7.26.8",
|
|
65
|
+
"@tramvai/module-router": "7.26.8",
|
|
66
|
+
"@tramvai/module-server": "7.26.8",
|
|
67
|
+
"@tramvai/react": "7.26.8",
|
|
68
|
+
"@tramvai/react-query": "7.26.8",
|
|
69
|
+
"@tramvai/state": "7.26.8"
|
|
70
|
+
},
|
|
61
71
|
"module": "lib/server.es.js"
|
|
62
72
|
}
|