chayns-api 2.4.29 → 2.5.0-beta.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/dist/cjs/plugins/SequentialLoadPlugin.js +27 -0
- package/dist/cjs/util/initModuleFederationSharing.js +3 -1
- package/dist/cjs/wrapper/AppWrapper.js +1 -0
- package/dist/esm/plugins/SequentialLoadPlugin.js +20 -0
- package/dist/esm/util/initModuleFederationSharing.js +3 -1
- package/dist/esm/wrapper/AppWrapper.js +1 -0
- package/dist/types/plugins/SequentialLoadPlugin.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SequentialLoadPlugin = void 0;
|
|
7
|
+
const SequentialLoadPlugin = () => {
|
|
8
|
+
return {
|
|
9
|
+
name: 'sequential-load',
|
|
10
|
+
async beforeInitContainer(args) {
|
|
11
|
+
const manifest = args.origin.snapshotHandler.manifestCache.get(args.remoteEntryInitOptions.version);
|
|
12
|
+
const requiredShares = new Set(manifest === null || manifest === void 0 ? void 0 : manifest.shared.map(share => share.name));
|
|
13
|
+
for (const [key, pkg] of Object.entries(args.shareScope)) {
|
|
14
|
+
if (manifest && !requiredShares.has(key)) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
for (const version of Object.values(pkg)) {
|
|
18
|
+
if (!version.loaded && version.loading) {
|
|
19
|
+
await version.loading;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return args;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.SequentialLoadPlugin = SequentialLoadPlugin;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.initModuleFederationSharing = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
|
+
var _SequentialLoadPlugin = require("../plugins/SequentialLoadPlugin");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
let ReactDOMClient;
|
|
11
12
|
try {
|
|
@@ -48,7 +49,8 @@ const initModuleFederationSharing = ({
|
|
|
48
49
|
init({
|
|
49
50
|
name: name !== null && name !== void 0 ? name : '',
|
|
50
51
|
remotes: [],
|
|
51
|
-
shared
|
|
52
|
+
shared,
|
|
53
|
+
plugins: [(0, _SequentialLoadPlugin.SequentialLoadPlugin)()]
|
|
52
54
|
});
|
|
53
55
|
};
|
|
54
56
|
exports.initModuleFederationSharing = initModuleFederationSharing;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const SequentialLoadPlugin = () => {
|
|
2
|
+
return {
|
|
3
|
+
name: 'sequential-load',
|
|
4
|
+
async beforeInitContainer(args) {
|
|
5
|
+
const manifest = args.origin.snapshotHandler.manifestCache.get(args.remoteEntryInitOptions.version);
|
|
6
|
+
const requiredShares = new Set(manifest === null || manifest === void 0 ? void 0 : manifest.shared.map(share => share.name));
|
|
7
|
+
for (const [key, pkg] of Object.entries(args.shareScope)) {
|
|
8
|
+
if (manifest && !requiredShares.has(key)) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
for (const version of Object.values(pkg)) {
|
|
12
|
+
if (!version.loaded && version.loading) {
|
|
13
|
+
await version.loading;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return args;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
+
import { SequentialLoadPlugin } from '../plugins/SequentialLoadPlugin';
|
|
3
4
|
let ReactDOMClient;
|
|
4
5
|
try {
|
|
5
6
|
ReactDOMClient = require('react-dom/client');
|
|
@@ -42,6 +43,7 @@ export const initModuleFederationSharing = _ref => {
|
|
|
42
43
|
init({
|
|
43
44
|
name: name !== null && name !== void 0 ? name : '',
|
|
44
45
|
remotes: [],
|
|
45
|
-
shared
|
|
46
|
+
shared,
|
|
47
|
+
plugins: [SequentialLoadPlugin()]
|
|
46
48
|
});
|
|
47
49
|
};
|
|
@@ -551,6 +551,7 @@ export class AppWrapper {
|
|
|
551
551
|
storageRemoveItem: async (key, accessMode) => {
|
|
552
552
|
this.appCall(73, {
|
|
553
553
|
key,
|
|
554
|
+
object: ['iOS', 'Mac OS'].includes(this.values.device.os) ? JSON.stringify(null) : undefined,
|
|
554
555
|
accessMode
|
|
555
556
|
}, {
|
|
556
557
|
awaitResult: false
|