@tramvai/module-child-app 2.0.2 → 2.2.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.
- package/lib/server/render-slots.d.ts +4 -3
- package/lib/server/stateManager.d.ts +2 -1
- package/lib/server.browser.js +2 -2
- package/lib/server.es.js +6 -4
- package/lib/server.js +6 -4
- package/lib/shared/render.d.ts +2 -1
- package/lib/shared/resolutionConfigManager.d.ts +4 -3
- package/package.json +10 -10
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ExtractDependencyType } from '@tinkoff/dippy';
|
|
1
2
|
import type { ChildAppDiManager, ChildAppPreloadManager, CHILD_APP_RESOLVE_CONFIG_TOKEN } from '@tramvai/tokens-child-app';
|
|
2
3
|
import type { LOGGER_TOKEN } from '@tramvai/tokens-common';
|
|
3
4
|
export declare const registerChildAppRenderSlots: ({ logger, diManager, resolveFullConfig, preloadManager, }: {
|
|
4
|
-
logger: typeof LOGGER_TOKEN
|
|
5
|
+
logger: ExtractDependencyType<typeof LOGGER_TOKEN>;
|
|
5
6
|
diManager: ChildAppDiManager;
|
|
6
|
-
resolveFullConfig: typeof CHILD_APP_RESOLVE_CONFIG_TOKEN
|
|
7
|
+
resolveFullConfig: ExtractDependencyType<typeof CHILD_APP_RESOLVE_CONFIG_TOKEN>;
|
|
7
8
|
preloadManager: ChildAppPreloadManager;
|
|
8
|
-
}) =>
|
|
9
|
+
}) => import("@tramvai/tokens-render").PageResource[];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { ExtractTokenType } from '@tinkoff/dippy';
|
|
1
2
|
import type { ChildAppDiManager, ChildAppStateManager, ChildAppFinalConfig } from '@tramvai/tokens-child-app';
|
|
2
3
|
import type { LOGGER_TOKEN, STORE_TOKEN } from '@tramvai/tokens-common';
|
|
3
4
|
import type { EXTEND_RENDER } from '@tramvai/tokens-render';
|
|
4
5
|
export declare const executeRootStateSubscriptions: ({ store, diManager, }: {
|
|
5
6
|
store: typeof STORE_TOKEN;
|
|
6
7
|
diManager: ChildAppDiManager;
|
|
7
|
-
}) => typeof EXTEND_RENDER
|
|
8
|
+
}) => ExtractTokenType<typeof EXTEND_RENDER>;
|
|
8
9
|
export declare class StateManager implements ChildAppStateManager {
|
|
9
10
|
private readonly log;
|
|
10
11
|
private readonly diManager;
|
package/lib/server.browser.js
CHANGED
|
@@ -3,7 +3,7 @@ import { provide, COMMAND_LINE_RUNNER_TOKEN, walkOfModules, getModuleParameters,
|
|
|
3
3
|
import { Container, ChildContainer, Scope, DI_TOKEN } from '@tinkoff/dippy';
|
|
4
4
|
import { commandLineListTokens, CHILD_APP_INTERNAL_ROOT_STATE_SUBSCRIPTION_TOKEN, CHILD_APP_INTERNAL_ACTION_TOKEN, CHILD_APP_INTERNAL_CONFIG_TOKEN, IS_CHILD_APP_DI_TOKEN, CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN, CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN, CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN, CHILD_APP_RESOLUTION_CONFIGS_TOKEN, CHILD_APP_RESOLVE_CONFIG_TOKEN, CHILD_APP_RESOLVE_BASE_URL_TOKEN, CHILD_APP_SINGLETON_DI_MANAGER_TOKEN, CHILD_APP_LOADER_TOKEN, CHILD_APP_DI_MANAGER_TOKEN, CHILD_APP_COMMAND_LINE_RUNNER_TOKEN, CHILD_APP_PRELOAD_MANAGER_TOKEN, CHILD_APP_RENDER_MANAGER_TOKEN, CHILD_APP_COMMON_INITIAL_STATE_TOKEN, CHILD_APP_INTERNAL_RENDER_TOKEN } from '@tramvai/tokens-child-app';
|
|
5
5
|
export * from '@tramvai/tokens-child-app';
|
|
6
|
-
import {
|
|
6
|
+
import { CONTEXT_TOKEN, ACTION_PAGE_RUNNER_TOKEN, LOGGER_TOKEN, DISPATCHER_TOKEN, STORE_TOKEN, DISPATCHER_CONTEXT_TOKEN, STORE_MIDDLEWARE, INITIAL_APP_STATE_TOKEN, COMBINE_REDUCERS, ENV_MANAGER_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, CLEAR_CACHE_TOKEN, ENV_USED_TOKEN } from '@tramvai/tokens-common';
|
|
7
7
|
import { RENDER_SLOTS, EXTEND_RENDER } from '@tramvai/tokens-render';
|
|
8
8
|
import { ROUTER_SPA_ACTIONS_RUN_MODE_TOKEN, PAGE_SERVICE_TOKEN, ROUTER_TOKEN } from '@tramvai/tokens-router';
|
|
9
9
|
import flatten from '@tinkoff/utils/array/flatten';
|
|
@@ -393,7 +393,7 @@ const resolveComponent = async (componentOrLoader) => {
|
|
|
393
393
|
};
|
|
394
394
|
|
|
395
395
|
class ChildAppResolutionConfigManager {
|
|
396
|
-
constructor({ configs }) {
|
|
396
|
+
constructor({ configs, }) {
|
|
397
397
|
this.hasInitialized = false;
|
|
398
398
|
this.rawConfigs = configs !== null && configs !== void 0 ? configs : [];
|
|
399
399
|
this.mapping = new Map();
|
package/lib/server.es.js
CHANGED
|
@@ -331,7 +331,7 @@ const resolveComponent = async (componentOrLoader) => {
|
|
|
331
331
|
};
|
|
332
332
|
|
|
333
333
|
class ChildAppResolutionConfigManager {
|
|
334
|
-
constructor({ configs }) {
|
|
334
|
+
constructor({ configs, }) {
|
|
335
335
|
this.hasInitialized = false;
|
|
336
336
|
this.rawConfigs = configs !== null && configs !== void 0 ? configs : [];
|
|
337
337
|
this.mapping = new Map();
|
|
@@ -803,11 +803,12 @@ class RenderManager {
|
|
|
803
803
|
|
|
804
804
|
const registerChildAppRenderSlots = ({ logger, diManager, resolveFullConfig, preloadManager, }) => {
|
|
805
805
|
const log = logger('child-app:render:slots');
|
|
806
|
-
|
|
806
|
+
const result = [];
|
|
807
|
+
preloadManager.getPreloadedList().forEach((requestConfig) => {
|
|
807
808
|
const config = resolveFullConfig(requestConfig);
|
|
808
809
|
const di = diManager.getChildDi(config);
|
|
809
810
|
if (!di) {
|
|
810
|
-
return
|
|
811
|
+
return;
|
|
811
812
|
}
|
|
812
813
|
const slots = [
|
|
813
814
|
{
|
|
@@ -841,8 +842,9 @@ const registerChildAppRenderSlots = ({ logger, diManager, resolveFullConfig, pre
|
|
|
841
842
|
config: requestConfig,
|
|
842
843
|
});
|
|
843
844
|
}
|
|
844
|
-
|
|
845
|
+
result.push(...slots);
|
|
845
846
|
});
|
|
847
|
+
return result;
|
|
846
848
|
};
|
|
847
849
|
|
|
848
850
|
const serverProviders = [
|
package/lib/server.js
CHANGED
|
@@ -340,7 +340,7 @@ const resolveComponent = async (componentOrLoader) => {
|
|
|
340
340
|
};
|
|
341
341
|
|
|
342
342
|
class ChildAppResolutionConfigManager {
|
|
343
|
-
constructor({ configs }) {
|
|
343
|
+
constructor({ configs, }) {
|
|
344
344
|
this.hasInitialized = false;
|
|
345
345
|
this.rawConfigs = configs !== null && configs !== void 0 ? configs : [];
|
|
346
346
|
this.mapping = new Map();
|
|
@@ -812,11 +812,12 @@ class RenderManager {
|
|
|
812
812
|
|
|
813
813
|
const registerChildAppRenderSlots = ({ logger, diManager, resolveFullConfig, preloadManager, }) => {
|
|
814
814
|
const log = logger('child-app:render:slots');
|
|
815
|
-
|
|
815
|
+
const result = [];
|
|
816
|
+
preloadManager.getPreloadedList().forEach((requestConfig) => {
|
|
816
817
|
const config = resolveFullConfig(requestConfig);
|
|
817
818
|
const di = diManager.getChildDi(config);
|
|
818
819
|
if (!di) {
|
|
819
|
-
return
|
|
820
|
+
return;
|
|
820
821
|
}
|
|
821
822
|
const slots = [
|
|
822
823
|
{
|
|
@@ -850,8 +851,9 @@ const registerChildAppRenderSlots = ({ logger, diManager, resolveFullConfig, pre
|
|
|
850
851
|
config: requestConfig,
|
|
851
852
|
});
|
|
852
853
|
}
|
|
853
|
-
|
|
854
|
+
result.push(...slots);
|
|
854
855
|
});
|
|
856
|
+
return result;
|
|
855
857
|
};
|
|
856
858
|
|
|
857
859
|
const serverProviders = [
|
package/lib/shared/render.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EXTEND_RENDER } from '@tramvai/tokens-render';
|
|
2
2
|
import type { ChildAppRenderManager } from '@tramvai/tokens-child-app';
|
|
3
|
+
import type { ExtractTokenType } from '@tinkoff/dippy';
|
|
3
4
|
export declare const extendRender: ({ renderManager, }: {
|
|
4
5
|
renderManager: ChildAppRenderManager;
|
|
5
|
-
}) => typeof EXTEND_RENDER
|
|
6
|
+
}) => ExtractTokenType<typeof EXTEND_RENDER>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ChildAppRequestConfig, CHILD_APP_RESOLUTION_CONFIGS_TOKEN, CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN, ResolutionConfig } from '@tramvai/tokens-child-app';
|
|
2
|
-
|
|
2
|
+
import type { ExtractDependencyType, ExtractTokenType } from '@tinkoff/dippy';
|
|
3
|
+
declare type Interface = ExtractTokenType<typeof CHILD_APP_RESOLUTION_CONFIG_MANAGER_TOKEN>;
|
|
3
4
|
export declare class ChildAppResolutionConfigManager implements Interface {
|
|
4
5
|
private rawConfigs;
|
|
5
6
|
private mapping;
|
|
6
7
|
private hasInitialized;
|
|
7
8
|
private initPromise;
|
|
8
|
-
constructor({ configs }: {
|
|
9
|
-
configs: typeof CHILD_APP_RESOLUTION_CONFIGS_TOKEN | null;
|
|
9
|
+
constructor({ configs, }: {
|
|
10
|
+
configs: ExtractDependencyType<typeof CHILD_APP_RESOLUTION_CONFIGS_TOKEN> | null;
|
|
10
11
|
});
|
|
11
12
|
init(): Promise<void>;
|
|
12
13
|
resolve({ name, version, tag }: ChildAppRequestConfig): ResolutionConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-child-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Module for child apps",
|
|
5
5
|
"browser": {
|
|
6
6
|
"./lib/server.js": "./lib/browser.js",
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
"@tinkoff/env-validators": "0.0.5",
|
|
32
32
|
"@tinkoff/module-loader-client": "0.3.28",
|
|
33
33
|
"@tinkoff/module-loader-server": "0.4.45",
|
|
34
|
-
"@tramvai/child-app-core": "2.
|
|
34
|
+
"@tramvai/child-app-core": "2.2.3",
|
|
35
35
|
"@tramvai/safe-strings": "0.4.5",
|
|
36
|
-
"@tramvai/tokens-child-app": "2.
|
|
36
|
+
"@tramvai/tokens-child-app": "2.2.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@tinkoff/dippy": "0.7.
|
|
40
|
+
"@tinkoff/dippy": "0.7.43",
|
|
41
41
|
"@tinkoff/utils": "^2.1.2",
|
|
42
|
-
"@tramvai/core": "2.
|
|
43
|
-
"@tramvai/state": "2.
|
|
44
|
-
"@tramvai/react": "2.
|
|
45
|
-
"@tramvai/tokens-common": "2.
|
|
46
|
-
"@tramvai/tokens-render": "2.
|
|
47
|
-
"@tramvai/tokens-router": "2.
|
|
42
|
+
"@tramvai/core": "2.2.3",
|
|
43
|
+
"@tramvai/state": "2.2.3",
|
|
44
|
+
"@tramvai/react": "2.2.3",
|
|
45
|
+
"@tramvai/tokens-common": "2.2.3",
|
|
46
|
+
"@tramvai/tokens-render": "2.2.3",
|
|
47
|
+
"@tramvai/tokens-router": "2.2.3",
|
|
48
48
|
"react": ">=16.14.0",
|
|
49
49
|
"react-dom": ">=16.14.0",
|
|
50
50
|
"object-assign": "^4.1.1",
|