@sima-land/isomorph 11.0.0-alpha.0 → 11.0.0-alpha.11
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/{dist/cache → cache}/types.d.ts +0 -0
- package/{dist/utils/webpack/module-federation → cache}/types.js +0 -0
- package/{dist/cache → cache}/types.js.map +0 -0
- package/{dist/config/index.d.ts → config/base.d.ts} +0 -0
- package/{dist/config/index.js → config/base.js} +1 -1
- package/config/base.js.map +1 -0
- package/{dist/config → config}/browser.d.ts +0 -0
- package/config/browser.js +22 -0
- package/config/browser.js.map +1 -0
- package/{dist/config → config}/node.d.ts +0 -0
- package/{dist/config → config}/node.js +10 -5
- package/config/node.js.map +1 -0
- package/{dist/config → config}/types.d.ts +0 -0
- package/{dist/tracer → config}/types.js +0 -0
- package/{dist/config → config}/types.js.map +0 -0
- package/di/application.d.ts +6 -0
- package/{dist/container → di}/application.js +17 -8
- package/di/application.js.map +1 -0
- package/di/container.d.ts +6 -0
- package/di/container.js +49 -0
- package/di/container.js.map +1 -0
- package/di/errors.d.ts +21 -0
- package/di/errors.js +33 -0
- package/di/errors.js.map +1 -0
- package/di/index.d.ts +6 -0
- package/di/index.js +16 -0
- package/di/index.js.map +1 -0
- package/di/preset.d.ts +9 -0
- package/di/preset.js +27 -0
- package/di/preset.js.map +1 -0
- package/di/token.d.ts +7 -0
- package/di/token.js +17 -0
- package/di/token.js.map +1 -0
- package/di/types.d.ts +32 -0
- package/{dist/saga-runner → di}/types.js +0 -0
- package/{dist/preset → di}/types.js.map +1 -1
- package/error-tracking/index.d.ts +22 -0
- package/{dist/error-tracker/utils.js → error-tracking/index.js} +14 -3
- package/error-tracking/index.js.map +1 -0
- package/error-tracking/types.d.ts +13 -0
- package/{dist/preset → error-tracking}/types.js +0 -0
- package/{dist/container → error-tracking}/types.js.map +1 -1
- package/{dist/http-client → http-client}/middleware/cookie.d.ts +0 -0
- package/{dist/http-client → http-client}/middleware/cookie.js +0 -0
- package/{dist/http-client → http-client}/middleware/cookie.js.map +0 -0
- package/http-client/middleware/logging.d.ts +15 -0
- package/http-client/middleware/logging.js +93 -0
- package/http-client/middleware/logging.js.map +1 -0
- package/{dist/http-client → http-client}/middleware/tracing.d.ts +0 -0
- package/{dist/http-client → http-client}/middleware/tracing.js +0 -0
- package/{dist/http-client → http-client}/middleware/tracing.js.map +0 -0
- package/{dist/http-client/utils.d.ts → http-client/sauce/index.d.ts} +0 -9
- package/{dist/http-client/utils.js → http-client/sauce/index.js} +2 -18
- package/http-client/sauce/index.js.map +1 -0
- package/{dist/http-client → http-client}/types.d.ts +0 -0
- package/{dist/logger → http-client}/types.js +0 -0
- package/{dist/http-client → http-client}/types.js.map +0 -0
- package/http-client/utils.d.ts +9 -0
- package/http-client/utils.js +20 -0
- package/http-client/utils.js.map +1 -0
- package/{dist/http-server → http-server}/constants.d.ts +0 -0
- package/{dist/http-server → http-server}/constants.js +0 -0
- package/{dist/http-server → http-server}/constants.js.map +0 -0
- package/{dist/http-server → http-server}/handler/health-check.d.ts +0 -0
- package/{dist/http-server → http-server}/handler/health-check.js +0 -0
- package/{dist/http-server → http-server}/handler/health-check.js.map +0 -0
- package/{dist/http-server → http-server}/middleware/logging.d.ts +0 -0
- package/{dist/http-server → http-server}/middleware/logging.js +0 -0
- package/{dist/http-server → http-server}/middleware/logging.js.map +0 -0
- package/{dist/http-server → http-server}/middleware/metrics.d.ts +0 -0
- package/{dist/http-server → http-server}/middleware/metrics.js +0 -0
- package/{dist/http-server → http-server}/middleware/metrics.js.map +0 -0
- package/http-server/middleware/tracing.d.ts +14 -0
- package/{dist/http-server → http-server}/middleware/tracing.js +22 -3
- package/http-server/middleware/tracing.js.map +1 -0
- package/http-server/template/index.d.ts +1 -0
- package/http-server/template/index.js +36 -0
- package/http-server/template/index.js.map +1 -0
- package/{dist/http-server → http-server}/types.d.ts +8 -0
- package/{dist/http-server → http-server}/types.js +0 -0
- package/{dist/http-server → http-server}/types.js.map +0 -0
- package/{dist/http-server → http-server}/utils.d.ts +5 -1
- package/{dist/http-server → http-server}/utils.js +16 -4
- package/http-server/utils.js.map +1 -0
- package/{dist/logger → logger}/handler/console.d.ts +1 -1
- package/{dist/logger → logger}/handler/console.js +8 -1
- package/logger/handler/console.js.map +1 -0
- package/logger/handler/sentry.d.ts +8 -0
- package/{dist/logger → logger}/handler/sentry.js +13 -7
- package/logger/handler/sentry.js.map +1 -0
- package/logger/index.d.ts +2 -0
- package/logger/index.js +6 -0
- package/logger/index.js.map +1 -0
- package/{dist/logger/index.d.ts → logger/logger.d.ts} +0 -0
- package/{dist/logger/index.js → logger/logger.js} +1 -1
- package/logger/logger.js.map +1 -0
- package/{dist/logger → logger}/types.d.ts +0 -0
- package/{dist/http-client → logger}/types.js +0 -0
- package/{dist/logger → logger}/types.js.map +0 -0
- package/{dist/metrics → metrics}/constants.d.ts +0 -0
- package/{dist/metrics → metrics}/constants.js +0 -0
- package/{dist/metrics → metrics}/constants.js.map +0 -0
- package/{dist/metrics → metrics}/node.d.ts +0 -0
- package/{dist/metrics → metrics}/node.js +0 -0
- package/{dist/metrics → metrics}/node.js.map +0 -0
- package/package.json +8 -11
- package/preset/browser/index.d.ts +8 -0
- package/preset/browser/index.js +48 -0
- package/preset/browser/index.js.map +1 -0
- package/preset/node/index.d.ts +19 -0
- package/preset/node/index.js +127 -0
- package/preset/node/index.js.map +1 -0
- package/preset/node/response.d.ts +20 -0
- package/preset/node/response.js +82 -0
- package/preset/node/response.js.map +1 -0
- package/tokens.d.ts +48 -0
- package/tokens.js +50 -0
- package/tokens.js.map +1 -0
- package/tracing/index.d.ts +9 -0
- package/tracing/index.js +20 -0
- package/tracing/index.js.map +1 -0
- package/{dist/utils → utils}/browser/analytics/data-layer.d.ts +0 -0
- package/{dist/utils → utils}/browser/analytics/data-layer.js +0 -0
- package/{dist/utils → utils}/browser/analytics/data-layer.js.map +0 -0
- package/{dist/utils → utils}/browser/analytics/oko.d.ts +0 -0
- package/{dist/utils → utils}/browser/analytics/oko.js +0 -0
- package/{dist/utils → utils}/browser/analytics/oko.js.map +0 -0
- package/{dist/utils → utils}/browser/storage/index.d.ts +0 -0
- package/{dist/utils → utils}/browser/storage/index.js +0 -0
- package/{dist/utils → utils}/browser/storage/index.js.map +0 -0
- package/{dist/utils → utils}/number.d.ts +0 -0
- package/{dist/utils → utils}/number.js +0 -0
- package/{dist/utils → utils}/number.js.map +0 -0
- package/{dist/utils → utils}/react/error-handlers/index.d.ts +0 -0
- package/{dist/utils → utils}/react/error-handlers/index.js +1 -0
- package/utils/react/error-handlers/index.js.map +1 -0
- package/{dist/utils → utils}/redux/remote-data.d.ts +0 -0
- package/{dist/utils → utils}/redux/remote-data.js +0 -0
- package/{dist/utils → utils}/redux/remote-data.js.map +0 -0
- package/utils/redux-saga/index.d.ts +3 -0
- package/utils/redux-saga/index.js +8 -0
- package/utils/redux-saga/index.js.map +1 -0
- package/utils/redux-saga/middleware.d.ts +9 -0
- package/utils/redux-saga/middleware.js +87 -0
- package/utils/redux-saga/middleware.js.map +1 -0
- package/{dist/utils → utils}/redux-saga/take-chain.d.ts +0 -0
- package/{dist/utils → utils}/redux-saga/take-chain.js +0 -0
- package/{dist/utils → utils}/redux-saga/take-chain.js.map +0 -0
- package/utils/redux-saga/types.d.ts +6 -0
- package/{dist/error-tracker → utils/redux-saga}/types.js +0 -0
- package/{dist/error-tracker → utils/redux-saga}/types.js.map +1 -1
- package/utils/ssr/index.d.ts +30 -0
- package/utils/ssr/index.js +51 -0
- package/utils/ssr/index.js.map +1 -0
- package/utils/webpack/index.d.ts +23 -0
- package/utils/webpack/index.js +66 -0
- package/utils/webpack/index.js.map +1 -0
- package/{dist/utils → utils}/webpack/module-federation/index.d.ts +0 -0
- package/{dist/utils → utils}/webpack/module-federation/index.js +0 -0
- package/{dist/utils → utils}/webpack/module-federation/index.js.map +0 -0
- package/{dist/utils → utils}/webpack/module-federation/types.d.ts +0 -0
- package/{dist/container → utils/webpack/module-federation}/types.js +0 -0
- package/{dist/utils → utils}/webpack/module-federation/types.js.map +0 -0
- package/{dist/utils → utils}/webpack/module-federation/utils.d.ts +0 -0
- package/{dist/utils → utils}/webpack/module-federation/utils.js +0 -0
- package/{dist/utils → utils}/webpack/module-federation/utils.js.map +0 -0
- package/LICENSE +0 -201
- package/dist/cache/types.js +0 -3
- package/dist/config/browser.js +0 -13
- package/dist/config/browser.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/node.js.map +0 -1
- package/dist/config/types.js +0 -3
- package/dist/config/utils.d.ts +0 -5
- package/dist/config/utils.js +0 -12
- package/dist/config/utils.js.map +0 -1
- package/dist/container/application.d.ts +0 -25
- package/dist/container/application.js.map +0 -1
- package/dist/container/index.d.ts +0 -18
- package/dist/container/index.js +0 -74
- package/dist/container/index.js.map +0 -1
- package/dist/container/types.d.ts +0 -14
- package/dist/error-tracker/browser.d.ts +0 -8
- package/dist/error-tracker/browser.js +0 -40
- package/dist/error-tracker/browser.js.map +0 -1
- package/dist/error-tracker/node.d.ts +0 -8
- package/dist/error-tracker/node.js +0 -40
- package/dist/error-tracker/node.js.map +0 -1
- package/dist/error-tracker/types.d.ts +0 -18
- package/dist/error-tracker/utils.d.ts +0 -12
- package/dist/error-tracker/utils.js.map +0 -1
- package/dist/http-client/utils.js.map +0 -1
- package/dist/http-server/middleware/tracing.d.ts +0 -8
- package/dist/http-server/middleware/tracing.js.map +0 -1
- package/dist/http-server/utils.js.map +0 -1
- package/dist/logger/handler/console.js.map +0 -1
- package/dist/logger/handler/sentry.d.ts +0 -8
- package/dist/logger/handler/sentry.js.map +0 -1
- package/dist/logger/index.js.map +0 -1
- package/dist/preset/index.d.ts +0 -7
- package/dist/preset/index.js +0 -23
- package/dist/preset/index.js.map +0 -1
- package/dist/preset/node/index.d.ts +0 -15
- package/dist/preset/node/index.js +0 -90
- package/dist/preset/node/index.js.map +0 -1
- package/dist/preset/node/response.d.ts +0 -12
- package/dist/preset/node/response.js +0 -52
- package/dist/preset/node/response.js.map +0 -1
- package/dist/preset/types.d.ts +0 -7
- package/dist/saga-runner/index.d.ts +0 -8
- package/dist/saga-runner/index.js +0 -77
- package/dist/saga-runner/index.js.map +0 -1
- package/dist/saga-runner/types.d.ts +0 -10
- package/dist/saga-runner/types.js.map +0 -1
- package/dist/tokens.d.ts +0 -40
- package/dist/tokens.js +0 -43
- package/dist/tokens.js.map +0 -1
- package/dist/tracer/node.d.ts +0 -10
- package/dist/tracer/node.js +0 -38
- package/dist/tracer/node.js.map +0 -1
- package/dist/tracer/types.d.ts +0 -2
- package/dist/tracer/types.js.map +0 -1
- package/dist/utils/react/error-handlers/index.js.map +0 -1
- package/readme.md +0 -23
- package/src/cache/types.ts +0 -7
- package/src/config/browser.ts +0 -10
- package/src/config/index.ts +0 -18
- package/src/config/node.ts +0 -18
- package/src/config/types.ts +0 -9
- package/src/config/utils.ts +0 -7
- package/src/container/application.ts +0 -91
- package/src/container/index.ts +0 -79
- package/src/container/types.ts +0 -17
- package/src/error-tracker/browser.ts +0 -14
- package/src/error-tracker/node.ts +0 -14
- package/src/error-tracker/types.ts +0 -22
- package/src/error-tracker/utils.ts +0 -18
- package/src/http-client/middleware/cookie.ts +0 -73
- package/src/http-client/middleware/tracing.ts +0 -79
- package/src/http-client/types.ts +0 -8
- package/src/http-client/utils.ts +0 -76
- package/src/http-server/constants.ts +0 -4
- package/src/http-server/handler/health-check.ts +0 -13
- package/src/http-server/middleware/logging.ts +0 -34
- package/src/http-server/middleware/metrics.ts +0 -87
- package/src/http-server/middleware/tracing.ts +0 -35
- package/src/http-server/types.ts +0 -29
- package/src/http-server/utils.ts +0 -105
- package/src/logger/handler/console.ts +0 -35
- package/src/logger/handler/sentry.ts +0 -38
- package/src/logger/index.ts +0 -31
- package/src/logger/types.ts +0 -28
- package/src/metrics/constants.ts +0 -4
- package/src/metrics/node.ts +0 -54
- package/src/preset/index.ts +0 -24
- package/src/preset/node/index.ts +0 -101
- package/src/preset/node/response.ts +0 -57
- package/src/preset/types.ts +0 -9
- package/src/saga-runner/index.ts +0 -59
- package/src/saga-runner/types.ts +0 -13
- package/src/tokens.ts +0 -54
- package/src/tracer/node.ts +0 -40
- package/src/tracer/types.ts +0 -3
- package/src/utils/browser/analytics/__test__/data-layer.test.ts +0 -50
- package/src/utils/browser/analytics/__test__/oko.test.tsx +0 -143
- package/src/utils/browser/analytics/data-layer.ts +0 -12
- package/src/utils/browser/analytics/oko.ts +0 -44
- package/src/utils/browser/storage/index.ts +0 -75
- package/src/utils/number.ts +0 -8
- package/src/utils/react/error-handlers/__test__/__snapshots__/index.test.tsx.snap +0 -27
- package/src/utils/react/error-handlers/__test__/index.test.tsx +0 -64
- package/src/utils/react/error-handlers/index.tsx +0 -62
- package/src/utils/redux/__test__/remote-data.test.ts +0 -50
- package/src/utils/redux/remote-data.ts +0 -34
- package/src/utils/redux-saga/__test__/take-chain.test.ts +0 -141
- package/src/utils/redux-saga/take-chain.ts +0 -65
- package/src/utils/webpack/module-federation/__test__/index.test.ts +0 -246
- package/src/utils/webpack/module-federation/index.ts +0 -92
- package/src/utils/webpack/module-federation/types.ts +0 -44
- package/src/utils/webpack/module-federation/utils.ts +0 -43
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { createRemoteDataReducers, RemoteDataState, STATUS } from '../remote-data';
|
|
3
|
-
|
|
4
|
-
interface TestState extends RemoteDataState<number, string> {
|
|
5
|
-
foo: 'bar';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
describe('createGenericSlice', () => {
|
|
9
|
-
const initialState: TestState = {
|
|
10
|
-
data: 0,
|
|
11
|
-
error: '',
|
|
12
|
-
status: STATUS.initial,
|
|
13
|
-
foo: 'bar',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const { reducer, actions } = createSlice({
|
|
17
|
-
name: 'user',
|
|
18
|
-
initialState,
|
|
19
|
-
reducers: createRemoteDataReducers<TestState>(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should handle request action', () => {
|
|
23
|
-
const actual = reducer(initialState, actions.request());
|
|
24
|
-
|
|
25
|
-
expect(actual).toEqual({
|
|
26
|
-
...initialState,
|
|
27
|
-
status: STATUS.fetching,
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should handle success action', () => {
|
|
32
|
-
const actual = reducer(initialState, actions.success(234));
|
|
33
|
-
|
|
34
|
-
expect(actual).toEqual({
|
|
35
|
-
...initialState,
|
|
36
|
-
data: 234,
|
|
37
|
-
status: STATUS.success,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should handle failure action', () => {
|
|
42
|
-
const actual = reducer(initialState, actions.failure('error message here'));
|
|
43
|
-
|
|
44
|
-
expect(actual).toEqual({
|
|
45
|
-
...initialState,
|
|
46
|
-
error: 'error message here',
|
|
47
|
-
status: STATUS.failure,
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { PayloadAction, Draft } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
3
|
-
export type Status = 'initial' | 'fetching' | 'success' | 'failure';
|
|
4
|
-
|
|
5
|
-
export interface RemoteDataState<TData, TError> {
|
|
6
|
-
data: TData;
|
|
7
|
-
error: TError;
|
|
8
|
-
status: Status;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const STATUS: Record<Status, Status> = {
|
|
12
|
-
initial: 'initial',
|
|
13
|
-
fetching: 'fetching',
|
|
14
|
-
success: 'success',
|
|
15
|
-
failure: 'failure',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Возвращает набор обработчиков для работы с удаленными данными.
|
|
20
|
-
* @return Набор.
|
|
21
|
-
*/
|
|
22
|
-
export const createRemoteDataReducers = <S extends RemoteDataState<any, any>>() => ({
|
|
23
|
-
request: (state: Draft<S>) => {
|
|
24
|
-
state.status = STATUS.fetching;
|
|
25
|
-
},
|
|
26
|
-
success: (state: Draft<S>, action: PayloadAction<S['data']>) => {
|
|
27
|
-
state.data = action.payload;
|
|
28
|
-
state.status = STATUS.success;
|
|
29
|
-
},
|
|
30
|
-
failure: (state: Draft<S>, action: PayloadAction<S['error']>) => {
|
|
31
|
-
state.error = action.payload;
|
|
32
|
-
state.status = STATUS.failure;
|
|
33
|
-
},
|
|
34
|
-
});
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { delay, fork, put, race, take } from 'redux-saga/effects';
|
|
2
|
-
import { generateTakeChain, putDelayed, takeChain } from '../take-chain';
|
|
3
|
-
|
|
4
|
-
const SettlementTypes = {
|
|
5
|
-
UPDATE: 'settlement',
|
|
6
|
-
REMOVE: 'settlement',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
describe('takeChain', () => {
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
jest.spyOn(Date, 'now').mockImplementation(() => 123);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const testTypes = [SettlementTypes.UPDATE, SettlementTypes.REMOVE];
|
|
15
|
-
const timeout = 100;
|
|
16
|
-
const testTask = jest.fn();
|
|
17
|
-
const deps: [string, number] = ['John', 23];
|
|
18
|
-
|
|
19
|
-
it('generateTakeChain few actions', () => {
|
|
20
|
-
const gen = generateTakeChain(timeout, testTypes, testTask, deps);
|
|
21
|
-
|
|
22
|
-
expect(gen.next().value).toEqual(take(testTypes));
|
|
23
|
-
|
|
24
|
-
expect(gen.next({ type: SettlementTypes.REMOVE.toString() }).value).toEqual(
|
|
25
|
-
fork(putDelayed, timeout, { type: 'BREAK_123' }),
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
expect(gen.next().value).toEqual(
|
|
29
|
-
race({
|
|
30
|
-
action: take(testTypes),
|
|
31
|
-
canceled: take('BREAK_123'),
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
34
|
-
expect(
|
|
35
|
-
gen.next({
|
|
36
|
-
action: { type: SettlementTypes.UPDATE.toString() },
|
|
37
|
-
canceled: { type: 'BREAK_123' },
|
|
38
|
-
}).value,
|
|
39
|
-
).toEqual(
|
|
40
|
-
fork(testTask, ...deps, [
|
|
41
|
-
{ type: SettlementTypes.REMOVE.toString() },
|
|
42
|
-
{ type: SettlementTypes.UPDATE.toString() },
|
|
43
|
-
]),
|
|
44
|
-
);
|
|
45
|
-
expect(gen.next()).toBeTruthy();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('generateTakeChain one action', () => {
|
|
49
|
-
const gen = generateTakeChain(timeout, testTypes, testTask, deps);
|
|
50
|
-
|
|
51
|
-
expect(gen.next().value).toEqual(take(testTypes));
|
|
52
|
-
|
|
53
|
-
expect(gen.next({ type: 'settlement/REMOVE' }).value).toEqual(
|
|
54
|
-
fork(putDelayed, timeout, { type: 'BREAK_123' }),
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
expect(gen.next().value).toEqual(
|
|
58
|
-
race({
|
|
59
|
-
action: take(testTypes),
|
|
60
|
-
canceled: take('BREAK_123'),
|
|
61
|
-
}),
|
|
62
|
-
);
|
|
63
|
-
expect(
|
|
64
|
-
gen.next({
|
|
65
|
-
action: undefined,
|
|
66
|
-
canceled: { type: 'BREAK_123' },
|
|
67
|
-
}).value,
|
|
68
|
-
).toEqual(fork(testTask, ...deps, [{ type: 'settlement/REMOVE' }]));
|
|
69
|
-
expect(gen.next()).toBeTruthy();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('generateTakeChain without canceled', () => {
|
|
73
|
-
const gen = generateTakeChain(timeout, testTypes, testTask, deps);
|
|
74
|
-
|
|
75
|
-
expect(gen.next().value).toEqual(take(testTypes));
|
|
76
|
-
|
|
77
|
-
expect(gen.next({ type: 'settlement/REMOVE' }).value).toEqual(
|
|
78
|
-
fork(putDelayed, timeout, { type: 'BREAK_123' }),
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
expect(gen.next().value).toEqual(
|
|
82
|
-
race({
|
|
83
|
-
action: take(testTypes),
|
|
84
|
-
canceled: take('BREAK_123'),
|
|
85
|
-
}),
|
|
86
|
-
);
|
|
87
|
-
expect(
|
|
88
|
-
gen.next({
|
|
89
|
-
action: undefined,
|
|
90
|
-
canceled: undefined,
|
|
91
|
-
}).value,
|
|
92
|
-
).toBeTruthy();
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('generateTakeChain when puts all actions and have not canceled', () => {
|
|
96
|
-
const gen = generateTakeChain(timeout, testTypes, testTask, deps);
|
|
97
|
-
|
|
98
|
-
expect(gen.next().value).toEqual(take(testTypes));
|
|
99
|
-
|
|
100
|
-
expect(gen.next({ type: SettlementTypes.REMOVE.toString() }).value).toEqual(
|
|
101
|
-
fork(putDelayed, timeout, { type: 'BREAK_123' }),
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
expect(gen.next().value).toEqual(
|
|
105
|
-
race({
|
|
106
|
-
action: take(testTypes),
|
|
107
|
-
canceled: take('BREAK_123'),
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
expect(
|
|
112
|
-
gen.next({
|
|
113
|
-
action: { type: SettlementTypes.UPDATE.toString() },
|
|
114
|
-
canceled: undefined,
|
|
115
|
-
}).value,
|
|
116
|
-
).toEqual(
|
|
117
|
-
fork(testTask, ...deps, [
|
|
118
|
-
{ type: SettlementTypes.REMOVE.toString() },
|
|
119
|
-
{ type: SettlementTypes.UPDATE.toString() },
|
|
120
|
-
]),
|
|
121
|
-
);
|
|
122
|
-
expect(gen.next()).toBeTruthy();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('should fork generateTakeChain', () => {
|
|
126
|
-
const fakeTakeChain = takeChain(timeout, testTypes, testTask, ...deps);
|
|
127
|
-
|
|
128
|
-
expect(fakeTakeChain).toEqual(fork(generateTakeChain, timeout, testTypes, testTask, deps));
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
describe('putDelayed', () => {
|
|
133
|
-
it('should works properly', () => {
|
|
134
|
-
const gen = putDelayed(10, { type: 'test' });
|
|
135
|
-
|
|
136
|
-
expect(gen.next().value).toEqual(delay(10));
|
|
137
|
-
expect(gen.next().value).toEqual(put({ type: 'test' }));
|
|
138
|
-
|
|
139
|
-
expect(gen.next()).toBeTruthy();
|
|
140
|
-
});
|
|
141
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Action } from '@reduxjs/toolkit';
|
|
2
|
-
import { delay, fork, put, race, take } from 'redux-saga/effects';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Накапливает экшены и генерирует эффект по таймауту.
|
|
6
|
-
* @param timeout Время задержки в мс.
|
|
7
|
-
* @param types Массив с типами ожидаемых экшенов.
|
|
8
|
-
* @param task Генератор.
|
|
9
|
-
* @param deps Аргументы для генератора.
|
|
10
|
-
* @return Эффект.
|
|
11
|
-
*/
|
|
12
|
-
export function takeChain<
|
|
13
|
-
Deps extends any[],
|
|
14
|
-
Task extends (...someArgs: [...Deps, Action[]]) => any,
|
|
15
|
-
>(timeout: number, types: string[], task: Task, ...deps: Deps) {
|
|
16
|
-
return fork(generateTakeChain as any, timeout, types, task, deps);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Генерирует эффект по таймауту.
|
|
21
|
-
* @param timeout Время задержки в мс.
|
|
22
|
-
* @param types Массив с типами ожидаемых экшенов.
|
|
23
|
-
* @param task Генератор.
|
|
24
|
-
* @param deps Аргументы для генератора.
|
|
25
|
-
*/
|
|
26
|
-
export function* generateTakeChain<
|
|
27
|
-
Deps extends any[],
|
|
28
|
-
Task extends (...someArgs: [...Deps, Action[]]) => any,
|
|
29
|
-
>(timeout: number, types: string[], task: Task, deps: Deps): Generator<any, void, any> {
|
|
30
|
-
while (true) {
|
|
31
|
-
const breakAction: Action = { type: `BREAK_${Date.now()}` };
|
|
32
|
-
const firstAction: Action = yield take(types);
|
|
33
|
-
const collectedActions = [firstAction];
|
|
34
|
-
|
|
35
|
-
yield fork(putDelayed, timeout, breakAction);
|
|
36
|
-
|
|
37
|
-
while (true) {
|
|
38
|
-
const { action, canceled } = yield race({
|
|
39
|
-
action: take(types),
|
|
40
|
-
canceled: take(breakAction.type),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
action && collectedActions.push(action);
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
canceled ||
|
|
47
|
-
types.every(type => collectedActions.some(someAction => someAction.type === type))
|
|
48
|
-
) {
|
|
49
|
-
// @todo убрать "as any"
|
|
50
|
-
yield fork(task as any, ...deps, collectedActions);
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Вызывает экшен с заданной задержкой.
|
|
59
|
-
* @param timeout Время задержки в мс.
|
|
60
|
-
* @param action Тип экшена.
|
|
61
|
-
*/
|
|
62
|
-
export function* putDelayed(timeout: number, action: Action) {
|
|
63
|
-
yield delay(timeout);
|
|
64
|
-
yield put(action);
|
|
65
|
-
}
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { container, Compiler } from 'webpack';
|
|
2
|
-
import { LIBRARY_ERROR_TEXT, ModuleFederationPlugin, REMOTE_ERROR_TEXT } from '..';
|
|
3
|
-
|
|
4
|
-
jest.mock('../utils', () => ({
|
|
5
|
-
createExternalConfig: jest.fn(arg => arg),
|
|
6
|
-
}));
|
|
7
|
-
|
|
8
|
-
jest.mock('webpack', () => {
|
|
9
|
-
class ModuleFederationPluginMock {
|
|
10
|
-
static __spy__ = { constructor: jest.fn(), apply: jest.fn() };
|
|
11
|
-
|
|
12
|
-
constructor(...args: any[]) {
|
|
13
|
-
ModuleFederationPluginMock.__spy__.constructor(...args);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
apply(...args: any[]) {
|
|
17
|
-
ModuleFederationPluginMock.__spy__.apply(...args);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
container: {
|
|
23
|
-
ModuleFederationPlugin: ModuleFederationPluginMock,
|
|
24
|
-
},
|
|
25
|
-
WebpackError: class extends Error {},
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
function getSpy(value: any): { constructor: jest.Mock; apply: jest.Mock } {
|
|
30
|
-
return value.__spy__;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
beforeEach(() => {
|
|
34
|
-
getSpy(container.ModuleFederationPlugin).constructor.mockClear();
|
|
35
|
-
getSpy(container.ModuleFederationPlugin).apply.mockClear();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('ModuleFederationPlugin', () => {
|
|
39
|
-
function createCompilerMock(): Compiler {
|
|
40
|
-
return {
|
|
41
|
-
hooks: {
|
|
42
|
-
environment: {
|
|
43
|
-
tap: jest.fn((name, cb) => cb()),
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
} as any;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
describe('ModuleFederationPlugin instance', () => {
|
|
50
|
-
it('should apply original plugin', () => {
|
|
51
|
-
const compiler = createCompilerMock();
|
|
52
|
-
const instance = new ModuleFederationPlugin({ name: 'test-module' });
|
|
53
|
-
|
|
54
|
-
expect(getSpy(container.ModuleFederationPlugin).apply).toBeCalledTimes(0);
|
|
55
|
-
|
|
56
|
-
instance.apply(compiler);
|
|
57
|
-
|
|
58
|
-
expect(getSpy(container.ModuleFederationPlugin).apply).toBeCalledTimes(1);
|
|
59
|
-
expect(getSpy(container.ModuleFederationPlugin).apply).toBeCalledWith(compiler);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should not creat and throw error, if library property pass to plugin', () => {
|
|
63
|
-
expect(() => {
|
|
64
|
-
new ModuleFederationPlugin({ library: 'test' } as any);
|
|
65
|
-
}).toThrowError(LIBRARY_ERROR_TEXT);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should not creat and throw error, if remotes property incorrect', () => {
|
|
69
|
-
expect(() => {
|
|
70
|
-
new ModuleFederationPlugin({ remotes: { remoteOne: {} } } as any);
|
|
71
|
-
}).toThrowError(REMOTE_ERROR_TEXT);
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
describe('ModuleFederationPlugin instance should create with correct arguments', () => {
|
|
76
|
-
it('for remotes', () => {
|
|
77
|
-
const compiler = createCompilerMock();
|
|
78
|
-
const instance = new ModuleFederationPlugin({
|
|
79
|
-
name: 'service-name',
|
|
80
|
-
remotes: {
|
|
81
|
-
firstRemote: 'first-remote-service',
|
|
82
|
-
secondRemote: 'second-remote-service',
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
instance.apply(compiler);
|
|
87
|
-
|
|
88
|
-
expect(getSpy(container.ModuleFederationPlugin).constructor).toBeCalledWith({
|
|
89
|
-
name: 'service-name',
|
|
90
|
-
library: {
|
|
91
|
-
type: 'global',
|
|
92
|
-
name: ['__FederationContainers__', 'service-name'],
|
|
93
|
-
},
|
|
94
|
-
remotes: {
|
|
95
|
-
firstRemote: {
|
|
96
|
-
external: {
|
|
97
|
-
serviceName: 'first-remote-service',
|
|
98
|
-
remoteEntriesGlobalKey: '__RemoteEntriesList__',
|
|
99
|
-
containersGlobalKey: '__FederationContainers__',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
secondRemote: {
|
|
103
|
-
external: {
|
|
104
|
-
serviceName: 'second-remote-service',
|
|
105
|
-
remoteEntriesGlobalKey: '__RemoteEntriesList__',
|
|
106
|
-
containersGlobalKey: '__FederationContainers__',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('for remotes with custom global variables name', () => {
|
|
114
|
-
const compiler = createCompilerMock();
|
|
115
|
-
const instance = new ModuleFederationPlugin({
|
|
116
|
-
name: 'service-name',
|
|
117
|
-
remotes: {
|
|
118
|
-
firstRemote: 'first-remote-service',
|
|
119
|
-
secondRemote: 'second-remote-service',
|
|
120
|
-
},
|
|
121
|
-
remoteEntriesGlobalKey: 'remotes-entry-key',
|
|
122
|
-
containersGlobalKey: 'containers-key',
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
instance.apply(compiler);
|
|
126
|
-
expect(getSpy(container.ModuleFederationPlugin).constructor).toBeCalledWith({
|
|
127
|
-
name: 'service-name',
|
|
128
|
-
library: {
|
|
129
|
-
type: 'global',
|
|
130
|
-
name: ['containers-key', 'service-name'],
|
|
131
|
-
},
|
|
132
|
-
remotes: {
|
|
133
|
-
firstRemote: {
|
|
134
|
-
external: {
|
|
135
|
-
serviceName: 'first-remote-service',
|
|
136
|
-
remoteEntriesGlobalKey: 'remotes-entry-key',
|
|
137
|
-
containersGlobalKey: 'containers-key',
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
secondRemote: {
|
|
141
|
-
external: {
|
|
142
|
-
serviceName: 'second-remote-service',
|
|
143
|
-
remoteEntriesGlobalKey: 'remotes-entry-key',
|
|
144
|
-
containersGlobalKey: 'containers-key',
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('for various remote type', () => {
|
|
152
|
-
const compiler = createCompilerMock();
|
|
153
|
-
|
|
154
|
-
const instance = new ModuleFederationPlugin({
|
|
155
|
-
name: 'service-name',
|
|
156
|
-
remotes: {
|
|
157
|
-
firstRemote: 'first-remote-service',
|
|
158
|
-
secondRemote: {
|
|
159
|
-
name: 'second-remote-service',
|
|
160
|
-
},
|
|
161
|
-
thirdRemote: {
|
|
162
|
-
name: 'third-remote-service',
|
|
163
|
-
remoteEntryPath: '//example.com/path/to/RemoteEntry.js',
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
instance.apply(compiler);
|
|
169
|
-
expect(getSpy(container.ModuleFederationPlugin).constructor).toBeCalledWith({
|
|
170
|
-
name: 'service-name',
|
|
171
|
-
library: {
|
|
172
|
-
type: 'global',
|
|
173
|
-
name: ['__FederationContainers__', 'service-name'],
|
|
174
|
-
},
|
|
175
|
-
remotes: {
|
|
176
|
-
firstRemote: {
|
|
177
|
-
external: {
|
|
178
|
-
serviceName: 'first-remote-service',
|
|
179
|
-
remoteEntriesGlobalKey: '__RemoteEntriesList__',
|
|
180
|
-
containersGlobalKey: '__FederationContainers__',
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
secondRemote: {
|
|
184
|
-
external: {
|
|
185
|
-
serviceName: 'second-remote-service',
|
|
186
|
-
remoteEntriesGlobalKey: '__RemoteEntriesList__',
|
|
187
|
-
containersGlobalKey: '__FederationContainers__',
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
thirdRemote: {
|
|
191
|
-
external: {
|
|
192
|
-
serviceName: 'third-remote-service',
|
|
193
|
-
remoteEntriesGlobalKey: '__RemoteEntriesList__',
|
|
194
|
-
containersGlobalKey: '__FederationContainers__',
|
|
195
|
-
remoteEntryPath: '//example.com/path/to/RemoteEntry.js',
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
it('for exposes', () => {
|
|
203
|
-
const compiler = createCompilerMock();
|
|
204
|
-
|
|
205
|
-
const instance = new ModuleFederationPlugin({
|
|
206
|
-
name: 'service-name',
|
|
207
|
-
filename: 'path/to/RemoteEntry.js',
|
|
208
|
-
exposes: {
|
|
209
|
-
'./One': './path/to/one.js',
|
|
210
|
-
'./Two': './path/to/two.js',
|
|
211
|
-
},
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
instance.apply(compiler);
|
|
215
|
-
expect(getSpy(container.ModuleFederationPlugin).constructor).toBeCalledWith({
|
|
216
|
-
name: 'service-name',
|
|
217
|
-
filename: 'path/to/RemoteEntry.js',
|
|
218
|
-
library: {
|
|
219
|
-
type: 'global',
|
|
220
|
-
name: ['__FederationContainers__', 'service-name'],
|
|
221
|
-
},
|
|
222
|
-
exposes: {
|
|
223
|
-
'./One': './path/to/one.js',
|
|
224
|
-
'./Two': './path/to/two.js',
|
|
225
|
-
},
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('for several call "apply" method', () => {
|
|
230
|
-
const compiler = createCompilerMock();
|
|
231
|
-
|
|
232
|
-
const instance = new ModuleFederationPlugin({
|
|
233
|
-
name: 'service-name',
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
instance.apply(compiler);
|
|
237
|
-
instance.apply(compiler);
|
|
238
|
-
|
|
239
|
-
const calls = getSpy(container.ModuleFederationPlugin).constructor.mock.calls;
|
|
240
|
-
|
|
241
|
-
for (const key of Object.keys(calls[0][0])) {
|
|
242
|
-
expect(calls[1][0][key] === calls[0][0][key]).toBe(true);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { ModuleFederationPluginOptions, ReadyOptions } from './types';
|
|
2
|
-
import { container, Compiler, WebpackError } from 'webpack';
|
|
3
|
-
import { createExternalConfig } from './utils';
|
|
4
|
-
|
|
5
|
-
export const LIBRARY_ERROR_TEXT = [
|
|
6
|
-
'Property "library" set internally as "global" and not overridden.',
|
|
7
|
-
'For override global variable name use "containersGlobalKey" property.',
|
|
8
|
-
'For override "library" type use ModuleFederationPlugin.',
|
|
9
|
-
].join(' ');
|
|
10
|
-
|
|
11
|
-
export const REMOTE_ERROR_TEXT = [
|
|
12
|
-
'The value of the remote element must be a string,',
|
|
13
|
-
'or an object with field "name" for dynamic resolution of "remoteEntry".',
|
|
14
|
-
'Set "remoteEntryPath" field to object for a static path to "remoteEntry".',
|
|
15
|
-
].join(' ');
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Создает плагин ModuleFederation с опциями, необходимыми для оркестрации удаленных модулей в браузере.
|
|
19
|
-
*/
|
|
20
|
-
export class ModuleFederationPlugin {
|
|
21
|
-
/**
|
|
22
|
-
* Проверенные, готовые опции.
|
|
23
|
-
*/
|
|
24
|
-
readonly readyOptions: ReadyOptions;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param options Опции.
|
|
28
|
-
*/
|
|
29
|
-
constructor(options: ModuleFederationPluginOptions) {
|
|
30
|
-
const {
|
|
31
|
-
name,
|
|
32
|
-
remotes,
|
|
33
|
-
remoteEntriesGlobalKey = '__RemoteEntriesList__',
|
|
34
|
-
containersGlobalKey = '__FederationContainers__',
|
|
35
|
-
} = options;
|
|
36
|
-
|
|
37
|
-
if ('library' in options) {
|
|
38
|
-
throw new WebpackError(LIBRARY_ERROR_TEXT);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (remotes) {
|
|
42
|
-
for (const value of Object.values(remotes)) {
|
|
43
|
-
if (typeof value !== 'string' && !value.name) {
|
|
44
|
-
throw new WebpackError(REMOTE_ERROR_TEXT);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
this.readyOptions = {
|
|
50
|
-
...options,
|
|
51
|
-
remoteEntriesGlobalKey,
|
|
52
|
-
containersGlobalKey,
|
|
53
|
-
library: {
|
|
54
|
-
type: 'global',
|
|
55
|
-
name: [containersGlobalKey, name],
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @param compiler Компилятор.
|
|
62
|
-
*/
|
|
63
|
-
apply(compiler: Compiler) {
|
|
64
|
-
const { remotes, remoteEntriesGlobalKey, containersGlobalKey, ...restOptions } =
|
|
65
|
-
this.readyOptions;
|
|
66
|
-
|
|
67
|
-
const configuredRemotes: Record<string, any> = {};
|
|
68
|
-
|
|
69
|
-
if (remotes) {
|
|
70
|
-
for (const [key, value] of Object.entries(remotes)) {
|
|
71
|
-
const serviceName = typeof value === 'string' ? value : value.name;
|
|
72
|
-
const remoteEntryPath = typeof value === 'string' ? undefined : value.remoteEntryPath;
|
|
73
|
-
|
|
74
|
-
configuredRemotes[key] = {
|
|
75
|
-
external: createExternalConfig({
|
|
76
|
-
serviceName,
|
|
77
|
-
remoteEntryPath,
|
|
78
|
-
remoteEntriesGlobalKey,
|
|
79
|
-
containersGlobalKey,
|
|
80
|
-
}),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
compiler.hooks.environment.tap('[isomorph]ModuleFederationPlugin', () => {
|
|
86
|
-
new container.ModuleFederationPlugin({
|
|
87
|
-
...(remotes && { remotes: configuredRemotes }),
|
|
88
|
-
...restOptions,
|
|
89
|
-
}).apply(compiler);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { container } from 'webpack';
|
|
2
|
-
|
|
3
|
-
export interface RemoteProperty {
|
|
4
|
-
name: string;
|
|
5
|
-
remoteEntryPath?: string;
|
|
6
|
-
version?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type OriginalModuleFederationPluginOptions = ConstructorParameters<
|
|
10
|
-
typeof container.ModuleFederationPlugin
|
|
11
|
-
>[0];
|
|
12
|
-
|
|
13
|
-
export interface ModuleFederationPluginOptions {
|
|
14
|
-
/** Имя сервиса. */
|
|
15
|
-
name: string;
|
|
16
|
-
|
|
17
|
-
/** Имя удаленной точки входа. */
|
|
18
|
-
filename?: string;
|
|
19
|
-
|
|
20
|
-
/** Удаленные сервисы. */
|
|
21
|
-
remotes?: Record<string, string | RemoteProperty>;
|
|
22
|
-
|
|
23
|
-
/** Предоставляемые сервисы. */
|
|
24
|
-
exposes?: OriginalModuleFederationPluginOptions['exposes'];
|
|
25
|
-
|
|
26
|
-
/** Общие зависимости. */
|
|
27
|
-
shared?: OriginalModuleFederationPluginOptions['shared'];
|
|
28
|
-
|
|
29
|
-
/** Ключ свойства в глобальном объекте,в котором хранится карта точек входа в удаленные сервисы. */
|
|
30
|
-
remoteEntriesGlobalKey?: string;
|
|
31
|
-
|
|
32
|
-
/** Ключ свойства в глобальном объекте, в который добавляются контейнеры удаленных сервисов. */
|
|
33
|
-
containersGlobalKey?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type ReadyOptions = Omit<
|
|
37
|
-
ModuleFederationPluginOptions,
|
|
38
|
-
'remoteEntriesGlobalKey' | 'containersGlobalKey'
|
|
39
|
-
> &
|
|
40
|
-
Required<
|
|
41
|
-
Pick<ModuleFederationPluginOptions, 'remoteEntriesGlobalKey' | 'containersGlobalKey'>
|
|
42
|
-
> & {
|
|
43
|
-
library: Required<OriginalModuleFederationPluginOptions>['library'];
|
|
44
|
-
};
|