@modern-js/plugin-garfish 2.0.0-beta.3 → 2.0.0-beta.4
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 +67 -0
- package/dist/js/modern/cli/index.js +164 -157
- package/dist/js/modern/cli/utils.js +31 -23
- package/dist/js/modern/global.d.js +0 -0
- package/dist/js/modern/index.js +5 -2
- package/dist/js/modern/modern-app.env.d.js +0 -0
- package/dist/js/modern/runtime/global.d.js +0 -0
- package/dist/js/modern/runtime/index.js +12 -4
- package/dist/js/modern/runtime/loadable.js +74 -56
- package/dist/js/modern/runtime/plugin.js +114 -79
- package/dist/js/modern/runtime/useModuleApps.js +40 -26
- package/dist/js/modern/runtime/utils/Context.js +6 -3
- package/dist/js/modern/runtime/utils/MApp.js +76 -72
- package/dist/js/modern/runtime/utils/apps.js +177 -142
- package/dist/js/modern/runtime/utils/setExternal.js +11 -11
- package/dist/js/modern/type.d.js +0 -0
- package/dist/js/modern/util.js +11 -9
- package/dist/js/node/cli/index.js +184 -168
- package/dist/js/node/cli/utils.js +45 -30
- package/dist/js/node/global.d.js +0 -0
- package/dist/js/node/index.js +29 -24
- package/dist/js/node/modern-app.env.d.js +0 -0
- package/dist/js/node/runtime/global.d.js +0 -0
- package/dist/js/node/runtime/index.js +35 -44
- package/dist/js/node/runtime/loadable.js +95 -61
- package/dist/js/node/runtime/plugin.js +147 -95
- package/dist/js/node/runtime/useModuleApps.js +64 -34
- package/dist/js/node/runtime/utils/Context.js +30 -10
- package/dist/js/node/runtime/utils/MApp.js +107 -84
- package/dist/js/node/runtime/utils/apps.js +204 -146
- package/dist/js/node/runtime/utils/setExternal.js +35 -18
- package/dist/js/node/type.d.js +0 -0
- package/dist/js/node/util.js +34 -19
- package/dist/js/treeshaking/cli/index.js +402 -284
- package/dist/js/treeshaking/cli/utils.js +28 -31
- package/dist/js/treeshaking/global.d.js +1 -0
- package/dist/js/treeshaking/index.js +3 -2
- package/dist/js/treeshaking/modern-app.env.d.js +1 -0
- package/dist/js/treeshaking/runtime/global.d.js +1 -0
- package/dist/js/treeshaking/runtime/index.js +5 -4
- package/dist/js/treeshaking/runtime/loadable.js +230 -109
- package/dist/js/treeshaking/runtime/plugin.js +469 -168
- package/dist/js/treeshaking/runtime/useModuleApps.js +55 -31
- package/dist/js/treeshaking/runtime/utils/Context.js +3 -3
- package/dist/js/treeshaking/runtime/utils/MApp.js +348 -180
- package/dist/js/treeshaking/runtime/utils/apps.js +536 -230
- package/dist/js/treeshaking/runtime/utils/setExternal.js +12 -11
- package/dist/js/treeshaking/type.d.js +1 -0
- package/dist/js/treeshaking/util.js +7 -9
- package/dist/types/cli/index.d.ts +2 -0
- package/dist/types/runtime/plugin.d.ts +2 -0
- package/dist/types/runtime/utils/setExternal.d.ts +1 -0
- package/package.json +10 -10
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import ReactDOM from
|
|
3
|
-
import garfish from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import garfish from "garfish";
|
|
4
4
|
import { logger } from "../../util";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
5
|
+
var setExternal_default = function() {
|
|
6
|
+
logger("setExternal ", {
|
|
7
|
+
react: React,
|
|
8
|
+
"react-dom": ReactDOM
|
|
9
|
+
});
|
|
10
|
+
garfish.setExternal("react", React);
|
|
11
|
+
garfish.setExternal("react-dom", ReactDOM);
|
|
12
|
+
};
|
|
13
|
+
export { setExternal_default as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
return moduleInfo ? "modern_sub_app_container_".concat(decodeURIComponent(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.name)) : 'modern_sub_app_container';
|
|
9
|
-
}
|
|
1
|
+
import createDebug from "debug";
|
|
2
|
+
var logger = createDebug("modern-js:plugin-garfish");
|
|
3
|
+
var SUBMODULE_APP_COMPONENT_KEY = "SubModuleComponent";
|
|
4
|
+
function generateSubAppContainerKey(moduleInfo) {
|
|
5
|
+
return moduleInfo ? "modern_sub_app_container_".concat(decodeURIComponent(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.name)) : "modern_sub_app_container";
|
|
6
|
+
}
|
|
7
|
+
export { SUBMODULE_APP_COMPONENT_KEY, generateSubAppContainerKey, logger };
|
|
@@ -8,6 +8,7 @@ export declare const externals: {
|
|
|
8
8
|
export declare type LifeCycle = CliHookCallbacks;
|
|
9
9
|
declare type NonInValidAble<T> = T extends null | undefined | false ? never : T;
|
|
10
10
|
export declare function getDefaultMicroFrontedConfig(microFrontend: NonInValidAble<NonNullable<UseConfig['deploy']>['microFrontend']>): any;
|
|
11
|
+
|
|
11
12
|
declare const _default: ({
|
|
12
13
|
pluginName,
|
|
13
14
|
runtimePluginName,
|
|
@@ -17,4 +18,5 @@ declare const _default: ({
|
|
|
17
18
|
runtimePluginName?: string | undefined;
|
|
18
19
|
mfPackagePath?: string | undefined;
|
|
19
20
|
}) => CliPlugin<AppTools>;
|
|
21
|
+
|
|
20
22
|
export default _default;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.4",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/runtime/index.d.ts",
|
|
17
17
|
"typesVersions": {
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"garfish": "^1.8.1",
|
|
57
57
|
"hoist-non-react-statics": "^3.3.2",
|
|
58
58
|
"react-loadable": "^5.5.0",
|
|
59
|
-
"@modern-js/utils": "2.0.0-beta.
|
|
59
|
+
"@modern-js/utils": "2.0.0-beta.4"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@modern-js/runtime": "^2.0.0-beta.
|
|
62
|
+
"@modern-js/runtime": "^2.0.0-beta.4"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"@modern-js/runtime": {
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"react-router-dom": "^6.4.4",
|
|
82
82
|
"typescript": "^4",
|
|
83
83
|
"webpack-chain": "^6.5.1",
|
|
84
|
-
"@modern-js/core": "2.0.0-beta.
|
|
85
|
-
"@modern-js/plugin-router-legacy": "2.0.0-beta.
|
|
86
|
-
"@modern-js/runtime": "2.0.0-beta.
|
|
87
|
-
"@modern-js/types": "2.0.0-beta.
|
|
88
|
-
"@scripts/build": "2.0.0-beta.
|
|
89
|
-
"@modern-js/app-tools": "2.0.0-beta.
|
|
90
|
-
"@scripts/jest-config": "2.0.0-beta.
|
|
84
|
+
"@modern-js/core": "2.0.0-beta.4",
|
|
85
|
+
"@modern-js/plugin-router-legacy": "2.0.0-beta.4",
|
|
86
|
+
"@modern-js/runtime": "2.0.0-beta.4",
|
|
87
|
+
"@modern-js/types": "2.0.0-beta.4",
|
|
88
|
+
"@scripts/build": "2.0.0-beta.4",
|
|
89
|
+
"@modern-js/app-tools": "2.0.0-beta.4",
|
|
90
|
+
"@scripts/jest-config": "2.0.0-beta.4"
|
|
91
91
|
},
|
|
92
92
|
"sideEffects": false,
|
|
93
93
|
"modernConfig": {},
|