chayns-api 1.2.0-2 → 1.2.0-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.
@@ -12,6 +12,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  if (!globalThis.moduleFederationRuntime) {
13
13
  var _process$env$__PACKAG;
14
14
  globalThis.moduleFederationRuntime = require('@module-federation/runtime');
15
+ globalThis.moduleFederationScopes = {
16
+ registeredScopes: {},
17
+ moduleMap: {},
18
+ componentMap: {}
19
+ };
15
20
  const {
16
21
  init
17
22
  } = globalThis.moduleFederationRuntime;
@@ -40,9 +45,11 @@ const {
40
45
  registerRemotes,
41
46
  loadShareSync
42
47
  } = globalThis.moduleFederationRuntime;
43
- const registeredScopes = {};
44
- const moduleMap = {};
45
- const componentMap = {};
48
+ const {
49
+ registeredScopes,
50
+ moduleMap,
51
+ componentMap
52
+ } = globalThis.moduleFederationScopes;
46
53
  const loadModule = (scope, module, url, preventSingleton = false) => {
47
54
  if (registeredScopes[scope] !== url || preventSingleton) {
48
55
  if (scope in registeredScopes) {
@@ -6,6 +6,11 @@ import React from 'react';
6
6
  if (!globalThis.moduleFederationRuntime) {
7
7
  var _process$env$__PACKAG;
8
8
  globalThis.moduleFederationRuntime = require('@module-federation/runtime');
9
+ globalThis.moduleFederationScopes = {
10
+ registeredScopes: {},
11
+ moduleMap: {},
12
+ componentMap: {}
13
+ };
9
14
  const {
10
15
  init
11
16
  } = globalThis.moduleFederationRuntime;
@@ -34,9 +39,11 @@ const {
34
39
  registerRemotes,
35
40
  loadShareSync
36
41
  } = globalThis.moduleFederationRuntime;
37
- const registeredScopes = {};
38
- const moduleMap = {};
39
- const componentMap = {};
42
+ const {
43
+ registeredScopes,
44
+ moduleMap,
45
+ componentMap
46
+ } = globalThis.moduleFederationScopes;
40
47
  export const loadModule = function (scope, module, url) {
41
48
  let preventSingleton = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
42
49
  if (registeredScopes[scope] !== url || preventSingleton) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "1.2.0-2",
3
+ "version": "1.2.0-3",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",