@module-federation/utilities 2.0.7 → 3.0.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.
- package/CHANGELOG.md +284 -226
- package/package.json +9 -12
- package/src/index.d.ts +1 -1
- package/src/index.js.map +1 -1
- package/src/plugins/DelegateModulesPlugin.js +2 -1
- package/src/plugins/DelegateModulesPlugin.js.map +1 -1
- package/src/utils/common.d.ts +14 -0
- package/src/utils/common.js +50 -40
- package/src/utils/common.js.map +1 -1
- package/src/utils/correctImportPath.js +0 -1
- package/src/utils/correctImportPath.js.map +1 -1
- package/src/utils/getRuntimeRemotes.js +1 -2
- package/src/utils/getRuntimeRemotes.js.map +1 -1
- package/src/utils/importDelegatedModule.js +4 -2
- package/src/utils/importDelegatedModule.js.map +1 -1
- package/src/utils/importRemote.d.ts +20 -0
- package/src/utils/importRemote.js +30 -5
- package/src/utils/importRemote.js.map +1 -1
- package/src/utils/pure.js +19 -41
- package/src/utils/pure.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/utilities",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
|
-
"main": "src/index.js",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"publishConfig": {
|
|
@@ -10,27 +10,24 @@
|
|
|
10
10
|
},
|
|
11
11
|
"repository": "https://github.com/module-federation/universe/tree/main/packages/utilities",
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"react": "18.2.0",
|
|
14
|
+
"next": "13.4.19"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
+
"webpack": "^5.40.0",
|
|
17
18
|
"next": "^12 || ^13",
|
|
18
|
-
"react": "^16 || ^17 || ^18",
|
|
19
19
|
"react-dom": "^16 || ^17 || ^18",
|
|
20
|
-
"
|
|
20
|
+
"react": "^16 || ^17 || ^18"
|
|
21
21
|
},
|
|
22
22
|
"peerDependenciesMeta": {
|
|
23
|
-
"next": {
|
|
24
|
-
"optional": true
|
|
25
|
-
},
|
|
26
23
|
"react": {
|
|
27
24
|
"optional": true
|
|
28
25
|
},
|
|
29
26
|
"react-dom": {
|
|
30
27
|
"optional": true
|
|
28
|
+
},
|
|
29
|
+
"next": {
|
|
30
|
+
"optional": true
|
|
31
31
|
}
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"webpack-sources": "3.2.3"
|
|
35
32
|
}
|
|
36
33
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './types';
|
|
2
2
|
export type { ImportRemoteOptions } from './utils/importRemote';
|
|
3
3
|
export type { LoggerInstance } from './Logger';
|
|
4
|
-
export { createDelegatedModule, createRuntimeVariables, getContainer, injectScript, getModule } from './utils/common';
|
|
4
|
+
export { createDelegatedModule, createRuntimeVariables, getContainer, injectScript, getModule, } from './utils/common';
|
|
5
5
|
export { isObjectEmpty } from './utils/isEmpty';
|
|
6
6
|
export { importRemote } from './utils/importRemote';
|
|
7
7
|
export { correctImportPath } from './utils/correctImportPath';
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utilities/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AAIxB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utilities/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AAIxB,yCAMwB;AALtB,+GAAA,qBAAqB,OAAA;AACrB,gHAAA,sBAAsB,OAAA;AACtB,sGAAA,YAAY,OAAA;AACZ,sGAAA,YAAY,OAAA;AACZ,mGAAA,SAAS,OAAA;AAEX,2CAAgD;AAAvC,wGAAA,aAAa,OAAA;AACtB,qDAAoD;AAA3C,4GAAA,YAAY,OAAA;AACrB,+DAA8D;AAArD,sHAAA,iBAAiB,OAAA;AAC1B,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,+DAA8D;AAArD,sHAAA,iBAAiB,OAAA;AAC1B,uEAAsE;AAA7D,8HAAA,qBAAqB,OAAA"}
|
|
@@ -72,8 +72,9 @@ class DelegateModulesPlugin {
|
|
|
72
72
|
// Change this line
|
|
73
73
|
const { runtime, container } = this.options;
|
|
74
74
|
const runtimeChunk = this.getChunkByName(chunks, runtime);
|
|
75
|
-
if (!runtimeChunk || !runtimeChunk.hasRuntime())
|
|
75
|
+
if (!runtimeChunk || !runtimeChunk.hasRuntime()) {
|
|
76
76
|
return;
|
|
77
|
+
}
|
|
77
78
|
// Get the container chunk if specified
|
|
78
79
|
const remoteContainer = container
|
|
79
80
|
? this.getChunkByName(chunks, container)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelegateModulesPlugin.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/plugins/DelegateModulesPlugin.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH,MAAM,qBAAqB;IAIzB,YAAY,OAAgD;QAC1D,IAAI,CAAC,OAAO,mBAAK,KAAK,EAAE,KAAK,IAAK,OAAO,CAAE,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,cAAc,CAAC,MAAuB,EAAE,IAAY;QAClD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,oBAAoB,CAC1B,WAAwB,EACxB,MAAe;QAEf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,KAAK,M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,EACpB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,EAAE,EACR,KAAK,CAAC,IAAI,CACX,CAAC;gBACJ,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;oBACvC,WAAW,CAAC,UAAU,CAAC,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACjE,CAAC,CAAC,CAAC;aACJ;SACF;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAkB;QACtB,6BAA6B;QAC7B,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAC5B,uBAAuB,EACvB,CAAC,WAAwB,EAAE,EAAE;YAC3B,kCAAkC;YAClC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;YACzC,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAClC,uBAAuB,EACvB,CAAC,MAAM,EAAE,EAAE;gBACT,mBAAmB;gBACnB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAC1D,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"DelegateModulesPlugin.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/plugins/DelegateModulesPlugin.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH,MAAM,qBAAqB;IAIzB,YAAY,OAAgD;QAC1D,IAAI,CAAC,OAAO,mBAAK,KAAK,EAAE,KAAK,IAAK,OAAO,CAAE,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,cAAc,CAAC,MAAuB,EAAE,IAAY;QAClD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,IAAI,KAAK,CAAC,IAA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type { GetModuleOptions, RemoteData, Remotes, RuntimeRemote, WebpackRemoteContainer } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a module that can be shared across different builds.
|
|
4
|
+
* @param {string} delegate - The delegate string.
|
|
5
|
+
* @param {Object} params - The parameters for the module.
|
|
6
|
+
* @returns {string} - The created module.
|
|
7
|
+
* @throws Will throw an error if the params are an array or object.
|
|
8
|
+
*/
|
|
2
9
|
export declare const createDelegatedModule: (delegate: string, params: {
|
|
3
10
|
[key: string]: any;
|
|
4
11
|
}) => string;
|
|
@@ -11,6 +18,13 @@ export declare const createDelegatedModule: (delegate: string, params: {
|
|
|
11
18
|
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
12
19
|
*/
|
|
13
20
|
export declare const injectScript: (keyOrRuntimeRemoteItem: string | RuntimeRemote) => Promise<WebpackRemoteContainer>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates runtime variables from the provided remotes.
|
|
23
|
+
* If the value of a remote starts with 'promise ' or 'external ', it is transformed into a function that returns the promise call.
|
|
24
|
+
* Otherwise, the value is stringified.
|
|
25
|
+
* @param {Remotes} remotes - The remotes to create runtime variables from.
|
|
26
|
+
* @returns {Record<string, string>} - The created runtime variables.
|
|
27
|
+
*/
|
|
14
28
|
export declare const createRuntimeVariables: (remotes: Remotes) => Record<string, string>;
|
|
15
29
|
/**
|
|
16
30
|
* Returns initialized webpack RemoteContainer.
|
package/src/utils/common.js
CHANGED
|
@@ -12,17 +12,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.getModule = exports.getContainer = exports.createRuntimeVariables = exports.injectScript = exports.createDelegatedModule = void 0;
|
|
14
14
|
const pure_1 = require("./pure");
|
|
15
|
+
/**
|
|
16
|
+
* Creates a module that can be shared across different builds.
|
|
17
|
+
* @param {string} delegate - The delegate string.
|
|
18
|
+
* @param {Object} params - The parameters for the module.
|
|
19
|
+
* @returns {string} - The created module.
|
|
20
|
+
* @throws Will throw an error if the params are an array or object.
|
|
21
|
+
*/
|
|
15
22
|
const createDelegatedModule = (delegate, params) => {
|
|
16
23
|
const queries = [];
|
|
17
|
-
|
|
18
|
-
if (Array.isArray(value)
|
|
19
|
-
|
|
24
|
+
const processParam = (key, value) => {
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
value.forEach((v, i) => processParam(`${key}[${i}]`, v));
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
else if (typeof value === 'object' && value !== null) {
|
|
29
|
+
Object.entries(value).forEach(([k, v]) => processParam(`${key}.${k}`, v));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
queries.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
Object.entries(params).forEach(([key, value]) => processParam(key, value));
|
|
36
|
+
return queries.length === 0 ? `internal ${delegate}` : `internal ${delegate}?${queries.join('&')}`;
|
|
26
37
|
};
|
|
27
38
|
exports.createDelegatedModule = createDelegatedModule;
|
|
28
39
|
const createContainerSharingScope = (asyncContainer) => {
|
|
@@ -64,28 +75,32 @@ const createContainerSharingScope = (asyncContainer) => {
|
|
|
64
75
|
* or
|
|
65
76
|
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
66
77
|
*/
|
|
67
|
-
const injectScript = (keyOrRuntimeRemoteItem) => {
|
|
78
|
+
const injectScript = (keyOrRuntimeRemoteItem) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
79
|
const asyncContainer = (0, pure_1.loadScript)(keyOrRuntimeRemoteItem);
|
|
69
80
|
return createContainerSharingScope(asyncContainer);
|
|
70
|
-
};
|
|
81
|
+
});
|
|
71
82
|
exports.injectScript = injectScript;
|
|
83
|
+
/**
|
|
84
|
+
* Creates runtime variables from the provided remotes.
|
|
85
|
+
* If the value of a remote starts with 'promise ' or 'external ', it is transformed into a function that returns the promise call.
|
|
86
|
+
* Otherwise, the value is stringified.
|
|
87
|
+
* @param {Remotes} remotes - The remotes to create runtime variables from.
|
|
88
|
+
* @returns {Record<string, string>} - The created runtime variables.
|
|
89
|
+
*/
|
|
72
90
|
const createRuntimeVariables = (remotes) => {
|
|
73
91
|
if (!remotes) {
|
|
74
92
|
return {};
|
|
75
93
|
}
|
|
76
|
-
return Object.entries(remotes).reduce((acc,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.replace('promise ', '')
|
|
81
|
-
.replace('external ', '');
|
|
82
|
-
acc[remote[0]] = `function() {
|
|
94
|
+
return Object.entries(remotes).reduce((acc, [key, value]) => {
|
|
95
|
+
if (value.startsWith('promise ') || value.startsWith('external ')) {
|
|
96
|
+
const promiseCall = value.split(' ')[1];
|
|
97
|
+
acc[key] = `function() {
|
|
83
98
|
return ${promiseCall}
|
|
84
99
|
}`;
|
|
85
|
-
return acc;
|
|
86
100
|
}
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
else {
|
|
102
|
+
acc[key] = JSON.stringify(value);
|
|
103
|
+
}
|
|
89
104
|
return acc;
|
|
90
105
|
}, {});
|
|
91
106
|
};
|
|
@@ -98,30 +113,24 @@ const getContainer = (remoteContainer) => __awaiter(void 0, void 0, void 0, func
|
|
|
98
113
|
if (!remoteContainer) {
|
|
99
114
|
throw Error(`Remote container options is empty`);
|
|
100
115
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// @ts-ignore
|
|
104
|
-
typeof window !== 'undefined' ? window : globalThis.__remote_scope__;
|
|
116
|
+
const containerScope = typeof window !== 'undefined' ? window : globalThis.__remote_scope__;
|
|
117
|
+
let containerKey;
|
|
105
118
|
if (typeof remoteContainer === 'string') {
|
|
106
|
-
|
|
107
|
-
return containerScope[remoteContainer];
|
|
108
|
-
}
|
|
109
|
-
return;
|
|
119
|
+
containerKey = remoteContainer;
|
|
110
120
|
}
|
|
111
121
|
else {
|
|
112
|
-
|
|
113
|
-
if (containerScope[
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return container;
|
|
122
|
+
containerKey = remoteContainer.uniqueKey;
|
|
123
|
+
if (!containerScope[containerKey]) {
|
|
124
|
+
const container = yield (0, exports.injectScript)({
|
|
125
|
+
global: remoteContainer.global,
|
|
126
|
+
url: remoteContainer.url,
|
|
127
|
+
});
|
|
128
|
+
if (!container) {
|
|
129
|
+
throw Error(`Remote container ${remoteContainer.url} is empty`);
|
|
130
|
+
}
|
|
122
131
|
}
|
|
123
|
-
throw Error(`Remote container ${remoteContainer.url} is empty`);
|
|
124
132
|
}
|
|
133
|
+
return containerScope[containerKey];
|
|
125
134
|
});
|
|
126
135
|
exports.getContainer = getContainer;
|
|
127
136
|
/**
|
|
@@ -135,8 +144,9 @@ const getModule = ({ remoteContainer, modulePath, exportName, }) => __awaiter(vo
|
|
|
135
144
|
const container = yield (0, exports.getContainer)(remoteContainer);
|
|
136
145
|
try {
|
|
137
146
|
const modFactory = yield (container === null || container === void 0 ? void 0 : container.get(modulePath));
|
|
138
|
-
if (!modFactory)
|
|
147
|
+
if (!modFactory) {
|
|
139
148
|
return undefined;
|
|
149
|
+
}
|
|
140
150
|
const mod = modFactory();
|
|
141
151
|
if (exportName) {
|
|
142
152
|
return mod && typeof mod === 'object' ? mod[exportName] : undefined;
|
package/src/utils/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/common.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;;;;;;;;;;AAWtD,iCAAoC;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/common.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;;;;;;;;;;AAWtD,iCAAoC;AAEpC;;;;;;GAMG;AACI,MAAM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MAAM,IAAA,oBAAY,EAAC,eAAe,CAAC,CAAC;IACtD,IAAI;QACF,MAAM,UAAU,GAAG,MAAM,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,UAAU,CAAC,CAAA,CAAC;QACpD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,SAAS,CAAC;SAClB;QACD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,IAAI,UAAU,EAAE;YACd,OAAO,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACrE;aAAM;YACL,OAAO,GAAG,CAAC;SACZ;KACF;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,SAAS,CAAC;KAClB;AACH,CAAC,CAAA,CAAC;AArBW,QAAA,SAAS,aAqBpB"}
|
|
@@ -6,7 +6,6 @@ const correctImportPath = (context, entryFile) => {
|
|
|
6
6
|
if ((process === null || process === void 0 ? void 0 : process.platform) !== 'win32') {
|
|
7
7
|
return entryFile;
|
|
8
8
|
}
|
|
9
|
-
console.log('entryFile', entryFile);
|
|
10
9
|
if (entryFile.match(/^\.?\.\\/) || !entryFile.match(/^[A-Z]:\\\\/i)) {
|
|
11
10
|
return entryFile.replace(/\\/g, '/');
|
|
12
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correctImportPath.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/correctImportPath.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAE,EAAE;IACtE,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,OAAO,EAAE;YACjC,OAAO,SAAS,CAAC;SAClB;
|
|
1
|
+
{"version":3,"file":"correctImportPath.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/correctImportPath.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAE,EAAE;IACtE,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,OAAO,EAAE;YACjC,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;YACnE,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SACtC;QAED,8DAA8D;QAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE3C,IAAI,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;YACtC,OAAO,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3C;QAED,OAAO,KAAK,QAAQ,EAAE,CAAC;KACxB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B"}
|
|
@@ -4,7 +4,7 @@ exports.getRuntimeRemotes = void 0;
|
|
|
4
4
|
const pure_1 = require("./pure");
|
|
5
5
|
const getRuntimeRemotes = () => {
|
|
6
6
|
try {
|
|
7
|
-
|
|
7
|
+
return Object.entries(pure_1.remoteVars).reduce(function (acc, item) {
|
|
8
8
|
const [key, value] = item;
|
|
9
9
|
// if its an object with a thenable (eagerly executing function)
|
|
10
10
|
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
@@ -39,7 +39,6 @@ const getRuntimeRemotes = () => {
|
|
|
39
39
|
}
|
|
40
40
|
return acc;
|
|
41
41
|
}, {});
|
|
42
|
-
return runtimeRemotes;
|
|
43
42
|
}
|
|
44
43
|
catch (err) {
|
|
45
44
|
console.warn('Unable to retrieve runtime remotes: ', err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRuntimeRemotes.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/getRuntimeRemotes.ts"],"names":[],"mappings":";;;AACA,iCAAyD;AAElD,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,IAAI;QACF,
|
|
1
|
+
{"version":3,"file":"getRuntimeRemotes.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/getRuntimeRemotes.ts"],"names":[],"mappings":";;;AACA,iCAAyD;AAElD,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,IAAI;QACF,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAU,CAAC,CAAC,MAAM,CAAC,UACnC,GAAG,EACH,IAAI;YAEJ,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;YAC1B,gEAAgE;YAChE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;gBACjE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;aACtC;YACD,oEAAoE;iBAC/D,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;gBACpC,aAAa;gBACb,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;aACtC;YACD,oCAAoC;iBAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;gBACnE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnE,IAAI,KAAK,EAAE;oBACT,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;oBAC9D,IAAI,YAAY,EAAE;wBAChB,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,IAAA,0BAAmB,EAAC,YAAY,CAAC,CAAC;wBACxD,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;qBAC5B;iBACF;aACF;YACD,oCAAoC;iBAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAClC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,IAAA,0BAAmB,EAAC,KAAK,CAAC,CAAC;gBACjD,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;aAC5B;YACD,8CAA8C;iBACzC;gBACH,YAAY;gBACZ,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACrD,MAAM,IAAI,KAAK,CACb,mDAAmD,GAAG,GAAG,CAC1D,CAAC;aACH;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EACD,EAAuB,CAAC,CAAC;KAC9B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;KAC3D;IAED,OAAO,EAAuB,CAAC;AACjC,CAAC,CAAC;AAhDW,QAAA,iBAAiB,qBAgD5B"}
|
|
@@ -40,11 +40,12 @@ const importDelegatedModule = (keyOrRuntimeRemoteItem) => __awaiter(void 0, void
|
|
|
40
40
|
get: function () {
|
|
41
41
|
return function () {
|
|
42
42
|
//@ts-ignore
|
|
43
|
-
if (globalThis.usedChunks)
|
|
43
|
+
if (globalThis.usedChunks) {
|
|
44
44
|
//@ts-ignore
|
|
45
45
|
globalThis.usedChunks.add(
|
|
46
46
|
//@ts-ignore
|
|
47
47
|
`${keyOrRuntimeRemoteItem.global}->${arg}`);
|
|
48
|
+
}
|
|
48
49
|
//eslint-disable-next-line prefer-rest-params
|
|
49
50
|
return m[prop](...arguments);
|
|
50
51
|
};
|
|
@@ -56,11 +57,12 @@ const importDelegatedModule = (keyOrRuntimeRemoteItem) => __awaiter(void 0, void
|
|
|
56
57
|
Object.defineProperty(result, prop, {
|
|
57
58
|
get: () => {
|
|
58
59
|
//@ts-ignore
|
|
59
|
-
if (globalThis.usedChunks)
|
|
60
|
+
if (globalThis.usedChunks) {
|
|
60
61
|
//@ts-ignore
|
|
61
62
|
globalThis.usedChunks.add(
|
|
62
63
|
//@ts-ignore
|
|
63
64
|
`${keyOrRuntimeRemoteItem.global}->${arg}`);
|
|
65
|
+
}
|
|
64
66
|
return m[prop];
|
|
65
67
|
},
|
|
66
68
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importDelegatedModule.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/importDelegatedModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iCAAoC;AAE7B,MAAM,qBAAqB,GAAG,CACnC,sBAA8C,EAC9C,EAAE;IACF,aAAa;IACb,OAAO,IAAA,iBAAU,EAAC,sBAAsB,CAAC;SACtC,IAAI,CAAC,CAAC,cAAsC,EAAE,EAAE;QAC/C,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,cAAsC,EAAE,EAAE;QAC/C,6EAA6E;QAC7E,kEAAkE;QAClE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,EAAE;gBACrE,OAAO,cAAc,CAAC;aACvB;YAED,yBAAyB;YAEzB,2DAA2D;YAC3D,OAAO;gBACL,GAAG,EAAE,UAAU,GAAW;oBACxB,YAAY;oBACZ,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;wBACxC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;wBACd,MAAM,MAAM,GAAG;4BACb,UAAU,EAAE,CAAC,CAAC,UAAU;yBACzB,CAAC;wBACF,KAAK,MAAM,IAAI,IAAI,CAAC,EAAE;4BACpB,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE;gCACjC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE;oCAClC,GAAG,EAAE;wCACH,OAAO;4CACL,YAAY;4CACZ,IAAI,UAAU,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"importDelegatedModule.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/importDelegatedModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iCAAoC;AAE7B,MAAM,qBAAqB,GAAG,CACnC,sBAA8C,EAC9C,EAAE;IACF,aAAa;IACb,OAAO,IAAA,iBAAU,EAAC,sBAAsB,CAAC;SACtC,IAAI,CAAC,CAAC,cAAsC,EAAE,EAAE;QAC/C,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,cAAsC,EAAE,EAAE;QAC/C,6EAA6E;QAC7E,kEAAkE;QAClE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,EAAE;gBACrE,OAAO,cAAc,CAAC;aACvB;YAED,yBAAyB;YAEzB,2DAA2D;YAC3D,OAAO;gBACL,GAAG,EAAE,UAAU,GAAW;oBACxB,YAAY;oBACZ,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,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tB,CAAC,CAAC,CAAC;gBACL,CAAC;gBACD,IAAI,EAAE,cAAc,CAAC,IAAI;aAC1B,CAAC;SACH;aAAM;YACL,OAAO,cAAc,CAAC;SACvB;IACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAA,CAAC;AA9EW,QAAA,qBAAqB,yBA8EhC"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definition for RemoteUrl
|
|
3
|
+
* @typedef {string | function} RemoteUrl
|
|
4
|
+
*/
|
|
1
5
|
type RemoteUrl = string | (() => Promise<string>);
|
|
6
|
+
/**
|
|
7
|
+
* Interface for ImportRemoteOptions
|
|
8
|
+
* @interface
|
|
9
|
+
* @property {RemoteUrl} url - The url of the remote module
|
|
10
|
+
* @property {string} scope - The scope of the remote module
|
|
11
|
+
* @property {string} module - The module to import
|
|
12
|
+
* @property {string} [remoteEntryFileName] - The filename of the remote entry
|
|
13
|
+
* @property {boolean} [bustRemoteEntryCache] - Flag to bust the remote entry cache
|
|
14
|
+
*/
|
|
2
15
|
export interface ImportRemoteOptions {
|
|
3
16
|
url: RemoteUrl;
|
|
4
17
|
scope: string;
|
|
@@ -6,5 +19,12 @@ export interface ImportRemoteOptions {
|
|
|
6
19
|
remoteEntryFileName?: string;
|
|
7
20
|
bustRemoteEntryCache?: boolean;
|
|
8
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Function to import remote
|
|
24
|
+
* @async
|
|
25
|
+
* @function
|
|
26
|
+
* @param {ImportRemoteOptions} options - The options for importing the remote
|
|
27
|
+
* @returns {Promise<T>} A promise that resolves with the imported module
|
|
28
|
+
*/
|
|
9
29
|
export declare const importRemote: <T>({ url, scope, module, remoteEntryFileName, bustRemoteEntryCache, }: ImportRemoteOptions) => Promise<T>;
|
|
10
30
|
export {};
|
|
@@ -10,7 +10,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.importRemote = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Constant for remote entry file
|
|
15
|
+
* @constant {string}
|
|
16
|
+
*/
|
|
13
17
|
const REMOTE_ENTRY_FILE = 'remoteEntry.js';
|
|
18
|
+
/**
|
|
19
|
+
* Function to load remote
|
|
20
|
+
* @function
|
|
21
|
+
* @param {ImportRemoteOptions['url']} url - The url of the remote module
|
|
22
|
+
* @param {ImportRemoteOptions['scope']} scope - The scope of the remote module
|
|
23
|
+
* @param {ImportRemoteOptions['bustRemoteEntryCache']} bustRemoteEntryCache - Flag to bust the remote entry cache
|
|
24
|
+
* @returns {Promise<void>} A promise that resolves when the remote is loaded
|
|
25
|
+
*/
|
|
14
26
|
const loadRemote = (url, scope, bustRemoteEntryCache) => new Promise((resolve, reject) => {
|
|
15
27
|
const timestamp = bustRemoteEntryCache ? `?t=${new Date().getTime()}` : '';
|
|
16
28
|
const webpackRequire = __webpack_require__;
|
|
@@ -27,13 +39,23 @@ const loadRemote = (url, scope, bustRemoteEntryCache) => new Promise((resolve, r
|
|
|
27
39
|
reject(error);
|
|
28
40
|
}, scope);
|
|
29
41
|
});
|
|
42
|
+
/**
|
|
43
|
+
* Function to initialize sharing
|
|
44
|
+
* @async
|
|
45
|
+
* @function
|
|
46
|
+
*/
|
|
30
47
|
const initSharing = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
48
|
const webpackShareScopes = __webpack_share_scopes__;
|
|
32
49
|
if (!(webpackShareScopes === null || webpackShareScopes === void 0 ? void 0 : webpackShareScopes.default)) {
|
|
33
50
|
yield __webpack_init_sharing__('default');
|
|
34
51
|
}
|
|
35
52
|
});
|
|
36
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Function to initialize container
|
|
55
|
+
* @async
|
|
56
|
+
* @function
|
|
57
|
+
* @param {WebpackRemoteContainer} containerScope - The container scope
|
|
58
|
+
*/
|
|
37
59
|
const initContainer = (containerScope) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
60
|
try {
|
|
39
61
|
const webpackShareScopes = __webpack_share_scopes__;
|
|
@@ -48,10 +70,13 @@ const initContainer = (containerScope) => __awaiter(void 0, void 0, void 0, func
|
|
|
48
70
|
console.error(error);
|
|
49
71
|
}
|
|
50
72
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Function to import remote
|
|
75
|
+
* @async
|
|
76
|
+
* @function
|
|
77
|
+
* @param {ImportRemoteOptions} options - The options for importing the remote
|
|
78
|
+
* @returns {Promise<T>} A promise that resolves with the imported module
|
|
79
|
+
*/
|
|
55
80
|
const importRemote = ({ url, scope, module, remoteEntryFileName = REMOTE_ENTRY_FILE, bustRemoteEntryCache = true, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
81
|
const remoteScope = scope;
|
|
57
82
|
if (!window[remoteScope]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importRemote.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/importRemote.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"importRemote.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/importRemote.ts"],"names":[],"mappings":";;;;;;;;;;;;AA8BA;;;GAGG;AACH,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CACjB,GAA+B,EAC/B,KAAmC,EACnC,oBAAiE,EACjE,EAAE,CACF,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACpC,MAAM,SAAS,GAAG,oBAAoB,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,MAAM,cAAc,GAAG,mBAAgD,CAAC;IACxE,cAAc,CAAC,CAAC,CACd,GAAG,GAAG,GAAG,SAAS,EAA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AC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;QAC1E,OAAO,aAAa,EAAE,CAAC;KACxB;AACH,CAAC,CAAA,CAAC;AA7CW,QAAA,YAAY,gBA6CvB"}
|
package/src/utils/pure.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeRemotes = exports.loadScript = exports.extractUrlAndGlobal = exports.remoteVars = void 0;
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
pure = process.env['REMOTES'] || {};
|
|
8
|
-
}
|
|
9
|
-
catch (e) {
|
|
10
|
-
// not in webpack bundle
|
|
11
|
-
}
|
|
4
|
+
const pure = typeof process !== 'undefined' ? process.env['REMOTES'] || {} : {};
|
|
12
5
|
exports.remoteVars = pure;
|
|
13
6
|
const extractUrlAndGlobal = (urlAndGlobal) => {
|
|
14
7
|
const index = urlAndGlobal.indexOf('@');
|
|
@@ -22,9 +15,7 @@ const loadScript = (keyOrRuntimeRemoteItem) => {
|
|
|
22
15
|
const runtimeRemotes = (0, exports.getRuntimeRemotes)();
|
|
23
16
|
// 1) Load remote container if needed
|
|
24
17
|
let asyncContainer;
|
|
25
|
-
const reference = typeof keyOrRuntimeRemoteItem === 'string'
|
|
26
|
-
? runtimeRemotes[keyOrRuntimeRemoteItem]
|
|
27
|
-
: keyOrRuntimeRemoteItem;
|
|
18
|
+
const reference = typeof keyOrRuntimeRemoteItem === 'string' ? runtimeRemotes[keyOrRuntimeRemoteItem] : keyOrRuntimeRemoteItem;
|
|
28
19
|
if (reference.asyncContainer) {
|
|
29
20
|
asyncContainer =
|
|
30
21
|
typeof reference.asyncContainer.then === 'function'
|
|
@@ -123,20 +114,15 @@ const loadScript = (keyOrRuntimeRemoteItem) => {
|
|
|
123
114
|
};
|
|
124
115
|
exports.loadScript = loadScript;
|
|
125
116
|
const getRuntimeRemotes = () => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// @ts-ignore
|
|
136
|
-
acc[key] = { asyncContainer: value };
|
|
137
|
-
}
|
|
138
|
-
// if its a delegate module, skip it
|
|
139
|
-
else if (typeof value === 'string' && value.startsWith('internal ')) {
|
|
117
|
+
return Object.entries(exports.remoteVars).reduce((acc, [key, value]) => {
|
|
118
|
+
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
119
|
+
acc[key] = { asyncContainer: value };
|
|
120
|
+
}
|
|
121
|
+
else if (typeof value === 'function') {
|
|
122
|
+
acc[key] = { asyncContainer: Promise.resolve(value()) };
|
|
123
|
+
}
|
|
124
|
+
else if (typeof value === 'string') {
|
|
125
|
+
if (value.startsWith('internal ')) {
|
|
140
126
|
const [request, query] = value.replace('internal ', '').split('?');
|
|
141
127
|
if (query) {
|
|
142
128
|
const remoteSyntax = new URLSearchParams(query).get('remote');
|
|
@@ -146,25 +132,17 @@ const getRuntimeRemotes = () => {
|
|
|
146
132
|
}
|
|
147
133
|
}
|
|
148
134
|
}
|
|
149
|
-
|
|
150
|
-
else if (typeof value === 'string') {
|
|
135
|
+
else {
|
|
151
136
|
const [url, global] = (0, exports.extractUrlAndGlobal)(value);
|
|
152
137
|
acc[key] = { global, url };
|
|
153
138
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}, {});
|
|
162
|
-
return runtimeRemotes;
|
|
163
|
-
}
|
|
164
|
-
catch (err) {
|
|
165
|
-
console.warn('Unable to retrieve runtime remotes: ', err);
|
|
166
|
-
}
|
|
167
|
-
return {};
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
console.warn('remotes process', process.env['REMOTES']);
|
|
142
|
+
throw new Error(`[mf] Invalid value received for runtime_remote "${key}"`);
|
|
143
|
+
}
|
|
144
|
+
return acc;
|
|
145
|
+
}, {});
|
|
168
146
|
};
|
|
169
147
|
exports.getRuntimeRemotes = getRuntimeRemotes;
|
|
170
148
|
//# sourceMappingURL=pure.js.map
|
package/src/utils/pure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/pure.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/pure.ts"],"names":[],"mappings":";;;AAQA,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACnE,QAAA,UAAU,GAAG,IAAkB,CAAC;AAEtC,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAoB,EAAE;IAC5E,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QACnD,MAAM,IAAI,KAAK,CAAC,oBAAoB,YAAY,GAAG,CAAC,CAAC;KACtD;IACD,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,MAAM,UAAU,GAAG,CAAC,sBAA8C,EAAE,EAAE;IAC3E,MAAM,cAAc,GAAG,IAAA,yBAAiB,GAAE,CAAC;IAE3C,qCAAqC;IACrC,IAAI,cAA+C,CAAC;IACpD,MAAM,SAAS,GAAG,OAAO,sBAAsB,KAAK,QAAQ,CAAC,CAAC,CAA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