@module-federation/modern-js 0.0.0-next-20250708134245 → 0.0.0-next-20250709032753

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 (65) hide show
  1. package/dist/cjs/cli/configPlugin.js +1 -0
  2. package/dist/cjs/cli/configPlugin.spec.js +2 -1
  3. package/dist/cjs/cli/mfRuntimePlugins/auto-fetch-data.js +100 -0
  4. package/dist/cjs/cli/server/data-fetch-server-plugin.js +143 -2
  5. package/dist/cjs/constant.js +49 -2
  6. package/dist/cjs/interfaces/global.js +16 -0
  7. package/dist/cjs/runtime/AwaitDataFetch.js +144 -0
  8. package/dist/cjs/runtime/createRemoteComponent.js +327 -0
  9. package/dist/cjs/runtime/index.js +28 -0
  10. package/dist/cjs/runtime/{plugin.js → wrapNoSSR.js} +12 -20
  11. package/dist/cjs/ssr-runtime/devPlugin.js +2 -2
  12. package/dist/cjs/ssr-runtime/downgrade.js +114 -0
  13. package/dist/cjs/ssr-runtime/injectDataFetchFunctionPlugin.js +102 -6
  14. package/dist/cjs/utils/dataFetch.js +211 -0
  15. package/dist/cjs/utils/index.js +54 -0
  16. package/dist/esm/cli/configPlugin.js +1 -0
  17. package/dist/esm/cli/configPlugin.spec.js +2 -1
  18. package/dist/esm/cli/mfRuntimePlugins/auto-fetch-data.js +76 -0
  19. package/dist/esm/cli/server/data-fetch-server-plugin.js +219 -2
  20. package/dist/esm/constant.js +37 -1
  21. package/dist/esm/interfaces/global.js +0 -0
  22. package/dist/esm/runtime/AwaitDataFetch.js +131 -0
  23. package/dist/esm/runtime/createRemoteComponent.js +417 -0
  24. package/dist/esm/runtime/index.js +21 -0
  25. package/dist/esm/runtime/wrapNoSSR.js +12 -0
  26. package/dist/esm/ssr-runtime/devPlugin.js +1 -1
  27. package/dist/esm/ssr-runtime/downgrade.js +150 -0
  28. package/dist/esm/ssr-runtime/injectDataFetchFunctionPlugin.js +147 -4
  29. package/dist/esm/utils/dataFetch.js +237 -0
  30. package/dist/esm/utils/index.js +28 -0
  31. package/dist/esm-node/cli/configPlugin.js +1 -0
  32. package/dist/esm-node/cli/configPlugin.spec.js +2 -1
  33. package/dist/esm-node/cli/mfRuntimePlugins/auto-fetch-data.js +70 -0
  34. package/dist/esm-node/cli/server/data-fetch-server-plugin.js +143 -2
  35. package/dist/esm-node/constant.js +37 -1
  36. package/dist/esm-node/interfaces/global.js +0 -0
  37. package/dist/esm-node/runtime/AwaitDataFetch.js +109 -0
  38. package/dist/esm-node/runtime/createRemoteComponent.js +291 -0
  39. package/dist/esm-node/runtime/index.js +21 -0
  40. package/dist/esm-node/runtime/wrapNoSSR.js +11 -0
  41. package/dist/esm-node/ssr-runtime/devPlugin.js +1 -1
  42. package/dist/esm-node/ssr-runtime/downgrade.js +88 -0
  43. package/dist/esm-node/ssr-runtime/injectDataFetchFunctionPlugin.js +89 -4
  44. package/dist/esm-node/utils/dataFetch.js +166 -0
  45. package/dist/esm-node/utils/index.js +27 -0
  46. package/dist/types/cli/mfRuntimePlugins/auto-fetch-data.d.ts +3 -0
  47. package/dist/types/constant.d.ts +23 -0
  48. package/dist/types/interfaces/global.d.ts +27 -0
  49. package/dist/types/runtime/AwaitDataFetch.d.ts +19 -0
  50. package/dist/types/runtime/createRemoteComponent.d.ts +26 -0
  51. package/dist/types/runtime/index.d.ts +9 -0
  52. package/dist/types/runtime/wrapNoSSR.d.ts +9 -0
  53. package/dist/types/ssr-runtime/SSRLiveReload.d.ts +1 -1
  54. package/dist/types/ssr-runtime/downgrade.d.ts +4 -0
  55. package/dist/types/ssr-runtime/injectDataFetchFunctionPlugin.d.ts +3 -0
  56. package/dist/types/utils/dataFetch.d.ts +26 -0
  57. package/dist/types/utils/index.d.ts +15 -0
  58. package/package.json +18 -23
  59. package/dist/cjs/react/index.js +0 -44
  60. package/dist/esm/react/index.js +0 -12
  61. package/dist/esm/runtime/plugin.js +0 -19
  62. package/dist/esm-node/react/index.js +0 -12
  63. package/dist/esm-node/runtime/plugin.js +0 -19
  64. package/dist/types/react/index.d.ts +0 -2
  65. package/dist/types/runtime/plugin.d.ts +0 -2
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var react_exports = {};
20
- __export(react_exports, {
21
- CacheSize: () => import_bridge_react.CacheSize,
22
- CacheTime: () => import_bridge_react.CacheTime,
23
- ERROR_TYPE: () => import_bridge_react.ERROR_TYPE,
24
- cache: () => import_bridge_react.cache,
25
- clearStore: () => import_bridge_react.clearStore,
26
- configureCache: () => import_bridge_react.configureCache,
27
- generateKey: () => import_bridge_react.generateKey,
28
- lazyLoadComponentPlugin: () => import_bridge_react.lazyLoadComponentPlugin,
29
- revalidateTag: () => import_bridge_react.revalidateTag
30
- });
31
- module.exports = __toCommonJS(react_exports);
32
- var import_bridge_react = require("@module-federation/bridge-react");
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- CacheSize,
36
- CacheTime,
37
- ERROR_TYPE,
38
- cache,
39
- clearStore,
40
- configureCache,
41
- generateKey,
42
- lazyLoadComponentPlugin,
43
- revalidateTag
44
- });
@@ -1,12 +0,0 @@
1
- import { ERROR_TYPE, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, lazyLoadComponentPlugin } from "@module-federation/bridge-react";
2
- export {
3
- CacheSize,
4
- CacheTime,
5
- ERROR_TYPE,
6
- cache,
7
- clearStore,
8
- configureCache,
9
- generateKey,
10
- lazyLoadComponentPlugin,
11
- revalidateTag
12
- };
@@ -1,19 +0,0 @@
1
- import { getInstance } from "@module-federation/enhanced/runtime";
2
- import { lazyLoadComponentPlugin } from "@module-federation/bridge-react";
3
- var mfPlugin = function() {
4
- return {
5
- name: "@modern-js/plugin-mf",
6
- setup: function(api) {
7
- api.wrapRoot(function(App) {
8
- var _getInstance;
9
- (_getInstance = getInstance()) === null || _getInstance === void 0 ? void 0 : _getInstance.registerPlugins([
10
- lazyLoadComponentPlugin()
11
- ]);
12
- return App;
13
- });
14
- }
15
- };
16
- };
17
- export {
18
- mfPlugin
19
- };
@@ -1,12 +0,0 @@
1
- import { ERROR_TYPE, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, lazyLoadComponentPlugin } from "@module-federation/bridge-react";
2
- export {
3
- CacheSize,
4
- CacheTime,
5
- ERROR_TYPE,
6
- cache,
7
- clearStore,
8
- configureCache,
9
- generateKey,
10
- lazyLoadComponentPlugin,
11
- revalidateTag
12
- };
@@ -1,19 +0,0 @@
1
- import { getInstance } from "@module-federation/enhanced/runtime";
2
- import { lazyLoadComponentPlugin } from "@module-federation/bridge-react";
3
- const mfPlugin = () => {
4
- return {
5
- name: "@modern-js/plugin-mf",
6
- setup: (api) => {
7
- api.wrapRoot((App) => {
8
- var _getInstance;
9
- (_getInstance = getInstance()) === null || _getInstance === void 0 ? void 0 : _getInstance.registerPlugins([
10
- lazyLoadComponentPlugin()
11
- ]);
12
- return App;
13
- });
14
- }
15
- };
16
- };
17
- export {
18
- mfPlugin
19
- };
@@ -1,2 +0,0 @@
1
- export { ERROR_TYPE, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, lazyLoadComponentPlugin, } from '@module-federation/bridge-react';
2
- export type { DataFetchParams, CacheStatus, CacheStatsInfo, } from '@module-federation/bridge-react';
@@ -1,2 +0,0 @@
1
- import type { RuntimePluginFuture } from '@modern-js/runtime';
2
- export declare const mfPlugin: () => RuntimePluginFuture;