@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.
Files changed (53) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/js/modern/cli/index.js +164 -157
  3. package/dist/js/modern/cli/utils.js +31 -23
  4. package/dist/js/modern/global.d.js +0 -0
  5. package/dist/js/modern/index.js +5 -2
  6. package/dist/js/modern/modern-app.env.d.js +0 -0
  7. package/dist/js/modern/runtime/global.d.js +0 -0
  8. package/dist/js/modern/runtime/index.js +12 -4
  9. package/dist/js/modern/runtime/loadable.js +74 -56
  10. package/dist/js/modern/runtime/plugin.js +114 -79
  11. package/dist/js/modern/runtime/useModuleApps.js +40 -26
  12. package/dist/js/modern/runtime/utils/Context.js +6 -3
  13. package/dist/js/modern/runtime/utils/MApp.js +76 -72
  14. package/dist/js/modern/runtime/utils/apps.js +177 -142
  15. package/dist/js/modern/runtime/utils/setExternal.js +11 -11
  16. package/dist/js/modern/type.d.js +0 -0
  17. package/dist/js/modern/util.js +11 -9
  18. package/dist/js/node/cli/index.js +184 -168
  19. package/dist/js/node/cli/utils.js +45 -30
  20. package/dist/js/node/global.d.js +0 -0
  21. package/dist/js/node/index.js +29 -24
  22. package/dist/js/node/modern-app.env.d.js +0 -0
  23. package/dist/js/node/runtime/global.d.js +0 -0
  24. package/dist/js/node/runtime/index.js +35 -44
  25. package/dist/js/node/runtime/loadable.js +95 -61
  26. package/dist/js/node/runtime/plugin.js +147 -95
  27. package/dist/js/node/runtime/useModuleApps.js +64 -34
  28. package/dist/js/node/runtime/utils/Context.js +30 -10
  29. package/dist/js/node/runtime/utils/MApp.js +107 -84
  30. package/dist/js/node/runtime/utils/apps.js +204 -146
  31. package/dist/js/node/runtime/utils/setExternal.js +35 -18
  32. package/dist/js/node/type.d.js +0 -0
  33. package/dist/js/node/util.js +34 -19
  34. package/dist/js/treeshaking/cli/index.js +402 -284
  35. package/dist/js/treeshaking/cli/utils.js +28 -31
  36. package/dist/js/treeshaking/global.d.js +1 -0
  37. package/dist/js/treeshaking/index.js +3 -2
  38. package/dist/js/treeshaking/modern-app.env.d.js +1 -0
  39. package/dist/js/treeshaking/runtime/global.d.js +1 -0
  40. package/dist/js/treeshaking/runtime/index.js +5 -4
  41. package/dist/js/treeshaking/runtime/loadable.js +230 -109
  42. package/dist/js/treeshaking/runtime/plugin.js +469 -168
  43. package/dist/js/treeshaking/runtime/useModuleApps.js +55 -31
  44. package/dist/js/treeshaking/runtime/utils/Context.js +3 -3
  45. package/dist/js/treeshaking/runtime/utils/MApp.js +348 -180
  46. package/dist/js/treeshaking/runtime/utils/apps.js +536 -230
  47. package/dist/js/treeshaking/runtime/utils/setExternal.js +12 -11
  48. package/dist/js/treeshaking/type.d.js +1 -0
  49. package/dist/js/treeshaking/util.js +7 -9
  50. package/dist/types/cli/index.d.ts +2 -0
  51. package/dist/types/runtime/plugin.d.ts +2 -0
  52. package/dist/types/runtime/utils/setExternal.d.ts +1 -0
  53. package/package.json +10 -10
@@ -1,12 +1,13 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
- import garfish from 'garfish';
1
+ import React from "react";
2
+ import ReactDOM from "react-dom";
3
+ import garfish from "garfish";
4
4
  import { logger } from "../../util";
5
- export 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
- });
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
- * Tips: this package will be bundled and running in the browser, do not import from `@modern-js/utils`.
3
- */
4
- import createDebug from 'debug';
5
- export var logger = createDebug('modern-js:plugin-garfish');
6
- export var SUBMODULE_APP_COMPONENT_KEY = 'SubModuleComponent';
7
- export function generateSubAppContainerKey(moduleInfo) {
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;
@@ -1,4 +1,6 @@
1
1
  import type { Plugin } from '@modern-js/runtime';
2
2
  import { Config } from './useModuleApps';
3
+
3
4
  declare const _default: (config: Config) => Plugin;
5
+
4
6
  export default _default;
@@ -1,2 +1,3 @@
1
1
  declare const _default: () => void;
2
+
2
3
  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.3",
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.3"
59
+ "@modern-js/utils": "2.0.0-beta.4"
60
60
  },
61
61
  "peerDependencies": {
62
- "@modern-js/runtime": "^2.0.0-beta.3"
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.3",
85
- "@modern-js/plugin-router-legacy": "2.0.0-beta.3",
86
- "@modern-js/runtime": "2.0.0-beta.3",
87
- "@modern-js/types": "2.0.0-beta.3",
88
- "@scripts/build": "2.0.0-beta.3",
89
- "@modern-js/app-tools": "2.0.0-beta.3",
90
- "@scripts/jest-config": "2.0.0-beta.3"
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": {},