chayns-api 1.2.0-7 → 1.2.0-9

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.
@@ -22,6 +22,7 @@ const loadModule = (scope, module, url, preventSingleton = false) => {
22
22
  console.error(`[chayns-api] call registerRemote with force for scope ${scope}. url: ${url}`);
23
23
  }
24
24
  registerRemotes([{
25
+ shareScope: 'chayns-api2',
25
26
  name: scope,
26
27
  entry: url,
27
28
  alias: scope
@@ -72,6 +73,7 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
72
73
  loadShareSync('react', {
73
74
  resolver: shareOptions => {
74
75
  resolve(shareOptions);
76
+ console.log("shareOptions", shareOptions);
75
77
  return shareOptions[0];
76
78
  }
77
79
  });
@@ -83,10 +85,12 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
83
85
  return _semver.default.gt(version, hostVersion) && _semver.default.satisfies(version, requiredVersion) || scope === from.split('-').join('_');
84
86
  });
85
87
  if (!matchReactVersion || environment !== 'production' || process.env.NODE_ENV === 'development' || Module.default.version !== 2) {
88
+ console.log("use compat mode for", scope, module);
86
89
  return {
87
90
  default: Module.default.CompatComponent
88
91
  };
89
92
  }
93
+ console.log("use direct component for", scope, module);
90
94
  return {
91
95
  default: Module.default.Component
92
96
  };
@@ -29,12 +29,12 @@ const initModuleFederationSharing = () => {
29
29
  shared: {
30
30
  react: {
31
31
  version: _react.default.version,
32
- scope: 'default',
32
+ scope: 'chayns-api2',
33
33
  lib: () => _react.default
34
34
  },
35
35
  'react-dom': {
36
36
  version: _reactDom.default.version,
37
- scope: 'default',
37
+ scope: 'chayns-api2',
38
38
  lib: () => _reactDom.default
39
39
  }
40
40
  }
@@ -16,6 +16,7 @@ export const loadModule = function (scope, module, url) {
16
16
  console.error(`[chayns-api] call registerRemote with force for scope ${scope}. url: ${url}`);
17
17
  }
18
18
  registerRemotes([{
19
+ shareScope: 'chayns-api2',
19
20
  name: scope,
20
21
  entry: url,
21
22
  alias: scope
@@ -67,6 +68,7 @@ const loadComponent = function (scope, module, url) {
67
68
  loadShareSync('react', {
68
69
  resolver: shareOptions => {
69
70
  resolve(shareOptions);
71
+ console.log("shareOptions", shareOptions);
70
72
  return shareOptions[0];
71
73
  }
72
74
  });
@@ -79,10 +81,12 @@ const loadComponent = function (scope, module, url) {
79
81
  return semver.gt(version, hostVersion) && semver.satisfies(version, requiredVersion) || scope === from.split('-').join('_');
80
82
  });
81
83
  if (!matchReactVersion || environment !== 'production' || process.env.NODE_ENV === 'development' || Module.default.version !== 2) {
84
+ console.log("use compat mode for", scope, module);
82
85
  return {
83
86
  default: Module.default.CompatComponent
84
87
  };
85
88
  }
89
+ console.log("use direct component for", scope, module);
86
90
  return {
87
91
  default: Module.default.Component
88
92
  };
@@ -22,12 +22,12 @@ export const initModuleFederationSharing = () => {
22
22
  shared: {
23
23
  react: {
24
24
  version: React.version,
25
- scope: 'default',
25
+ scope: 'chayns-api2',
26
26
  lib: () => React
27
27
  },
28
28
  'react-dom': {
29
29
  version: ReactDOM.version,
30
- scope: 'default',
30
+ scope: 'chayns-api2',
31
31
  lib: () => ReactDOM
32
32
  }
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "1.2.0-7",
3
+ "version": "1.2.0-9",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",