@module-federation/modern-js 0.0.0-next-20240716130450 → 0.0.0-next-20240718035334
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/index.js +0 -1
- package/dist/cjs/cli/ssrPlugin.js +0 -1
- package/dist/cjs/runtime/createRemoteSSRComponent.js +1 -2
- package/dist/esm/cli/configPlugin.js +0 -1
- package/dist/esm/cli/index.js +0 -1
- package/dist/esm/cli/ssrPlugin.js +0 -1
- package/dist/esm/runtime/createRemoteSSRComponent.js +1 -5
- package/dist/esm-node/cli/configPlugin.js +0 -1
- package/dist/esm-node/cli/index.js +0 -1
- package/dist/esm-node/cli/ssrPlugin.js +0 -1
- package/dist/esm-node/runtime/createRemoteSSRComponent.js +1 -2
- package/dist/types/runtime/createRemoteSSRComponent.d.ts +2 -2
- package/package.json +5 -5
|
@@ -67,7 +67,6 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
67
67
|
"@modern-js/plugin-module-federation"
|
|
68
68
|
],
|
|
69
69
|
setup: async ({ useConfigContext, useAppContext }) => {
|
|
70
|
-
console.log("config plugin");
|
|
71
70
|
const modernjsConfig = useConfigContext();
|
|
72
71
|
const mfConfig = await (0, import_utils.getMFConfig)(userConfig.originPluginOptions);
|
|
73
72
|
const csrConfig = userConfig.csrConfig || JSON.parse(JSON.stringify(mfConfig));
|
package/dist/cjs/cli/index.js
CHANGED
|
@@ -41,7 +41,6 @@ const moduleFederationPlugin = (userConfig = {}) => {
|
|
|
41
41
|
return {
|
|
42
42
|
name: "@modern-js/plugin-module-federation",
|
|
43
43
|
setup: async ({ useConfigContext }) => {
|
|
44
|
-
console.log("main plugin");
|
|
45
44
|
const modernjsConfig = useConfigContext();
|
|
46
45
|
return {
|
|
47
46
|
config: async () => {
|
|
@@ -52,7 +52,6 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
52
52
|
],
|
|
53
53
|
setup: async ({ useConfigContext }) => {
|
|
54
54
|
var _modernjsConfig_server;
|
|
55
|
-
console.log("ssr plugin");
|
|
56
55
|
const modernjsConfig = useConfigContext();
|
|
57
56
|
const enableSSR = Boolean(modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.ssr);
|
|
58
57
|
if (!enableSSR) {
|
|
@@ -140,7 +140,6 @@ function collectSSRAssets(options) {
|
|
|
140
140
|
}
|
|
141
141
|
function createRemoteSSRComponent(info) {
|
|
142
142
|
return (props) => {
|
|
143
|
-
const { key, ...rest } = props;
|
|
144
143
|
const exportName = (info === null || info === void 0 ? void 0 : info.export) || "default";
|
|
145
144
|
const LazyComponent = /* @__PURE__ */ import_react.default.lazy(async () => {
|
|
146
145
|
try {
|
|
@@ -159,7 +158,7 @@ function createRemoteSSRComponent(info) {
|
|
|
159
158
|
children: [
|
|
160
159
|
assets,
|
|
161
160
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Com, {
|
|
162
|
-
...
|
|
161
|
+
...props
|
|
163
162
|
})
|
|
164
163
|
]
|
|
165
164
|
})
|
|
@@ -40,7 +40,6 @@ var moduleFederationConfigPlugin = function(userConfig) {
|
|
|
40
40
|
switch (_state.label) {
|
|
41
41
|
case 0:
|
|
42
42
|
useConfigContext = param.useConfigContext, useAppContext = param.useAppContext;
|
|
43
|
-
console.log("config plugin");
|
|
44
43
|
modernjsConfig = useConfigContext();
|
|
45
44
|
return [
|
|
46
45
|
4,
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -22,7 +22,6 @@ var moduleFederationPlugin = function() {
|
|
|
22
22
|
var useConfigContext, modernjsConfig;
|
|
23
23
|
return _ts_generator(this, function(_state) {
|
|
24
24
|
useConfigContext = param.useConfigContext;
|
|
25
|
-
console.log("main plugin");
|
|
26
25
|
modernjsConfig = useConfigContext();
|
|
27
26
|
return [
|
|
28
27
|
2,
|
|
@@ -23,7 +23,6 @@ var moduleFederationSSRPlugin = function(userConfig) {
|
|
|
23
23
|
var useConfigContext, _modernjsConfig_server, modernjsConfig, enableSSR;
|
|
24
24
|
return _ts_generator(this, function(_state) {
|
|
25
25
|
useConfigContext = param.useConfigContext;
|
|
26
|
-
console.log("ssr plugin");
|
|
27
26
|
modernjsConfig = useConfigContext();
|
|
28
27
|
enableSSR = Boolean(modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.ssr);
|
|
29
28
|
if (!enableSSR) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
4
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
6
5
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
6
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -99,9 +98,6 @@ function collectSSRAssets(options) {
|
|
|
99
98
|
}
|
|
100
99
|
function createRemoteSSRComponent(info) {
|
|
101
100
|
return function(props) {
|
|
102
|
-
var key = props.key, rest = _object_without_properties(props, [
|
|
103
|
-
"key"
|
|
104
|
-
]);
|
|
105
101
|
var exportName = (info === null || info === void 0 ? void 0 : info.export) || "default";
|
|
106
102
|
var LazyComponent = /* @__PURE__ */ React.lazy(/* @__PURE__ */ _async_to_generator(function() {
|
|
107
103
|
var m, moduleId, assets, Com, err, FallbackFunctionComponent, FallbackNode;
|
|
@@ -136,7 +132,7 @@ function createRemoteSSRComponent(info) {
|
|
|
136
132
|
return /* @__PURE__ */ _jsxs(_Fragment, {
|
|
137
133
|
children: [
|
|
138
134
|
assets,
|
|
139
|
-
/* @__PURE__ */ _jsx(Com, _object_spread({},
|
|
135
|
+
/* @__PURE__ */ _jsx(Com, _object_spread({}, props))
|
|
140
136
|
]
|
|
141
137
|
});
|
|
142
138
|
}
|
|
@@ -31,7 +31,6 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
31
31
|
"@modern-js/plugin-module-federation"
|
|
32
32
|
],
|
|
33
33
|
setup: async ({ useConfigContext, useAppContext }) => {
|
|
34
|
-
console.log("config plugin");
|
|
35
34
|
const modernjsConfig = useConfigContext();
|
|
36
35
|
const mfConfig = await getMFConfig(userConfig.originPluginOptions);
|
|
37
36
|
const csrConfig = userConfig.csrConfig || JSON.parse(JSON.stringify(mfConfig));
|
|
@@ -15,7 +15,6 @@ const moduleFederationPlugin = (userConfig = {}) => {
|
|
|
15
15
|
return {
|
|
16
16
|
name: "@modern-js/plugin-module-federation",
|
|
17
17
|
setup: async ({ useConfigContext }) => {
|
|
18
|
-
console.log("main plugin");
|
|
19
18
|
const modernjsConfig = useConfigContext();
|
|
20
19
|
return {
|
|
21
20
|
config: async () => {
|
|
@@ -17,7 +17,6 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
17
17
|
],
|
|
18
18
|
setup: async ({ useConfigContext }) => {
|
|
19
19
|
var _modernjsConfig_server;
|
|
20
|
-
console.log("ssr plugin");
|
|
21
20
|
const modernjsConfig = useConfigContext();
|
|
22
21
|
const enableSSR = Boolean(modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.ssr);
|
|
23
22
|
if (!enableSSR) {
|
|
@@ -106,7 +106,6 @@ function collectSSRAssets(options) {
|
|
|
106
106
|
}
|
|
107
107
|
function createRemoteSSRComponent(info) {
|
|
108
108
|
return (props) => {
|
|
109
|
-
const { key, ...rest } = props;
|
|
110
109
|
const exportName = (info === null || info === void 0 ? void 0 : info.export) || "default";
|
|
111
110
|
const LazyComponent = /* @__PURE__ */ React.lazy(async () => {
|
|
112
111
|
try {
|
|
@@ -125,7 +124,7 @@ function createRemoteSSRComponent(info) {
|
|
|
125
124
|
children: [
|
|
126
125
|
assets,
|
|
127
126
|
/* @__PURE__ */ _jsx(Com, {
|
|
128
|
-
...
|
|
127
|
+
...props
|
|
129
128
|
})
|
|
130
129
|
]
|
|
131
130
|
})
|
|
@@ -5,7 +5,7 @@ type IProps = {
|
|
|
5
5
|
injectScript?: boolean;
|
|
6
6
|
injectLink?: boolean;
|
|
7
7
|
};
|
|
8
|
-
type
|
|
8
|
+
type ReactKey = {
|
|
9
9
|
key?: React.Key | null;
|
|
10
10
|
};
|
|
11
11
|
export declare function collectSSRAssets(options: IProps): React.ReactNode[];
|
|
@@ -14,5 +14,5 @@ export declare function createRemoteSSRComponent<T, E extends keyof T>(info: {
|
|
|
14
14
|
loading: React.ReactNode;
|
|
15
15
|
fallback: ErrorBoundaryPropsWithComponent['FallbackComponent'];
|
|
16
16
|
export?: E;
|
|
17
|
-
}): (props: T[E] extends (...args: any) => any ? Parameters<T[E]>[0] extends undefined ?
|
|
17
|
+
}): (props: T[E] extends (...args: any) => any ? Parameters<T[E]>[0] extends undefined ? ReactKey : Parameters<T[E]>[0] & ReactKey : ReactKey) => React.JSX.Element;
|
|
18
18
|
export {};
|
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-20240718035334",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"node-fetch": "~3.3.0",
|
|
62
62
|
"react-error-boundary": "4.0.13",
|
|
63
63
|
"hoist-non-react-statics": "3.3.2",
|
|
64
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
65
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
66
|
-
"@module-federation/node": "0.0.0-next-
|
|
64
|
+
"@module-federation/sdk": "0.0.0-next-20240718035334",
|
|
65
|
+
"@module-federation/enhanced": "0.0.0-next-20240718035334",
|
|
66
|
+
"@module-federation/node": "0.0.0-next-20240718035334"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/hoist-non-react-statics": "3.3.2",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@modern-js/runtime": "^2.55.0",
|
|
73
73
|
"@modern-js/module-tools": "^2.55.0",
|
|
74
74
|
"@modern-js/tsconfig": "^2.55.0",
|
|
75
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
75
|
+
"@module-federation/manifest": "0.0.0-next-20240718035334"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=17",
|