@modern-js/plugin-garfish 2.5.0 → 2.6.0
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 +14 -0
- package/dist/cjs/deps/index.js +4 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/runtime/index.js +4 -0
- package/dist/cjs/runtime/loadable.js +12 -8
- package/dist/cjs/runtime/plugin.js +5 -6
- package/dist/cjs/runtime/useModuleApps.js +4 -0
- package/dist/cjs/runtime/utils/Context.js +4 -0
- package/dist/cjs/runtime/utils/MApp.js +5 -5
- package/dist/cjs/runtime/utils/apps.js +5 -6
- package/dist/cjs/runtime/utils/setExternal.js +4 -0
- package/dist/cjs/util.js +4 -0
- package/dist/esm-node/runtime/loadable.js +12 -8
- package/dist/esm-node/runtime/plugin.js +1 -6
- package/dist/esm-node/runtime/utils/MApp.js +1 -5
- package/dist/esm-node/runtime/utils/apps.js +1 -6
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @modern-js/plugin-garfish
|
|
2
2
|
|
|
3
|
+
## 2.6.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [671477d]
|
|
8
|
+
- Updated dependencies [e1f799e]
|
|
9
|
+
- Updated dependencies [7915ab3]
|
|
10
|
+
- Updated dependencies [a909ad1]
|
|
11
|
+
- Updated dependencies [49fa0b1]
|
|
12
|
+
- Updated dependencies [0fe658a]
|
|
13
|
+
- Updated dependencies [1906d7b]
|
|
14
|
+
- @modern-js/runtime@2.6.0
|
|
15
|
+
- @modern-js/utils@2.6.0
|
|
16
|
+
|
|
3
17
|
## 2.5.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/deps/index.js
CHANGED
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -97,16 +97,20 @@ function Loadable(WrapComponent) {
|
|
|
97
97
|
[state]
|
|
98
98
|
);
|
|
99
99
|
const showLoading = (state.isLoading || state.error) && LoadingComponent;
|
|
100
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
101
|
+
showLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
LoadingComponent,
|
|
103
|
+
{
|
|
103
104
|
isLoading: state.isLoading,
|
|
104
105
|
pastDelay: state.pastDelay,
|
|
105
106
|
timedOut: state.timedOut,
|
|
106
107
|
error: state == null ? void 0 : state.error,
|
|
107
108
|
retry
|
|
108
|
-
}
|
|
109
|
-
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
WrapComponent,
|
|
113
|
+
{
|
|
110
114
|
style: { display: showLoading ? "none" : "block" },
|
|
111
115
|
setLoadingState: (props2) => {
|
|
112
116
|
if (props2.error && !LoadingComponent) {
|
|
@@ -115,9 +119,9 @@ function Loadable(WrapComponent) {
|
|
|
115
119
|
setStateWithMountCheck(props2);
|
|
116
120
|
},
|
|
117
121
|
...otherProps
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
});
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
121
125
|
};
|
|
122
126
|
};
|
|
123
127
|
}
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -115,12 +119,7 @@ var plugin_default = (config) => ({
|
|
|
115
119
|
}
|
|
116
120
|
render() {
|
|
117
121
|
(0, import_util.logger)("GarfishProvider state", this.state);
|
|
118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Context.GarfishProvider, {
|
|
119
|
-
value: this.state,
|
|
120
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
121
|
-
...this.props
|
|
122
|
-
})
|
|
123
|
-
});
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Context.GarfishProvider, { value: this.state, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { ...this.props }) });
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
return next({
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -151,11 +155,7 @@ function generateMApp(options, manifest) {
|
|
|
151
155
|
render() {
|
|
152
156
|
const { style } = this.props;
|
|
153
157
|
const { SubModuleComponent } = this.state;
|
|
154
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
155
|
-
style: { ...style },
|
|
156
|
-
id: (0, import_util.generateSubAppContainerKey)(),
|
|
157
|
-
children: SubModuleComponent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubModuleComponent, {})
|
|
158
|
-
});
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...style }, id: (0, import_util.generateSubAppContainerKey)(), children: SubModuleComponent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubModuleComponent, {}) });
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
return (0, import_loadable.Loadable)(MApp)(manifest == null ? void 0 : manifest.loadable);
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -185,12 +189,7 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
185
189
|
}
|
|
186
190
|
};
|
|
187
191
|
}, []);
|
|
188
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
189
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
190
|
-
id: domId,
|
|
191
|
-
children: SubModuleComponent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubModuleComponent, {})
|
|
192
|
-
})
|
|
193
|
-
});
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: domId, children: SubModuleComponent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubModuleComponent, {}) }) });
|
|
194
193
|
}
|
|
195
194
|
return (0, import_loadable.Loadable)(MicroApp)(manifest == null ? void 0 : manifest.loadable);
|
|
196
195
|
}
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
package/dist/cjs/util.js
CHANGED
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -75,16 +75,20 @@ function Loadable(WrapComponent) {
|
|
|
75
75
|
[state]
|
|
76
76
|
);
|
|
77
77
|
const showLoading = (state.isLoading || state.error) && LoadingComponent;
|
|
78
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
showLoading && /* @__PURE__ */ jsx(
|
|
80
|
+
LoadingComponent,
|
|
81
|
+
{
|
|
81
82
|
isLoading: state.isLoading,
|
|
82
83
|
pastDelay: state.pastDelay,
|
|
83
84
|
timedOut: state.timedOut,
|
|
84
85
|
error: state == null ? void 0 : state.error,
|
|
85
86
|
retry
|
|
86
|
-
}
|
|
87
|
-
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
WrapComponent,
|
|
91
|
+
{
|
|
88
92
|
style: { display: showLoading ? "none" : "block" },
|
|
89
93
|
setLoadingState: (props2) => {
|
|
90
94
|
if (props2.error && !LoadingComponent) {
|
|
@@ -93,9 +97,9 @@ function Loadable(WrapComponent) {
|
|
|
93
97
|
setStateWithMountCheck(props2);
|
|
94
98
|
},
|
|
95
99
|
...otherProps
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
});
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] });
|
|
99
103
|
};
|
|
100
104
|
};
|
|
101
105
|
}
|
|
@@ -87,12 +87,7 @@ var plugin_default = (config) => ({
|
|
|
87
87
|
}
|
|
88
88
|
render() {
|
|
89
89
|
logger("GarfishProvider state", this.state);
|
|
90
|
-
return /* @__PURE__ */ jsx(GarfishProvider, {
|
|
91
|
-
value: this.state,
|
|
92
|
-
children: /* @__PURE__ */ jsx(App, {
|
|
93
|
-
...this.props
|
|
94
|
-
})
|
|
95
|
-
});
|
|
90
|
+
return /* @__PURE__ */ jsx(GarfishProvider, { value: this.state, children: /* @__PURE__ */ jsx(App, { ...this.props }) });
|
|
96
91
|
}
|
|
97
92
|
}
|
|
98
93
|
return next({
|
|
@@ -123,11 +123,7 @@ function generateMApp(options, manifest) {
|
|
|
123
123
|
render() {
|
|
124
124
|
const { style } = this.props;
|
|
125
125
|
const { SubModuleComponent } = this.state;
|
|
126
|
-
return /* @__PURE__ */ jsx("div", {
|
|
127
|
-
style: { ...style },
|
|
128
|
-
id: generateSubAppContainerKey(),
|
|
129
|
-
children: SubModuleComponent && /* @__PURE__ */ jsx(SubModuleComponent, {})
|
|
130
|
-
});
|
|
126
|
+
return /* @__PURE__ */ jsx("div", { style: { ...style }, id: generateSubAppContainerKey(), children: SubModuleComponent && /* @__PURE__ */ jsx(SubModuleComponent, {}) });
|
|
131
127
|
}
|
|
132
128
|
}
|
|
133
129
|
return Loadable(MApp)(manifest == null ? void 0 : manifest.loadable);
|
|
@@ -156,12 +156,7 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
}, []);
|
|
159
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
160
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
161
|
-
id: domId,
|
|
162
|
-
children: SubModuleComponent && /* @__PURE__ */ jsx(SubModuleComponent, {})
|
|
163
|
-
})
|
|
164
|
-
});
|
|
159
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { id: domId, children: SubModuleComponent && /* @__PURE__ */ jsx(SubModuleComponent, {}) }) });
|
|
165
160
|
}
|
|
166
161
|
return Loadable(MicroApp)(manifest == null ? void 0 : manifest.loadable);
|
|
167
162
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.6.0",
|
|
15
15
|
"jsnext:source": "./src/cli/index.ts",
|
|
16
16
|
"types": "./dist/types/cli/index.d.ts",
|
|
17
17
|
"typesVersions": {
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"garfish": "^1.8.1",
|
|
63
63
|
"hoist-non-react-statics": "^3.3.2",
|
|
64
64
|
"react-loadable": "^5.5.0",
|
|
65
|
-
"@modern-js/utils": "2.
|
|
65
|
+
"@modern-js/utils": "2.6.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@modern-js/runtime": "^2.
|
|
68
|
+
"@modern-js/runtime": "^2.6.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"@modern-js/runtime": {
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
"react-router-dom": "^6.6.0",
|
|
88
88
|
"typescript": "^4",
|
|
89
89
|
"webpack-chain": "^6.5.1",
|
|
90
|
-
"@modern-js/app-tools": "2.
|
|
91
|
-
"@modern-js/core": "2.
|
|
92
|
-
"@modern-js/runtime": "2.
|
|
93
|
-
"@modern-js/
|
|
94
|
-
"@modern-js/
|
|
95
|
-
"@scripts/build": "2.
|
|
96
|
-
"@scripts/jest-config": "2.
|
|
90
|
+
"@modern-js/app-tools": "2.6.0",
|
|
91
|
+
"@modern-js/core": "2.6.0",
|
|
92
|
+
"@modern-js/runtime": "2.6.0",
|
|
93
|
+
"@modern-js/types": "2.6.0",
|
|
94
|
+
"@modern-js/plugin-router-v5": "2.6.0",
|
|
95
|
+
"@scripts/build": "2.6.0",
|
|
96
|
+
"@scripts/jest-config": "2.6.0"
|
|
97
97
|
},
|
|
98
98
|
"sideEffects": false,
|
|
99
99
|
"modernConfig": {},
|