chayns-api 3.7.0-beta.1 → 3.7.0-beta.2

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.
@@ -13,6 +13,12 @@ var _injectExternalRuntimeCorePlugin = _interopRequireDefault(require("@module-f
13
13
  var _ManifestShareScopePlugin = require("../plugins/ManifestShareScopePlugin");
14
14
  var _SequentialLoadPlugin = require("../plugins/SequentialLoadPlugin");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ let ReactCompilerRuntime;
17
+ try {
18
+ ReactCompilerRuntime = require('react/compiler-runtime');
19
+ } catch {
20
+ ReactCompilerRuntime = null;
21
+ }
16
22
  const ERROR_CACHE_TIME = 60000;
17
23
  const normalizeUrl = url => {
18
24
  try {
@@ -109,6 +115,13 @@ const initModuleFederationSharing = ({
109
115
  lib: () => _jsxRuntime.default
110
116
  }
111
117
  };
118
+ if (ReactCompilerRuntime) {
119
+ shared['react/compiler-runtime'] = {
120
+ version: _react.default.version,
121
+ scope: [`chayns-react-${_react.default.version}`, 'chayns-api'],
122
+ lib: () => ReactCompilerRuntime
123
+ };
124
+ }
112
125
  const instance = createInstance({
113
126
  name: (_ref = scope !== null && scope !== void 0 ? scope : name) !== null && _ref !== void 0 ? _ref : '',
114
127
  remotes: [],
@@ -6,6 +6,12 @@ import ReactDOMServer from 'react-dom/server';
6
6
  import injectExternalRuntimeCodePlugin from '@module-federation/inject-external-runtime-core-plugin';
7
7
  import { ManifestShareScopePlugin } from '../plugins/ManifestShareScopePlugin';
8
8
  import { SequentialLoadPlugin } from '../plugins/SequentialLoadPlugin';
9
+ let ReactCompilerRuntime;
10
+ try {
11
+ ReactCompilerRuntime = require('react/compiler-runtime');
12
+ } catch {
13
+ ReactCompilerRuntime = null;
14
+ }
9
15
  const ERROR_CACHE_TIME = 60000;
10
16
  const normalizeUrl = url => {
11
17
  try {
@@ -102,6 +108,13 @@ export const initModuleFederationSharing = ({
102
108
  lib: () => JSXRuntime
103
109
  }
104
110
  };
111
+ if (ReactCompilerRuntime) {
112
+ shared['react/compiler-runtime'] = {
113
+ version: React.version,
114
+ scope: [`chayns-react-${React.version}`, 'chayns-api'],
115
+ lib: () => ReactCompilerRuntime
116
+ };
117
+ }
105
118
  const instance = createInstance({
106
119
  name: (_ref = scope !== null && scope !== void 0 ? scope : name) !== null && _ref !== void 0 ? _ref : '',
107
120
  remotes: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "3.7.0-beta.1",
3
+ "version": "3.7.0-beta.2",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",