@modern-js/plugin-garfish 2.4.0 → 2.4.1-beta.0
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 +10 -0
- package/dist/js/treeshaking/cli/index.js +22 -22
- package/dist/js/treeshaking/cli/utils.js +6 -6
- package/dist/js/treeshaking/runtime/loadable.js +5 -5
- package/dist/js/treeshaking/runtime/plugin.js +7 -7
- package/dist/js/treeshaking/runtime/useModuleApps.js +1 -1
- package/dist/js/treeshaking/runtime/utils/MApp.js +3 -3
- package/dist/js/treeshaking/runtime/utils/apps.js +12 -12
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @modern-js/plugin-garfish
|
|
2
2
|
|
|
3
|
+
## 2.4.1-beta.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [7a25271]
|
|
8
|
+
- Updated dependencies [11c053b]
|
|
9
|
+
- Updated dependencies [a0f2ab1]
|
|
10
|
+
- @modern-js/runtime@2.4.1-beta.0
|
|
11
|
+
- @modern-js/utils@2.4.1-beta.0
|
|
12
|
+
|
|
3
13
|
## 2.4.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -171,7 +171,7 @@ function getDefaultMicroFrontedConfig(microFrontend) {
|
|
|
171
171
|
}, microFrontend);
|
|
172
172
|
}
|
|
173
173
|
var cli_default = function() {
|
|
174
|
-
var
|
|
174
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_pluginName = _ref.pluginName, pluginName = _ref_pluginName === void 0 ? "@modern-js/plugin-garfish" : _ref_pluginName, _ref_runtimePluginName = _ref.runtimePluginName, runtimePluginName = _ref_runtimePluginName === void 0 ? "@modern-js/runtime/plugins" : _ref_runtimePluginName;
|
|
175
175
|
return {
|
|
176
176
|
name: "@modern-js/plugin-garfish",
|
|
177
177
|
setup: function(param) {
|
|
@@ -183,22 +183,22 @@ var cli_default = function() {
|
|
|
183
183
|
},
|
|
184
184
|
resolvedConfig: function() {
|
|
185
185
|
var _ref = _asyncToGenerator(function(config) {
|
|
186
|
-
var resolved,
|
|
186
|
+
var resolved, _getRuntimeConfig, masterApp, router, nConfig, _useConfig_server, _router_historyOptions, useConfig, baseUrl;
|
|
187
187
|
return __generator(this, function(_state) {
|
|
188
188
|
resolved = config.resolved;
|
|
189
|
-
|
|
189
|
+
_getRuntimeConfig = getRuntimeConfig(resolved), masterApp = _getRuntimeConfig.masterApp, router = _getRuntimeConfig.router;
|
|
190
190
|
nConfig = {
|
|
191
191
|
resolved: _objectSpread({}, resolved)
|
|
192
192
|
};
|
|
193
193
|
if (masterApp) {
|
|
194
194
|
;
|
|
195
195
|
useConfig = useConfigContext();
|
|
196
|
-
baseUrl = useConfig === null || useConfig === void 0 ? void 0 : (
|
|
196
|
+
baseUrl = useConfig === null || useConfig === void 0 ? void 0 : (_useConfig_server = useConfig.server) === null || _useConfig_server === void 0 ? void 0 : _useConfig_server.baseUrl;
|
|
197
197
|
if (Array.isArray(baseUrl)) {
|
|
198
198
|
throw new Error("Now Micro-Front-End mode dose not support multiple baseUrl, you can set it as a string");
|
|
199
199
|
}
|
|
200
200
|
setRuntimeConfig(nConfig.resolved, "masterApp", Object.assign(typeof masterApp === "object" ? _objectSpread({}, masterApp) : {}, {
|
|
201
|
-
basename: baseUrl || (router === null || router === void 0 ? void 0 : (
|
|
201
|
+
basename: baseUrl || (router === null || router === void 0 ? void 0 : (_router_historyOptions = router.historyOptions) === null || _router_historyOptions === void 0 ? void 0 : _router_historyOptions.basename) || (router === null || router === void 0 ? void 0 : router.basename) || "/"
|
|
202
202
|
}));
|
|
203
203
|
}
|
|
204
204
|
logger("resolvedConfig", {
|
|
@@ -218,15 +218,15 @@ var cli_default = function() {
|
|
|
218
218
|
};
|
|
219
219
|
}(),
|
|
220
220
|
config: function config() {
|
|
221
|
-
var
|
|
221
|
+
var _useConfig_output, _useConfig_deploy;
|
|
222
222
|
var useConfig = useConfigContext();
|
|
223
223
|
logger("useConfig", useConfig);
|
|
224
224
|
var config = useAppContext();
|
|
225
225
|
pluginsExportsUtils = createRuntimeExportsUtils(config.internalDirectory, "plugins");
|
|
226
|
-
var disableCssExtract = ((
|
|
227
|
-
if ((
|
|
228
|
-
var
|
|
229
|
-
var enableHtmlEntry = getDefaultMicroFrontedConfig((
|
|
226
|
+
var disableCssExtract = ((_useConfig_output = useConfig.output) === null || _useConfig_output === void 0 ? void 0 : _useConfig_output.disableCssExtract) || false;
|
|
227
|
+
if ((_useConfig_deploy = useConfig.deploy) === null || _useConfig_deploy === void 0 ? void 0 : _useConfig_deploy.microFrontend) {
|
|
228
|
+
var _useConfig_deploy1;
|
|
229
|
+
var enableHtmlEntry = getDefaultMicroFrontedConfig((_useConfig_deploy1 = useConfig.deploy) === null || _useConfig_deploy1 === void 0 ? void 0 : _useConfig_deploy1.microFrontend).enableHtmlEntry;
|
|
230
230
|
if (!enableHtmlEntry) {
|
|
231
231
|
disableCssExtract = true;
|
|
232
232
|
}
|
|
@@ -249,12 +249,12 @@ var cli_default = function() {
|
|
|
249
249
|
},
|
|
250
250
|
webpackChain: function(chain, param) {
|
|
251
251
|
var webpack = param.webpack, env = param.env, CHAIN_ID = param.CHAIN_ID;
|
|
252
|
-
var
|
|
252
|
+
var _resolveOptions_deploy, _resolveWebpackConfig_resolve;
|
|
253
253
|
var resolveOptions = useResolvedConfigContext();
|
|
254
|
-
if (resolveOptions === null || resolveOptions === void 0 ? void 0 : (
|
|
255
|
-
var
|
|
254
|
+
if (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions_deploy = resolveOptions.deploy) === null || _resolveOptions_deploy === void 0 ? void 0 : _resolveOptions_deploy.microFrontend) {
|
|
255
|
+
var _useConfig_dev, _resolveOptions_server, _resolveOptions_deploy1;
|
|
256
256
|
chain.output.libraryTarget("umd");
|
|
257
|
-
if (!((
|
|
257
|
+
if (!((_useConfig_dev = useConfig.dev) === null || _useConfig_dev === void 0 ? void 0 : _useConfig_dev.assetPrefix) && (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions_server = resolveOptions.server) === null || _resolveOptions_server === void 0 ? void 0 : _resolveOptions_server.port) && env === "development") {
|
|
258
258
|
chain.output.publicPath("//localhost:".concat(resolveOptions.server.port, "/"));
|
|
259
259
|
}
|
|
260
260
|
if (webpack.BannerPlugin) {
|
|
@@ -264,7 +264,7 @@ var cli_default = function() {
|
|
|
264
264
|
}
|
|
265
265
|
]);
|
|
266
266
|
}
|
|
267
|
-
var
|
|
267
|
+
var _getDefaultMicroFrontedConfig = getDefaultMicroFrontedConfig((_resolveOptions_deploy1 = resolveOptions.deploy) === null || _resolveOptions_deploy1 === void 0 ? void 0 : _resolveOptions_deploy1.microFrontend), enableHtmlEntry = _getDefaultMicroFrontedConfig.enableHtmlEntry, externalBasicLibrary = _getDefaultMicroFrontedConfig.externalBasicLibrary;
|
|
268
268
|
if (externalBasicLibrary) {
|
|
269
269
|
chain.externals(externals);
|
|
270
270
|
}
|
|
@@ -282,7 +282,7 @@ var cli_default = function() {
|
|
|
282
282
|
output: resolveWebpackConfig.output,
|
|
283
283
|
externals: resolveWebpackConfig.externals,
|
|
284
284
|
env: env,
|
|
285
|
-
alias: (
|
|
285
|
+
alias: (_resolveWebpackConfig_resolve = resolveWebpackConfig.resolve) === null || _resolveWebpackConfig_resolve === void 0 ? void 0 : _resolveWebpackConfig_resolve.alias,
|
|
286
286
|
plugins: resolveWebpackConfig.plugins
|
|
287
287
|
});
|
|
288
288
|
}
|
|
@@ -366,9 +366,9 @@ var cli_default = function() {
|
|
|
366
366
|
},
|
|
367
367
|
modifyEntryRenderFunction: function modifyEntryRenderFunction(param) {
|
|
368
368
|
var entrypoint = param.entrypoint, code = param.code;
|
|
369
|
-
var
|
|
369
|
+
var _config_deploy;
|
|
370
370
|
var config = useResolvedConfigContext();
|
|
371
|
-
if (!(config === null || config === void 0 ? void 0 : (
|
|
371
|
+
if (!(config === null || config === void 0 ? void 0 : (_config_deploy = config.deploy) === null || _config_deploy === void 0 ? void 0 : _config_deploy.microFrontend)) {
|
|
372
372
|
return {
|
|
373
373
|
entrypoint: entrypoint,
|
|
374
374
|
code: code
|
|
@@ -383,10 +383,10 @@ var cli_default = function() {
|
|
|
383
383
|
},
|
|
384
384
|
modifyAsyncEntry: function modifyAsyncEntry(param) {
|
|
385
385
|
var entrypoint = param.entrypoint, code = param.code;
|
|
386
|
-
var
|
|
386
|
+
var _config_deploy, _config_source;
|
|
387
387
|
var config = useResolvedConfigContext();
|
|
388
388
|
var finalCode = code;
|
|
389
|
-
if ((config === null || config === void 0 ? void 0 : (
|
|
389
|
+
if ((config === null || config === void 0 ? void 0 : (_config_deploy = config.deploy) === null || _config_deploy === void 0 ? void 0 : _config_deploy.microFrontend) && (config === null || config === void 0 ? void 0 : (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.enableAsyncEntry)) {
|
|
390
390
|
finalCode = generateAsyncEntry(code);
|
|
391
391
|
return {
|
|
392
392
|
entrypoint: entrypoint,
|
|
@@ -400,9 +400,9 @@ var cli_default = function() {
|
|
|
400
400
|
},
|
|
401
401
|
modifyEntryExport: function modifyEntryExport(param) {
|
|
402
402
|
var entrypoint = param.entrypoint, exportStatement = param.exportStatement;
|
|
403
|
-
var
|
|
403
|
+
var _config_deploy;
|
|
404
404
|
var config = useResolvedConfigContext();
|
|
405
|
-
if (config === null || config === void 0 ? void 0 : (
|
|
405
|
+
if (config === null || config === void 0 ? void 0 : (_config_deploy = config.deploy) === null || _config_deploy === void 0 ? void 0 : _config_deploy.microFrontend) {
|
|
406
406
|
var exportStatementCode = makeProvider();
|
|
407
407
|
logger("exportStatement", exportStatementCode);
|
|
408
408
|
return {
|
|
@@ -6,16 +6,16 @@ var makeRenderFunction = function(code) {
|
|
|
6
6
|
return inGarfishToRender + code.replace("router(", "generateRouterPlugin(basename,").replace("(App)", "(AppWrapper)").replace(/MOUNT_ID/g, "mountNode").replace("bootstrap(AppWrapper, mountNode, root", "bootstrap(AppWrapper, mountNode, root = IS_REACT18 ? ReactDOM.createRoot(mountNode) : null").replace("customBootstrap(AppWrapper)", "customBootstrap(AppWrapper, mountNode)");
|
|
7
7
|
};
|
|
8
8
|
function getRuntimeConfig(config) {
|
|
9
|
-
var
|
|
10
|
-
if (config === null || config === void 0 ? void 0 : (
|
|
11
|
-
var
|
|
12
|
-
return config === null || config === void 0 ? void 0 : (
|
|
9
|
+
var _config_runtime;
|
|
10
|
+
if (config === null || config === void 0 ? void 0 : (_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.features) {
|
|
11
|
+
var _config_runtime1;
|
|
12
|
+
return config === null || config === void 0 ? void 0 : (_config_runtime1 = config.runtime) === null || _config_runtime1 === void 0 ? void 0 : _config_runtime1.features;
|
|
13
13
|
}
|
|
14
14
|
return (config === null || config === void 0 ? void 0 : config.runtime) || {};
|
|
15
15
|
}
|
|
16
16
|
function setRuntimeConfig(config, key, value) {
|
|
17
|
-
var
|
|
18
|
-
if ((config === null || config === void 0 ? void 0 : (
|
|
17
|
+
var _config_runtime, _config_runtime1;
|
|
18
|
+
if ((config === null || config === void 0 ? void 0 : (_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.features) && (config === null || config === void 0 ? void 0 : (_config_runtime1 = config.runtime) === null || _config_runtime1 === void 0 ? void 0 : _config_runtime1.features[key])) {
|
|
19
19
|
config.runtime.features[key] = value;
|
|
20
20
|
return void 0;
|
|
21
21
|
}
|
|
@@ -134,13 +134,13 @@ var DEFAULT_LOADABLE = {
|
|
|
134
134
|
function Loadable(WrapComponent) {
|
|
135
135
|
return function(defaultLoadable) {
|
|
136
136
|
return function Lodable(props) {
|
|
137
|
-
var
|
|
138
|
-
var
|
|
137
|
+
var _props_loadable;
|
|
138
|
+
var _props_loadable1 = props.loadable, loadable = _props_loadable1 === void 0 ? defaultLoadable !== null && defaultLoadable !== void 0 ? defaultLoadable : DEFAULT_LOADABLE : _props_loadable1, otherProps = _objectWithoutProperties(props, [
|
|
139
139
|
"loadable"
|
|
140
140
|
]);
|
|
141
141
|
var delayTimer = null;
|
|
142
142
|
var timeoutTimer = null;
|
|
143
|
-
var
|
|
143
|
+
var _useState = _slicedToArray(useState(function() {
|
|
144
144
|
var delay = loadable.delay, timeout = loadable.timeout;
|
|
145
145
|
var initState = {
|
|
146
146
|
error: null,
|
|
@@ -167,8 +167,8 @@ function Loadable(WrapComponent) {
|
|
|
167
167
|
}, timeout);
|
|
168
168
|
}
|
|
169
169
|
return initState;
|
|
170
|
-
}), 2), state =
|
|
171
|
-
var LoadingComponent = (
|
|
170
|
+
}), 2), state = _useState[0], setState = _useState[1];
|
|
171
|
+
var LoadingComponent = (_props_loadable = props.loadable) === null || _props_loadable === void 0 ? void 0 : _props_loadable.loading;
|
|
172
172
|
useEffect(function() {
|
|
173
173
|
logger("Loadable render state", {
|
|
174
174
|
state: state,
|
|
@@ -325,7 +325,7 @@ function initOptions() {
|
|
|
325
325
|
}
|
|
326
326
|
function _initOptions() {
|
|
327
327
|
_initOptions = _asyncToGenerator(function() {
|
|
328
|
-
var manifest, options,
|
|
328
|
+
var manifest, options, _window_modern_manifest, _window_modern_manifest1, apps, getAppList, _window_modern_manifest2;
|
|
329
329
|
var _arguments = arguments;
|
|
330
330
|
return __generator(this, function(_state) {
|
|
331
331
|
switch(_state.label){
|
|
@@ -354,9 +354,9 @@ function _initOptions() {
|
|
|
354
354
|
logger("getAppList modules", apps);
|
|
355
355
|
_state.label = 2;
|
|
356
356
|
case 2:
|
|
357
|
-
if ((window === null || window === void 0 ? void 0 : (
|
|
357
|
+
if ((window === null || window === void 0 ? void 0 : (_window_modern_manifest = window.modern_manifest) === null || _window_modern_manifest === void 0 ? void 0 : _window_modern_manifest.modules) && (window === null || window === void 0 ? void 0 : (_window_modern_manifest1 = window.modern_manifest) === null || _window_modern_manifest1 === void 0 ? void 0 : _window_modern_manifest1.modules.length) > 0) {
|
|
358
358
|
;
|
|
359
|
-
apps = window === null || window === void 0 ? void 0 : (
|
|
359
|
+
apps = window === null || window === void 0 ? void 0 : (_window_modern_manifest2 = window.modern_manifest) === null || _window_modern_manifest2 === void 0 ? void 0 : _window_modern_manifest2.modules;
|
|
360
360
|
logger("modern_manifest", apps);
|
|
361
361
|
}
|
|
362
362
|
return [
|
|
@@ -383,9 +383,9 @@ var plugin_default = function(config) {
|
|
|
383
383
|
return {
|
|
384
384
|
hoc: function hoc(param, next) {
|
|
385
385
|
var App = param.App;
|
|
386
|
-
var GetMicroFrontendApp = /*#__PURE__*/ function(
|
|
386
|
+
var GetMicroFrontendApp = /*#__PURE__*/ function(_React_Component) {
|
|
387
387
|
"use strict";
|
|
388
|
-
_inherits(GetMicroFrontendApp,
|
|
388
|
+
_inherits(GetMicroFrontendApp, _React_Component);
|
|
389
389
|
var _super = _createSuper(GetMicroFrontendApp);
|
|
390
390
|
function GetMicroFrontendApp(props) {
|
|
391
391
|
_classCallCheck(this, GetMicroFrontendApp);
|
|
@@ -408,7 +408,7 @@ var plugin_default = function(config) {
|
|
|
408
408
|
var _this1 = _assertThisInitialized(_this);
|
|
409
409
|
var load = function() {
|
|
410
410
|
var _ref = _asyncToGenerator(function() {
|
|
411
|
-
var GarfishConfig,
|
|
411
|
+
var GarfishConfig, _generateApps, appInfoList, apps, MApp;
|
|
412
412
|
return __generator(this, function(_state) {
|
|
413
413
|
switch(_state.label){
|
|
414
414
|
case 0:
|
|
@@ -424,7 +424,7 @@ var plugin_default = function(config) {
|
|
|
424
424
|
];
|
|
425
425
|
case 1:
|
|
426
426
|
GarfishConfig = _state.sent();
|
|
427
|
-
|
|
427
|
+
_generateApps = generateApps(GarfishConfig, manifest), appInfoList = _generateApps.appInfoList, apps = _generateApps.apps;
|
|
428
428
|
GarfishInstance.registerApp(appInfoList);
|
|
429
429
|
MApp = generateMApp(GarfishConfig, manifest);
|
|
430
430
|
logger("initOptions result", {
|
|
@@ -30,7 +30,7 @@ import React, { useContext } from "react";
|
|
|
30
30
|
import { logger } from "../util";
|
|
31
31
|
import { GarfishContext } from "./utils/Context";
|
|
32
32
|
function useModuleApps() {
|
|
33
|
-
var
|
|
33
|
+
var _useContext = useContext(GarfishContext), apps = _useContext.apps, MApp = _useContext.MApp, appInfoList = _useContext.appInfoList;
|
|
34
34
|
logger("call useModuleApps", _objectSpread({
|
|
35
35
|
MApp: MApp,
|
|
36
36
|
apps: appInfoList
|
|
@@ -169,9 +169,9 @@ import Garfish from "garfish";
|
|
|
169
169
|
import { logger, generateSubAppContainerKey } from "../../util";
|
|
170
170
|
import { Loadable } from "../loadable";
|
|
171
171
|
function generateMApp(options, manifest) {
|
|
172
|
-
var MApp = /*#__PURE__*/ function(
|
|
172
|
+
var MApp = /*#__PURE__*/ function(_React_Component) {
|
|
173
173
|
"use strict";
|
|
174
|
-
_inherits(MApp,
|
|
174
|
+
_inherits(MApp, _React_Component);
|
|
175
175
|
var _super = _createSuper(MApp);
|
|
176
176
|
function MApp() {
|
|
177
177
|
_classCallCheck(this, MApp);
|
|
@@ -325,7 +325,7 @@ function generateMApp(options, manifest) {
|
|
|
325
325
|
{
|
|
326
326
|
key: "filterTransferProps",
|
|
327
327
|
value: function filterTransferProps() {
|
|
328
|
-
var
|
|
328
|
+
var _this_props = this.props, style = _this_props.style, setLoadingState = _this_props.setLoadingState, others = _objectWithoutProperties(_this_props, [
|
|
329
329
|
"style",
|
|
330
330
|
"setLoadingState"
|
|
331
331
|
]);
|
|
@@ -287,14 +287,14 @@ function pathJoin() {
|
|
|
287
287
|
}
|
|
288
288
|
function getAppInstance(options, appInfo, manifest) {
|
|
289
289
|
var MicroApp = function MicroApp(props) {
|
|
290
|
-
var
|
|
290
|
+
var _context_router, _context_router_useRouteMatch, _context_router1, _context_router_useMatches, _context_router2, _context_router_useLocation;
|
|
291
291
|
var appRef = useRef(null);
|
|
292
292
|
var domId = generateSubAppContainerKey(appInfo);
|
|
293
|
-
var
|
|
293
|
+
var _useState = _slicedToArray(useState(), 2), SubModuleComponent = _useState[0], setSubModuleComponent = _useState[1];
|
|
294
294
|
var context = useContext(RuntimeReactContext);
|
|
295
|
-
var match = context === null || context === void 0 ? void 0 : (
|
|
296
|
-
var matchs = context === null || context === void 0 ? void 0 : (
|
|
297
|
-
var location = context === null || context === void 0 ? void 0 : (
|
|
295
|
+
var match = context === null || context === void 0 ? void 0 : (_context_router = context.router) === null || _context_router === void 0 ? void 0 : (_context_router_useRouteMatch = _context_router.useRouteMatch) === null || _context_router_useRouteMatch === void 0 ? void 0 : _context_router_useRouteMatch.call(_context_router);
|
|
296
|
+
var matchs = context === null || context === void 0 ? void 0 : (_context_router1 = context.router) === null || _context_router1 === void 0 ? void 0 : (_context_router_useMatches = _context_router1.useMatches) === null || _context_router_useMatches === void 0 ? void 0 : _context_router_useMatches.call(_context_router1);
|
|
297
|
+
var location = context === null || context === void 0 ? void 0 : (_context_router2 = context.router) === null || _context_router2 === void 0 ? void 0 : (_context_router_useLocation = _context_router2.useLocation) === null || _context_router_useLocation === void 0 ? void 0 : _context_router_useLocation.call(_context_router2);
|
|
298
298
|
var basename = (options === null || options === void 0 ? void 0 : options.basename) || "/";
|
|
299
299
|
if (matchs && matchs.length > 0) {
|
|
300
300
|
var matchItem = _objectSpread({}, matchs[matchs.length - 1]);
|
|
@@ -449,15 +449,15 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
449
449
|
renderApp();
|
|
450
450
|
return function() {
|
|
451
451
|
if (appRef.current) {
|
|
452
|
-
var
|
|
452
|
+
var _appRef_current = appRef.current, appInfo2 = _appRef_current.appInfo;
|
|
453
453
|
if (appInfo2.cache) {
|
|
454
|
-
var
|
|
454
|
+
var _appRef_current1;
|
|
455
455
|
logger('MicroApp Garfish.loadApp "'.concat(appInfo2.name, '" hide'));
|
|
456
|
-
(
|
|
456
|
+
(_appRef_current1 = appRef.current) === null || _appRef_current1 === void 0 ? void 0 : _appRef_current1.hide();
|
|
457
457
|
} else {
|
|
458
|
-
var
|
|
458
|
+
var _appRef_current2;
|
|
459
459
|
logger('MicroApp Garfish.loadApp "'.concat(appInfo2.name, '" unmount'));
|
|
460
|
-
(
|
|
460
|
+
(_appRef_current2 = appRef.current) === null || _appRef_current2 === void 0 ? void 0 : _appRef_current2.unmount();
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
};
|
|
@@ -473,9 +473,9 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
473
473
|
return Loadable(MicroApp)(manifest === null || manifest === void 0 ? void 0 : manifest.loadable);
|
|
474
474
|
}
|
|
475
475
|
function generateApps(options, manifest) {
|
|
476
|
-
var
|
|
476
|
+
var _options_apps;
|
|
477
477
|
var apps = {};
|
|
478
|
-
(
|
|
478
|
+
(_options_apps = options.apps) === null || _options_apps === void 0 ? void 0 : _options_apps.forEach(function(appInfo) {
|
|
479
479
|
var Component = getAppInstance(options, appInfo, manifest);
|
|
480
480
|
appInfo.Component = Component;
|
|
481
481
|
apps[appInfo.name] = Component;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.4.0",
|
|
14
|
+
"version": "2.4.1-beta.0",
|
|
15
15
|
"jsnext:source": "./src/cli/index.ts",
|
|
16
16
|
"types": "./dist/types/cli/index.d.ts",
|
|
17
17
|
"typesVersions": {
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"garfish": "^1.8.1",
|
|
64
64
|
"hoist-non-react-statics": "^3.3.2",
|
|
65
65
|
"react-loadable": "^5.5.0",
|
|
66
|
-
"@modern-js/utils": "2.4.0"
|
|
66
|
+
"@modern-js/utils": "2.4.1-beta.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@modern-js/runtime": "^2.4.0"
|
|
69
|
+
"@modern-js/runtime": "^2.4.1-beta.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"@modern-js/runtime": {
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"react-router-dom": "^6.6.0",
|
|
89
89
|
"typescript": "^4",
|
|
90
90
|
"webpack-chain": "^6.5.1",
|
|
91
|
-
"@modern-js/app-tools": "
|
|
92
|
-
"@modern-js/core": "2.4.0",
|
|
93
|
-
"@modern-js/runtime": "2.4.0",
|
|
94
|
-
"@modern-js/plugin-router-v5": "2.4.0",
|
|
91
|
+
"@modern-js/app-tools": "3.0.0-beta.0",
|
|
92
|
+
"@modern-js/core": "2.4.1-beta.0",
|
|
93
|
+
"@modern-js/runtime": "2.4.1-beta.0",
|
|
94
|
+
"@modern-js/plugin-router-v5": "2.4.1-beta.0",
|
|
95
95
|
"@modern-js/types": "2.4.0",
|
|
96
96
|
"@scripts/build": "2.4.0",
|
|
97
97
|
"@scripts/jest-config": "2.4.0"
|