chayns-api 2.6.3 → 2.6.5
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/TrustedDomainsPlugins.js +1 -2
- package/dist/cjs/util/initModuleFederationSharing.js +3 -1
- package/dist/esm/plugins/TrustedDomainsPlugins.js +1 -2
- package/dist/esm/util/initModuleFederationSharing.js +3 -1
- package/dist/types/plugins/TrustedDomainsPlugins.d.ts +0 -1
- package/dist/types/util/initModuleFederationSharing.d.ts +14 -3
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ exports.TrustedDomainsPlugin = void 0;
|
|
|
7
7
|
exports.isTrustedDomainsError = isTrustedDomainsError;
|
|
8
8
|
class TrustedDomainsError extends Error {
|
|
9
9
|
name = 'TrustedDomainsError';
|
|
10
|
-
isTrustedDomainsError = true;
|
|
11
10
|
constructor(entry) {
|
|
12
11
|
super('Remote entry ' + entry + ' is not in trusted domains');
|
|
13
12
|
}
|
|
@@ -30,5 +29,5 @@ const TrustedDomainsPlugin = (trustedDomains = []) => {
|
|
|
30
29
|
};
|
|
31
30
|
exports.TrustedDomainsPlugin = TrustedDomainsPlugin;
|
|
32
31
|
function isTrustedDomainsError(error) {
|
|
33
|
-
return error instanceof Error && error.name === 'TrustedDomainsError'
|
|
32
|
+
return error instanceof Error && error.name === 'TrustedDomainsError';
|
|
34
33
|
}
|
|
@@ -13,9 +13,11 @@ try {
|
|
|
13
13
|
ReactDOMClient = require('react-dom/client');
|
|
14
14
|
} catch (e) {}
|
|
15
15
|
const initModuleFederationSharing = ({
|
|
16
|
+
scope,
|
|
16
17
|
name,
|
|
17
18
|
plugins = []
|
|
18
19
|
}) => {
|
|
20
|
+
var _ref;
|
|
19
21
|
if (globalThis.moduleFederationScopes) {
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
@@ -42,7 +44,7 @@ const initModuleFederationSharing = ({
|
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
const instance = createInstance({
|
|
45
|
-
name:
|
|
47
|
+
name: (_ref = scope !== null && scope !== void 0 ? scope : name) !== null && _ref !== void 0 ? _ref : '',
|
|
46
48
|
remotes: [],
|
|
47
49
|
shared,
|
|
48
50
|
plugins: [(0, _SequentialLoadPlugin.SequentialLoadPlugin)(), ...plugins]
|
|
@@ -5,7 +5,6 @@ class TrustedDomainsError extends Error {
|
|
|
5
5
|
constructor(entry) {
|
|
6
6
|
super('Remote entry ' + entry + ' is not in trusted domains');
|
|
7
7
|
_defineProperty(this, "name", 'TrustedDomainsError');
|
|
8
|
-
_defineProperty(this, "isTrustedDomainsError", true);
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
export const TrustedDomainsPlugin = (trustedDomains = []) => {
|
|
@@ -25,5 +24,5 @@ export const TrustedDomainsPlugin = (trustedDomains = []) => {
|
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
export function isTrustedDomainsError(error) {
|
|
28
|
-
return error instanceof Error && error.name === 'TrustedDomainsError'
|
|
27
|
+
return error instanceof Error && error.name === 'TrustedDomainsError';
|
|
29
28
|
}
|
|
@@ -6,9 +6,11 @@ try {
|
|
|
6
6
|
ReactDOMClient = require('react-dom/client');
|
|
7
7
|
} catch (e) {}
|
|
8
8
|
export const initModuleFederationSharing = ({
|
|
9
|
+
scope,
|
|
9
10
|
name,
|
|
10
11
|
plugins = []
|
|
11
12
|
}) => {
|
|
13
|
+
var _ref;
|
|
12
14
|
if (globalThis.moduleFederationScopes) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
@@ -35,7 +37,7 @@ export const initModuleFederationSharing = ({
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
const instance = createInstance({
|
|
38
|
-
name:
|
|
40
|
+
name: (_ref = scope !== null && scope !== void 0 ? scope : name) !== null && _ref !== void 0 ? _ref : '',
|
|
39
41
|
remotes: [],
|
|
40
42
|
shared,
|
|
41
43
|
plugins: [SequentialLoadPlugin(), ...plugins]
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
|
|
2
2
|
declare class TrustedDomainsError extends Error {
|
|
3
3
|
readonly name: "TrustedDomainsError";
|
|
4
|
-
readonly isTrustedDomainsError: true;
|
|
5
4
|
constructor(entry: string);
|
|
6
5
|
}
|
|
7
6
|
export declare const TrustedDomainsPlugin: (trustedDomains?: string[]) => ModuleFederationRuntimePlugin;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
|
|
2
|
+
export declare const initModuleFederationSharing: ({ scope, name, plugins }: {
|
|
3
|
+
/**
|
|
4
|
+
* Module Federation scope; should be identical to the package name in package.json, formatted in snake_case.
|
|
5
|
+
*/
|
|
6
|
+
scope: string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use `scope` instead
|
|
9
|
+
*/
|
|
10
|
+
name?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Additional runtime plugins
|
|
13
|
+
*/
|
|
14
|
+
plugins: ModuleFederationRuntimePlugin[];
|
|
4
15
|
}) => void;
|