@modern-js/plugin-garfish 1.4.11 → 1.4.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @modern-js/plugin-garfish
2
2
 
3
+ ## 1.4.13
4
+
5
+ ### Patch Changes
6
+
7
+ - a37960018: fix: default config \_SERVER_DATA to insulationVariable and set disableCssExtract to be true
8
+ - Updated dependencies [b8cfc42cd]
9
+ - Updated dependencies [804a5bb8a]
10
+ - @modern-js/utils@1.7.4
11
+ - @modern-js/plugin-router@1.2.14
12
+
3
13
  ## 1.4.11
4
14
 
5
15
  ### Patch Changes
@@ -12,6 +12,20 @@ export const externals = {
12
12
  'react-dom': 'react-dom',
13
13
  react: 'react'
14
14
  };
15
+ export function getDefaultMicroFrontedConfig(microFrontend) {
16
+ if (microFrontend === true) {
17
+ return {
18
+ enableHtmlEntry: true,
19
+ externalBasicLibrary: false,
20
+ moduleApp: ''
21
+ };
22
+ }
23
+
24
+ return _objectSpread({
25
+ enableHtmlEntry: true,
26
+ externalBasicLibrary: false
27
+ }, microFrontend);
28
+ }
15
29
  export default (({
16
30
  runtimePluginName: _runtimePluginName = '@modern-js/runtime/plugins',
17
31
  mfPackagePath: _mfPackagePath = path.resolve(__dirname, '../../../../')
@@ -19,7 +33,8 @@ export default (({
19
33
  name: '@modern-js/plugin-garfish',
20
34
  setup: ({
21
35
  useAppContext,
22
- useResolvedConfigContext
36
+ useResolvedConfigContext,
37
+ useConfigContext
23
38
  }) => {
24
39
  let pluginsExportsUtils;
25
40
  let runtimeExportsUtils;
@@ -50,6 +65,7 @@ export default (({
50
65
  }
51
66
 
52
67
  logger(`resolvedConfig`, {
68
+ output: nConfig.resolved.output,
53
69
  runtime: nConfig.resolved.runtime,
54
70
  deploy: nConfig.resolved.deploy,
55
71
  server: nConfig.resolved.server
@@ -58,13 +74,33 @@ export default (({
58
74
  },
59
75
 
60
76
  config() {
77
+ var _useConfig$output$dis, _useConfig$output, _useConfig$deploy;
78
+
61
79
  // eslint-disable-next-line react-hooks/rules-of-hooks
62
- const config = useAppContext(); // eslint-disable-next-line react-hooks/rules-of-hooks
80
+ const useConfig = useConfigContext();
81
+ logger('useConfig', useConfig); // eslint-disable-next-line react-hooks/rules-of-hooks
63
82
 
64
- const resolveOptions = useResolvedConfigContext();
83
+ const config = useAppContext();
65
84
  pluginsExportsUtils = createRuntimeExportsUtils(config.internalDirectory, 'plugins');
66
85
  runtimeExportsUtils = createRuntimeExportsUtils(config.internalDirectory, 'index');
86
+ let disableCssExtract = (_useConfig$output$dis = (_useConfig$output = useConfig.output) === null || _useConfig$output === void 0 ? void 0 : _useConfig$output.disableCssExtract) !== null && _useConfig$output$dis !== void 0 ? _useConfig$output$dis : false; // When the micro-frontend application js entry, there is no need to extract css, close cssExtract
87
+
88
+ if ((_useConfig$deploy = useConfig.deploy) !== null && _useConfig$deploy !== void 0 && _useConfig$deploy.microFrontend) {
89
+ var _useConfig$deploy2;
90
+
91
+ const {
92
+ enableHtmlEntry
93
+ } = getDefaultMicroFrontedConfig((_useConfig$deploy2 = useConfig.deploy) === null || _useConfig$deploy2 === void 0 ? void 0 : _useConfig$deploy2.microFrontend);
94
+
95
+ if (!enableHtmlEntry) {
96
+ disableCssExtract = true;
97
+ }
98
+ }
99
+
67
100
  return {
101
+ output: {
102
+ disableCssExtract
103
+ },
68
104
  source: {
69
105
  alias: {
70
106
  '@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
@@ -83,8 +119,11 @@ export default (({
83
119
  }) => {
84
120
  var _resolveOptions$deplo, _resolveWebpackConfig;
85
121
 
122
+ // eslint-disable-next-line react-hooks/rules-of-hooks
123
+ const resolveOptions = useResolvedConfigContext();
124
+
86
125
  if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$deplo = resolveOptions.deploy) !== null && _resolveOptions$deplo !== void 0 && _resolveOptions$deplo.microFrontend) {
87
- var _resolveOptions$serve, _resolveOptions$deplo2, _resolveOptions$deplo3;
126
+ var _resolveOptions$serve, _resolveOptions$deplo2;
88
127
 
89
128
  chain.output.libraryTarget('umd');
90
129
 
@@ -100,9 +139,9 @@ export default (({
100
139
  }
101
140
 
102
141
  const {
103
- enableHtmlEntry = true,
104
- externalBasicLibrary = false
105
- } = typeof (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions$deplo2 = resolveOptions.deploy) === null || _resolveOptions$deplo2 === void 0 ? void 0 : _resolveOptions$deplo2.microFrontend) === 'object' ? resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions$deplo3 = resolveOptions.deploy) === null || _resolveOptions$deplo3 === void 0 ? void 0 : _resolveOptions$deplo3.microFrontend : {}; // external
142
+ enableHtmlEntry,
143
+ externalBasicLibrary
144
+ } = getDefaultMicroFrontedConfig((_resolveOptions$deplo2 = resolveOptions.deploy) === null || _resolveOptions$deplo2 === void 0 ? void 0 : _resolveOptions$deplo2.microFrontend); // external
106
145
 
107
146
  if (externalBasicLibrary) {
108
147
  chain.externals(externals);
@@ -124,7 +163,8 @@ export default (({
124
163
  output: resolveWebpackConfig.output,
125
164
  externals: resolveWebpackConfig.externals,
126
165
  env: _env,
127
- alias: (_resolveWebpackConfig = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig === void 0 ? void 0 : _resolveWebpackConfig.alias
166
+ alias: (_resolveWebpackConfig = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig === void 0 ? void 0 : _resolveWebpackConfig.alias,
167
+ plugins: resolveWebpackConfig.plugins
128
168
  });
129
169
  }
130
170
  }
@@ -48,7 +48,7 @@ export function generateMApp(options, manifest) {
48
48
  listening: true
49
49
  });
50
50
 
51
- const garfishOptions = _objectSpread({
51
+ const garfishOptions = _objectSpread(_objectSpread({
52
52
  domGetter: `#${domId}`,
53
53
 
54
54
  beforeLoad(...args) {
@@ -92,7 +92,9 @@ export function generateMApp(options, manifest) {
92
92
  return errorUnmountApp === null || errorUnmountApp === void 0 ? void 0 : errorUnmountApp(error, ...args);
93
93
  }
94
94
 
95
- }, otherOptions);
95
+ }, otherOptions), {}, {
96
+ insulationVariable: [...(otherOptions.insulationVariable || []), '_SERVER_DATA']
97
+ });
96
98
 
97
99
  logger('MApp componentDidMount', {
98
100
  garfishRunning: Garfish.running,
@@ -57,6 +57,7 @@ function getAppInstance(options, appInfo, manifest) {
57
57
  } = this.state;
58
58
 
59
59
  const loadAppOptions = _objectSpread(_objectSpread({}, appInfo), {}, {
60
+ insulationVariable: [...(appInfo.insulationVariable || []), '_SERVER_DATA'],
60
61
  domGetter: `#${domId}`,
61
62
  basename: path.join((options === null || options === void 0 ? void 0 : options.basename) || '/', (match === null || match === void 0 ? void 0 : match.path) || '/'),
62
63
  cache: true,
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.externals = exports.default = void 0;
7
+ exports.getDefaultMicroFrontedConfig = getDefaultMicroFrontedConfig;
7
8
 
8
9
  var _path = _interopRequireDefault(require("path"));
9
10
 
@@ -27,6 +28,21 @@ const externals = {
27
28
  };
28
29
  exports.externals = externals;
29
30
 
31
+ function getDefaultMicroFrontedConfig(microFrontend) {
32
+ if (microFrontend === true) {
33
+ return {
34
+ enableHtmlEntry: true,
35
+ externalBasicLibrary: false,
36
+ moduleApp: ''
37
+ };
38
+ }
39
+
40
+ return _objectSpread({
41
+ enableHtmlEntry: true,
42
+ externalBasicLibrary: false
43
+ }, microFrontend);
44
+ }
45
+
30
46
  var _default = ({
31
47
  runtimePluginName: _runtimePluginName = '@modern-js/runtime/plugins',
32
48
  mfPackagePath: _mfPackagePath = _path.default.resolve(__dirname, '../../../../')
@@ -34,7 +50,8 @@ var _default = ({
34
50
  name: '@modern-js/plugin-garfish',
35
51
  setup: ({
36
52
  useAppContext,
37
- useResolvedConfigContext
53
+ useResolvedConfigContext,
54
+ useConfigContext
38
55
  }) => {
39
56
  let pluginsExportsUtils;
40
57
  let runtimeExportsUtils;
@@ -65,6 +82,7 @@ var _default = ({
65
82
  }
66
83
 
67
84
  (0, _util.logger)(`resolvedConfig`, {
85
+ output: nConfig.resolved.output,
68
86
  runtime: nConfig.resolved.runtime,
69
87
  deploy: nConfig.resolved.deploy,
70
88
  server: nConfig.resolved.server
@@ -73,13 +91,33 @@ var _default = ({
73
91
  },
74
92
 
75
93
  config() {
94
+ var _useConfig$output$dis, _useConfig$output, _useConfig$deploy;
95
+
76
96
  // eslint-disable-next-line react-hooks/rules-of-hooks
77
- const config = useAppContext(); // eslint-disable-next-line react-hooks/rules-of-hooks
97
+ const useConfig = useConfigContext();
98
+ (0, _util.logger)('useConfig', useConfig); // eslint-disable-next-line react-hooks/rules-of-hooks
78
99
 
79
- const resolveOptions = useResolvedConfigContext();
100
+ const config = useAppContext();
80
101
  pluginsExportsUtils = (0, _utils.createRuntimeExportsUtils)(config.internalDirectory, 'plugins');
81
102
  runtimeExportsUtils = (0, _utils.createRuntimeExportsUtils)(config.internalDirectory, 'index');
103
+ let disableCssExtract = (_useConfig$output$dis = (_useConfig$output = useConfig.output) === null || _useConfig$output === void 0 ? void 0 : _useConfig$output.disableCssExtract) !== null && _useConfig$output$dis !== void 0 ? _useConfig$output$dis : false; // When the micro-frontend application js entry, there is no need to extract css, close cssExtract
104
+
105
+ if ((_useConfig$deploy = useConfig.deploy) !== null && _useConfig$deploy !== void 0 && _useConfig$deploy.microFrontend) {
106
+ var _useConfig$deploy2;
107
+
108
+ const {
109
+ enableHtmlEntry
110
+ } = getDefaultMicroFrontedConfig((_useConfig$deploy2 = useConfig.deploy) === null || _useConfig$deploy2 === void 0 ? void 0 : _useConfig$deploy2.microFrontend);
111
+
112
+ if (!enableHtmlEntry) {
113
+ disableCssExtract = true;
114
+ }
115
+ }
116
+
82
117
  return {
118
+ output: {
119
+ disableCssExtract
120
+ },
83
121
  source: {
84
122
  alias: {
85
123
  '@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
@@ -98,8 +136,11 @@ var _default = ({
98
136
  }) => {
99
137
  var _resolveOptions$deplo, _resolveWebpackConfig;
100
138
 
139
+ // eslint-disable-next-line react-hooks/rules-of-hooks
140
+ const resolveOptions = useResolvedConfigContext();
141
+
101
142
  if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$deplo = resolveOptions.deploy) !== null && _resolveOptions$deplo !== void 0 && _resolveOptions$deplo.microFrontend) {
102
- var _resolveOptions$serve, _resolveOptions$deplo2, _resolveOptions$deplo3;
143
+ var _resolveOptions$serve, _resolveOptions$deplo2;
103
144
 
104
145
  chain.output.libraryTarget('umd');
105
146
 
@@ -115,9 +156,9 @@ var _default = ({
115
156
  }
116
157
 
117
158
  const {
118
- enableHtmlEntry = true,
119
- externalBasicLibrary = false
120
- } = typeof (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions$deplo2 = resolveOptions.deploy) === null || _resolveOptions$deplo2 === void 0 ? void 0 : _resolveOptions$deplo2.microFrontend) === 'object' ? resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions$deplo3 = resolveOptions.deploy) === null || _resolveOptions$deplo3 === void 0 ? void 0 : _resolveOptions$deplo3.microFrontend : {}; // external
159
+ enableHtmlEntry,
160
+ externalBasicLibrary
161
+ } = getDefaultMicroFrontedConfig((_resolveOptions$deplo2 = resolveOptions.deploy) === null || _resolveOptions$deplo2 === void 0 ? void 0 : _resolveOptions$deplo2.microFrontend); // external
121
162
 
122
163
  if (externalBasicLibrary) {
123
164
  chain.externals(externals);
@@ -139,7 +180,8 @@ var _default = ({
139
180
  output: resolveWebpackConfig.output,
140
181
  externals: resolveWebpackConfig.externals,
141
182
  env: _env,
142
- alias: (_resolveWebpackConfig = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig === void 0 ? void 0 : _resolveWebpackConfig.alias
183
+ alias: (_resolveWebpackConfig = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig === void 0 ? void 0 : _resolveWebpackConfig.alias,
184
+ plugins: resolveWebpackConfig.plugins
143
185
  });
144
186
  }
145
187
  }
@@ -61,7 +61,7 @@ function generateMApp(options, manifest) {
61
61
  listening: true
62
62
  });
63
63
 
64
- const garfishOptions = _objectSpread({
64
+ const garfishOptions = _objectSpread(_objectSpread({
65
65
  domGetter: `#${domId}`,
66
66
 
67
67
  beforeLoad(...args) {
@@ -105,7 +105,9 @@ function generateMApp(options, manifest) {
105
105
  return errorUnmountApp === null || errorUnmountApp === void 0 ? void 0 : errorUnmountApp(error, ...args);
106
106
  }
107
107
 
108
- }, otherOptions);
108
+ }, otherOptions), {}, {
109
+ insulationVariable: [...(otherOptions.insulationVariable || []), '_SERVER_DATA']
110
+ });
109
111
 
110
112
  (0, _util.logger)('MApp componentDidMount', {
111
113
  garfishRunning: _garfish.default.running,
@@ -63,6 +63,7 @@ function getAppInstance(options, appInfo, manifest) {
63
63
  } = this.state;
64
64
 
65
65
  const loadAppOptions = _objectSpread(_objectSpread({}, appInfo), {}, {
66
+ insulationVariable: [...(appInfo.insulationVariable || []), '_SERVER_DATA'],
66
67
  domGetter: `#${domId}`,
67
68
  basename: _path.default.join((options === null || options === void 0 ? void 0 : options.basename) || '/', (match === null || match === void 0 ? void 0 : match.path) || '/'),
68
69
  cache: true,
@@ -1,6 +1,6 @@
1
1
  import _typeof from "@babel/runtime/helpers/esm/typeof";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import path from 'path';
6
6
  import { createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
@@ -10,6 +10,20 @@ export var externals = {
10
10
  'react-dom': 'react-dom',
11
11
  react: 'react'
12
12
  };
13
+ export function getDefaultMicroFrontedConfig(microFrontend) {
14
+ if (microFrontend === true) {
15
+ return {
16
+ enableHtmlEntry: true,
17
+ externalBasicLibrary: false,
18
+ moduleApp: ''
19
+ };
20
+ }
21
+
22
+ return _objectSpread({
23
+ enableHtmlEntry: true,
24
+ externalBasicLibrary: false
25
+ }, microFrontend);
26
+ }
13
27
  export default (function () {
14
28
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
15
29
  _ref$runtimePluginNam = _ref.runtimePluginName,
@@ -21,7 +35,8 @@ export default (function () {
21
35
  name: '@modern-js/plugin-garfish',
22
36
  setup: function setup(_ref2) {
23
37
  var useAppContext = _ref2.useAppContext,
24
- useResolvedConfigContext = _ref2.useResolvedConfigContext;
38
+ useResolvedConfigContext = _ref2.useResolvedConfigContext,
39
+ useConfigContext = _ref2.useConfigContext;
25
40
  var pluginsExportsUtils;
26
41
  var runtimeExportsUtils;
27
42
  return {
@@ -50,6 +65,7 @@ export default (function () {
50
65
  }
51
66
 
52
67
  logger("resolvedConfig", {
68
+ output: nConfig.resolved.output,
53
69
  runtime: nConfig.resolved.runtime,
54
70
  deploy: nConfig.resolved.deploy,
55
71
  server: nConfig.resolved.server
@@ -71,13 +87,32 @@ export default (function () {
71
87
  return resolvedConfig;
72
88
  }(),
73
89
  config: function config() {
90
+ var _useConfig$output$dis, _useConfig$output, _useConfig$deploy;
91
+
74
92
  // eslint-disable-next-line react-hooks/rules-of-hooks
75
- var config = useAppContext(); // eslint-disable-next-line react-hooks/rules-of-hooks
93
+ var useConfig = useConfigContext();
94
+ logger('useConfig', useConfig); // eslint-disable-next-line react-hooks/rules-of-hooks
76
95
 
77
- var resolveOptions = useResolvedConfigContext();
96
+ var config = useAppContext();
78
97
  pluginsExportsUtils = createRuntimeExportsUtils(config.internalDirectory, 'plugins');
79
98
  runtimeExportsUtils = createRuntimeExportsUtils(config.internalDirectory, 'index');
99
+ var disableCssExtract = (_useConfig$output$dis = (_useConfig$output = useConfig.output) === null || _useConfig$output === void 0 ? void 0 : _useConfig$output.disableCssExtract) !== null && _useConfig$output$dis !== void 0 ? _useConfig$output$dis : false; // When the micro-frontend application js entry, there is no need to extract css, close cssExtract
100
+
101
+ if ((_useConfig$deploy = useConfig.deploy) !== null && _useConfig$deploy !== void 0 && _useConfig$deploy.microFrontend) {
102
+ var _useConfig$deploy2;
103
+
104
+ var _getDefaultMicroFront = getDefaultMicroFrontedConfig((_useConfig$deploy2 = useConfig.deploy) === null || _useConfig$deploy2 === void 0 ? void 0 : _useConfig$deploy2.microFrontend),
105
+ enableHtmlEntry = _getDefaultMicroFront.enableHtmlEntry;
106
+
107
+ if (!enableHtmlEntry) {
108
+ disableCssExtract = true;
109
+ }
110
+ }
111
+
80
112
  return {
113
+ output: {
114
+ disableCssExtract: disableCssExtract
115
+ },
81
116
  source: {
82
117
  alias: {
83
118
  '@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
@@ -96,9 +131,11 @@ export default (function () {
96
131
  _webpack = _ref3.webpack,
97
132
  _ref3$env = _ref3.env,
98
133
  env = _ref3$env === void 0 ? process.env.NODE_ENV || 'development' : _ref3$env;
134
+ // eslint-disable-next-line react-hooks/rules-of-hooks
135
+ var resolveOptions = useResolvedConfigContext();
99
136
 
100
137
  if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$deplo = resolveOptions.deploy) !== null && _resolveOptions$deplo !== void 0 && _resolveOptions$deplo.microFrontend) {
101
- var _resolveOptions$serve, _resolveOptions$deplo2, _resolveOptions$deplo3;
138
+ var _resolveOptions$serve, _resolveOptions$deplo2;
102
139
 
103
140
  chain.output.libraryTarget('umd');
104
141
 
@@ -113,11 +150,9 @@ export default (function () {
113
150
  }]);
114
151
  }
115
152
 
116
- var _ref4 = _typeof(resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions$deplo2 = resolveOptions.deploy) === null || _resolveOptions$deplo2 === void 0 ? void 0 : _resolveOptions$deplo2.microFrontend) === 'object' ? resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions$deplo3 = resolveOptions.deploy) === null || _resolveOptions$deplo3 === void 0 ? void 0 : _resolveOptions$deplo3.microFrontend : {},
117
- _ref4$enableHtmlEntry = _ref4.enableHtmlEntry,
118
- enableHtmlEntry = _ref4$enableHtmlEntry === void 0 ? true : _ref4$enableHtmlEntry,
119
- _ref4$externalBasicLi = _ref4.externalBasicLibrary,
120
- externalBasicLibrary = _ref4$externalBasicLi === void 0 ? false : _ref4$externalBasicLi; // external
153
+ var _getDefaultMicroFront2 = getDefaultMicroFrontedConfig((_resolveOptions$deplo2 = resolveOptions.deploy) === null || _resolveOptions$deplo2 === void 0 ? void 0 : _resolveOptions$deplo2.microFrontend),
154
+ _enableHtmlEntry = _getDefaultMicroFront2.enableHtmlEntry,
155
+ externalBasicLibrary = _getDefaultMicroFront2.externalBasicLibrary; // external
121
156
 
122
157
 
123
158
  if (externalBasicLibrary) {
@@ -125,7 +160,7 @@ export default (function () {
125
160
  } // use html mode
126
161
 
127
162
 
128
- if (!enableHtmlEntry) {
163
+ if (!_enableHtmlEntry) {
129
164
  chain.output.filename('index.js');
130
165
  chain.plugins["delete"]('html-main');
131
166
  chain.optimization.runtimeChunk(false);
@@ -140,7 +175,8 @@ export default (function () {
140
175
  output: resolveWebpackConfig.output,
141
176
  externals: resolveWebpackConfig.externals,
142
177
  env: env,
143
- alias: (_resolveWebpackConfig = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig === void 0 ? void 0 : _resolveWebpackConfig.alias
178
+ alias: (_resolveWebpackConfig = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig === void 0 ? void 0 : _resolveWebpackConfig.alias,
179
+ plugins: resolveWebpackConfig.plugins
144
180
  });
145
181
  }
146
182
  }
@@ -152,9 +188,9 @@ export default (function () {
152
188
  pluginsExportsUtils.addExport(addExportStatement);
153
189
  runtimeExportsUtils.addExport("export * from '".concat(mfPackagePath, "'"));
154
190
  },
155
- modifyEntryImports: function modifyEntryImports(_ref5) {
156
- var entrypoint = _ref5.entrypoint,
157
- imports = _ref5.imports;
191
+ modifyEntryImports: function modifyEntryImports(_ref4) {
192
+ var entrypoint = _ref4.entrypoint,
193
+ imports = _ref4.imports;
158
194
  // eslint-disable-next-line react-hooks/rules-of-hooks
159
195
  var config = useResolvedConfigContext();
160
196
 
@@ -189,9 +225,9 @@ export default (function () {
189
225
  entrypoint: entrypoint
190
226
  };
191
227
  },
192
- modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref6) {
193
- var entrypoint = _ref6.entrypoint,
194
- plugins = _ref6.plugins;
228
+ modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref5) {
229
+ var entrypoint = _ref5.entrypoint,
230
+ plugins = _ref5.plugins;
195
231
  // eslint-disable-next-line react-hooks/rules-of-hooks
196
232
  var config = useResolvedConfigContext();
197
233
 
@@ -212,11 +248,11 @@ export default (function () {
212
248
  plugins: plugins
213
249
  };
214
250
  },
215
- modifyEntryRenderFunction: function modifyEntryRenderFunction(_ref7) {
251
+ modifyEntryRenderFunction: function modifyEntryRenderFunction(_ref6) {
216
252
  var _config$deploy;
217
253
 
218
- var entrypoint = _ref7.entrypoint,
219
- code = _ref7.code;
254
+ var entrypoint = _ref6.entrypoint,
255
+ code = _ref6.code;
220
256
  // eslint-disable-next-line react-hooks/rules-of-hooks
221
257
  var config = useResolvedConfigContext();
222
258
 
@@ -234,11 +270,11 @@ export default (function () {
234
270
  code: nCode
235
271
  };
236
272
  },
237
- modifyEntryExport: function modifyEntryExport(_ref8) {
273
+ modifyEntryExport: function modifyEntryExport(_ref7) {
238
274
  var _config$deploy2;
239
275
 
240
- var entrypoint = _ref8.entrypoint,
241
- exportStatement = _ref8.exportStatement;
276
+ var entrypoint = _ref7.entrypoint,
277
+ exportStatement = _ref7.exportStatement;
242
278
  // eslint-disable-next-line react-hooks/rules-of-hooks
243
279
  var config = useResolvedConfigContext();
244
280
 
@@ -1,3 +1,4 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
@@ -55,7 +56,7 @@ export function generateMApp(options, manifest) {
55
56
  listening: true
56
57
  });
57
58
 
58
- var garfishOptions = _objectSpread({
59
+ var garfishOptions = _objectSpread(_objectSpread({
59
60
  domGetter: "#".concat(domId),
60
61
  beforeLoad: function beforeLoad() {
61
62
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
@@ -113,7 +114,9 @@ export function generateMApp(options, manifest) {
113
114
  });
114
115
  return _errorUnmountApp === null || _errorUnmountApp === void 0 ? void 0 : _errorUnmountApp.apply(void 0, [error].concat(args));
115
116
  }
116
- }, otherOptions);
117
+ }, otherOptions), {}, {
118
+ insulationVariable: [].concat(_toConsumableArray(otherOptions.insulationVariable || []), ['_SERVER_DATA'])
119
+ });
117
120
 
118
121
  logger('MApp componentDidMount', {
119
122
  garfishRunning: Garfish.running,
@@ -1,3 +1,4 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
4
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
@@ -69,6 +70,7 @@ function getAppInstance(options, appInfo, manifest) {
69
70
  _this$props = this.props, match = _this$props.match, history = _this$props.history, setLoadingState = _this$props.setLoadingState, userProps = _objectWithoutProperties(_this$props, _excluded);
70
71
  domId = this.state.domId;
71
72
  loadAppOptions = _objectSpread(_objectSpread({}, appInfo), {}, {
73
+ insulationVariable: [].concat(_toConsumableArray(appInfo.insulationVariable || []), ['_SERVER_DATA']),
72
74
  domGetter: "#".concat(domId),
73
75
  basename: path.join((options === null || options === void 0 ? void 0 : options.basename) || '/', (match === null || match === void 0 ? void 0 : match.path) || '/'),
74
76
  cache: true,
@@ -1,9 +1,16 @@
1
- import type { CliHookCallbacks, CliPlugin } from '@modern-js/core';
1
+ import type { CliHookCallbacks, CliPlugin, useConfigContext } from '@modern-js/core';
2
+ export declare type UseConfig = ReturnType<typeof useConfigContext>;
2
3
  export declare const externals: {
3
4
  'react-dom': string;
4
5
  react: string;
5
6
  };
6
7
  export declare type LifeCycle = CliHookCallbacks;
8
+ declare type NonInValidAble<T> = T extends null | undefined | false ? never : T;
9
+ export declare function getDefaultMicroFrontedConfig(microFrontend: NonInValidAble<NonNullable<UseConfig['deploy']>['microFrontend']>): {
10
+ enableHtmlEntry: boolean;
11
+ externalBasicLibrary: boolean;
12
+ moduleApp?: string | undefined;
13
+ };
7
14
 
8
15
  declare const _default: ({
9
16
  runtimePluginName,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.11",
14
+ "version": "1.4.13",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/runtime/index.d.ts",
17
17
  "typesVersions": {
@@ -50,16 +50,16 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@babel/runtime": "^7",
53
- "@modern-js/utils": "^1.7.3",
53
+ "@modern-js/utils": "^1.7.4",
54
54
  "@types/debug": "^4.1.7",
55
55
  "@types/react-loadable": "^5.5.6",
56
56
  "debug": "^4.3.2",
57
- "garfish": "^1.3.3",
57
+ "garfish": "^1.5.5",
58
58
  "hoist-non-react-statics": "^3.3.2",
59
59
  "react-loadable": "^5.5.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@modern-js/core": "1.10.2",
62
+ "@modern-js/core": "1.10.3",
63
63
  "@modern-js/plugin-router": "1.2.14",
64
64
  "@modern-js/runtime-core": "1.4.6",
65
65
  "@modern-js/types": "1.5.3",
@@ -91,7 +91,8 @@
91
91
  "modernConfig": {},
92
92
  "publishConfig": {
93
93
  "registry": "https://registry.npmjs.org/",
94
- "access": "public"
94
+ "access": "public",
95
+ "types": "./dist/types/runtime/index.d.ts"
95
96
  },
96
97
  "wireit": {
97
98
  "build": {
@@ -110,7 +111,8 @@
110
111
  "files": [
111
112
  "src/**/*",
112
113
  "tsconfig.json",
113
- "package.json"
114
+ "package.json",
115
+ "tests/**/*"
114
116
  ],
115
117
  "output": []
116
118
  }