@module-federation/modern-js 0.0.0-next-20250708033956 → 0.0.0-next-20250708121428
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/dist/cjs/cli/configPlugin.js +0 -1
- package/dist/cjs/cli/configPlugin.spec.js +1 -2
- package/dist/cjs/react/index.js +4 -10
- package/dist/cjs/runtime/plugin.js +43 -0
- package/dist/esm/cli/configPlugin.js +0 -1
- package/dist/esm/cli/configPlugin.spec.js +1 -2
- package/dist/esm/react/index.js +3 -6
- package/dist/esm/runtime/plugin.js +19 -0
- package/dist/esm-node/cli/configPlugin.js +0 -1
- package/dist/esm-node/cli/configPlugin.spec.js +1 -2
- package/dist/esm-node/react/index.js +3 -6
- package/dist/esm-node/runtime/plugin.js +19 -0
- package/dist/types/react/index.d.ts +1 -1
- package/dist/types/runtime/plugin.d.ts +2 -0
- package/package.json +16 -9
|
@@ -148,7 +148,6 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy, enableSSR) => {
|
|
|
148
148
|
];
|
|
149
149
|
patchDTSConfig(mfConfig, isServer);
|
|
150
150
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
151
|
-
injectRuntimePlugins(require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"), runtimePlugins);
|
|
152
151
|
if (enableSSR && (0, import_utils3.isDev)()) {
|
|
153
152
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
|
|
154
153
|
}
|
|
@@ -61,7 +61,6 @@ const mfConfig = {
|
|
|
61
61
|
remoteType: "script",
|
|
62
62
|
runtimePlugins: [
|
|
63
63
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
64
|
-
require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"),
|
|
65
64
|
require.resolve("@module-federation/node/runtimePlugin"),
|
|
66
65
|
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
67
66
|
],
|
|
@@ -90,7 +89,7 @@ const mfConfig = {
|
|
|
90
89
|
remoteType: "script",
|
|
91
90
|
runtimePlugins: [
|
|
92
91
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
93
|
-
require.resolve("@module-federation/bridge-react/
|
|
92
|
+
require.resolve("@module-federation/bridge-react/lazy-load-component-plugin")
|
|
94
93
|
],
|
|
95
94
|
shared: {
|
|
96
95
|
react: {
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -23,13 +23,10 @@ __export(react_exports, {
|
|
|
23
23
|
ERROR_TYPE: () => import_bridge_react.ERROR_TYPE,
|
|
24
24
|
cache: () => import_bridge_react.cache,
|
|
25
25
|
clearStore: () => import_bridge_react.clearStore,
|
|
26
|
-
collectSSRAssets: () => import_bridge_react.collectSSRAssets,
|
|
27
26
|
configureCache: () => import_bridge_react.configureCache,
|
|
28
|
-
createLazyComponent: () => import_bridge_react.createLazyComponent,
|
|
29
27
|
generateKey: () => import_bridge_react.generateKey,
|
|
30
|
-
|
|
31
|
-
revalidateTag: () => import_bridge_react.revalidateTag
|
|
32
|
-
wrapNoSSR: () => import_bridge_react.wrapNoSSR
|
|
28
|
+
lazyLoadComponentPlugin: () => import_bridge_react.lazyLoadComponentPlugin,
|
|
29
|
+
revalidateTag: () => import_bridge_react.revalidateTag
|
|
33
30
|
});
|
|
34
31
|
module.exports = __toCommonJS(react_exports);
|
|
35
32
|
var import_bridge_react = require("@module-federation/bridge-react");
|
|
@@ -40,11 +37,8 @@ var import_bridge_react = require("@module-federation/bridge-react");
|
|
|
40
37
|
ERROR_TYPE,
|
|
41
38
|
cache,
|
|
42
39
|
clearStore,
|
|
43
|
-
collectSSRAssets,
|
|
44
40
|
configureCache,
|
|
45
|
-
createLazyComponent,
|
|
46
41
|
generateKey,
|
|
47
|
-
|
|
48
|
-
revalidateTag
|
|
49
|
-
wrapNoSSR
|
|
42
|
+
lazyLoadComponentPlugin,
|
|
43
|
+
revalidateTag
|
|
50
44
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
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 plugin_exports = {};
|
|
20
|
+
__export(plugin_exports, {
|
|
21
|
+
mfPlugin: () => mfPlugin
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
+
var import_runtime = require("@module-federation/enhanced/runtime");
|
|
25
|
+
var import_bridge_react = require("@module-federation/bridge-react");
|
|
26
|
+
const mfPlugin = () => {
|
|
27
|
+
return {
|
|
28
|
+
name: "@modern-js/plugin-mf",
|
|
29
|
+
setup: (api) => {
|
|
30
|
+
api.wrapRoot((App) => {
|
|
31
|
+
var _getInstance;
|
|
32
|
+
(_getInstance = (0, import_runtime.getInstance)()) === null || _getInstance === void 0 ? void 0 : _getInstance.registerPlugins([
|
|
33
|
+
(0, import_bridge_react.lazyLoadComponentPlugin)()
|
|
34
|
+
]);
|
|
35
|
+
return App;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
mfPlugin
|
|
43
|
+
});
|
|
@@ -138,7 +138,6 @@ var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy, enableSSR) {
|
|
|
138
138
|
var runtimePlugins = _to_consumable_array(mfConfig.runtimePlugins || []);
|
|
139
139
|
patchDTSConfig(mfConfig, isServer);
|
|
140
140
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
141
|
-
injectRuntimePlugins(require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"), runtimePlugins);
|
|
142
141
|
if (enableSSR && isDev()) {
|
|
143
142
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
|
|
144
143
|
}
|
|
@@ -43,7 +43,6 @@ describe("patchMFConfig", /* @__PURE__ */ _async_to_generator(function() {
|
|
|
43
43
|
remoteType: "script",
|
|
44
44
|
runtimePlugins: [
|
|
45
45
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
46
|
-
require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"),
|
|
47
46
|
require.resolve("@module-federation/node/runtimePlugin"),
|
|
48
47
|
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
49
48
|
],
|
|
@@ -78,7 +77,7 @@ describe("patchMFConfig", /* @__PURE__ */ _async_to_generator(function() {
|
|
|
78
77
|
remoteType: "script",
|
|
79
78
|
runtimePlugins: [
|
|
80
79
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
81
|
-
require.resolve("@module-federation/bridge-react/
|
|
80
|
+
require.resolve("@module-federation/bridge-react/lazy-load-component-plugin")
|
|
82
81
|
],
|
|
83
82
|
shared: {
|
|
84
83
|
react: {
|
package/dist/esm/react/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { ERROR_TYPE,
|
|
1
|
+
import { ERROR_TYPE, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, lazyLoadComponentPlugin } from "@module-federation/bridge-react";
|
|
2
2
|
export {
|
|
3
3
|
CacheSize,
|
|
4
4
|
CacheTime,
|
|
5
5
|
ERROR_TYPE,
|
|
6
6
|
cache,
|
|
7
7
|
clearStore,
|
|
8
|
-
collectSSRAssets,
|
|
9
8
|
configureCache,
|
|
10
|
-
createLazyComponent,
|
|
11
9
|
generateKey,
|
|
12
|
-
|
|
13
|
-
revalidateTag
|
|
14
|
-
wrapNoSSR
|
|
10
|
+
lazyLoadComponentPlugin,
|
|
11
|
+
revalidateTag
|
|
15
12
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
@@ -107,7 +107,6 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy, enableSSR) => {
|
|
|
107
107
|
];
|
|
108
108
|
patchDTSConfig(mfConfig, isServer);
|
|
109
109
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
110
|
-
injectRuntimePlugins(require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"), runtimePlugins);
|
|
111
110
|
if (enableSSR && isDev()) {
|
|
112
111
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
|
|
113
112
|
}
|
|
@@ -38,7 +38,6 @@ describe("patchMFConfig", async () => {
|
|
|
38
38
|
remoteType: "script",
|
|
39
39
|
runtimePlugins: [
|
|
40
40
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
41
|
-
require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"),
|
|
42
41
|
require.resolve("@module-federation/node/runtimePlugin"),
|
|
43
42
|
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
44
43
|
],
|
|
@@ -67,7 +66,7 @@ describe("patchMFConfig", async () => {
|
|
|
67
66
|
remoteType: "script",
|
|
68
67
|
runtimePlugins: [
|
|
69
68
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
70
|
-
require.resolve("@module-federation/bridge-react/
|
|
69
|
+
require.resolve("@module-federation/bridge-react/lazy-load-component-plugin")
|
|
71
70
|
],
|
|
72
71
|
shared: {
|
|
73
72
|
react: {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { ERROR_TYPE,
|
|
1
|
+
import { ERROR_TYPE, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, lazyLoadComponentPlugin } from "@module-federation/bridge-react";
|
|
2
2
|
export {
|
|
3
3
|
CacheSize,
|
|
4
4
|
CacheTime,
|
|
5
5
|
ERROR_TYPE,
|
|
6
6
|
cache,
|
|
7
7
|
clearStore,
|
|
8
|
-
collectSSRAssets,
|
|
9
8
|
configureCache,
|
|
10
|
-
createLazyComponent,
|
|
11
9
|
generateKey,
|
|
12
|
-
|
|
13
|
-
revalidateTag
|
|
14
|
-
wrapNoSSR
|
|
10
|
+
lazyLoadComponentPlugin,
|
|
11
|
+
revalidateTag
|
|
15
12
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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 +1,2 @@
|
|
|
1
|
-
export { ERROR_TYPE,
|
|
1
|
+
export { ERROR_TYPE, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, lazyLoadComponentPlugin, } from '@module-federation/bridge-react';
|
|
2
2
|
export type { DataFetchParams, CacheStatus, CacheStatsInfo, } from '@module-federation/bridge-react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/modern-js",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250708121428",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"types": "./dist/types/runtime/index.d.ts",
|
|
25
25
|
"default": "./dist/esm/runtime/index.js"
|
|
26
26
|
},
|
|
27
|
+
"./runtime-plugin": {
|
|
28
|
+
"types": "./dist/types/runtime/plugin.d.ts",
|
|
29
|
+
"default": "./dist/esm/runtime/plugin.js"
|
|
30
|
+
},
|
|
27
31
|
"./react": {
|
|
28
32
|
"types": "./dist/types/react/index.d.ts",
|
|
29
33
|
"default": "./dist/esm/react/index.js"
|
|
@@ -78,6 +82,9 @@
|
|
|
78
82
|
"runtime": [
|
|
79
83
|
"./dist/types/runtime/index.d.ts"
|
|
80
84
|
],
|
|
85
|
+
"runtime-plugin": [
|
|
86
|
+
"./dist/types/runtime/plugin.d.ts"
|
|
87
|
+
],
|
|
81
88
|
"react": [
|
|
82
89
|
"./dist/types/react/index.d.ts"
|
|
83
90
|
],
|
|
@@ -119,13 +126,13 @@
|
|
|
119
126
|
"@swc/helpers": "^0.5.17",
|
|
120
127
|
"node-fetch": "~3.3.0",
|
|
121
128
|
"react-error-boundary": "4.1.2",
|
|
122
|
-
"@module-federation/rsbuild-plugin": "0.0.0-next-
|
|
123
|
-
"@module-federation/bridge-react": "0.0.0-next-
|
|
124
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
125
|
-
"@module-federation/runtime": "0.0.0-next-
|
|
126
|
-
"@module-federation/node": "0.0.0-next-
|
|
127
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
128
|
-
"@module-federation/cli": "0.0.0-next-
|
|
129
|
+
"@module-federation/rsbuild-plugin": "0.0.0-next-20250708121428",
|
|
130
|
+
"@module-federation/bridge-react": "0.0.0-next-20250708121428",
|
|
131
|
+
"@module-federation/enhanced": "0.0.0-next-20250708121428",
|
|
132
|
+
"@module-federation/runtime": "0.0.0-next-20250708121428",
|
|
133
|
+
"@module-federation/node": "0.0.0-next-20250708121428",
|
|
134
|
+
"@module-federation/sdk": "0.0.0-next-20250708121428",
|
|
135
|
+
"@module-federation/cli": "0.0.0-next-20250708121428"
|
|
129
136
|
},
|
|
130
137
|
"devDependencies": {
|
|
131
138
|
"@modern-js/core": "2.67.5",
|
|
@@ -135,7 +142,7 @@
|
|
|
135
142
|
"@modern-js/module-tools": "2.67.6",
|
|
136
143
|
"@modern-js/runtime": "2.67.6",
|
|
137
144
|
"@modern-js/tsconfig": "2.67.6",
|
|
138
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
145
|
+
"@module-federation/manifest": "0.0.0-next-20250708121428"
|
|
139
146
|
},
|
|
140
147
|
"peerDependencies": {
|
|
141
148
|
"react": ">=17",
|