@umijs/plugins 4.6.18 → 4.6.19
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/qiankun/master.js
CHANGED
|
@@ -203,7 +203,8 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
|
|
|
203
203
|
path: file.replace(/\.tpl$/, ""),
|
|
204
204
|
content: content.replace(
|
|
205
205
|
"__USE_MODEL__",
|
|
206
|
-
api.isPluginEnable("model") ? `import { useModel } from '@@/plugin-model'` : `
|
|
206
|
+
api.isPluginEnable("model") ? `import { useModel } from '@@/plugin-model'` : `console.warn(\`[plugins/qiankun]: Seems like you're not using @umijs/plugin-model, you need to install it or some features may not work!\`);
|
|
207
|
+
const useModel = null`
|
|
207
208
|
).replace(
|
|
208
209
|
/from 'lodash\//g,
|
|
209
210
|
`from '${(0, import_plugin_utils.winPath)((0, import_path.dirname)(require.resolve("lodash/package")))}/`
|
package/dist/qiankun/slave.js
CHANGED
|
@@ -250,7 +250,8 @@ if (!isServer && !window.__POWERED_BY_QIANKUN__) {
|
|
|
250
250
|
path: file.replace(/\.tpl$/, ""),
|
|
251
251
|
content: getFileContent(file).replace(
|
|
252
252
|
"__USE_MODEL__",
|
|
253
|
-
api.isPluginEnable("model") ? `import { useModel } from '@@/plugin-model'` : `
|
|
253
|
+
api.isPluginEnable("model") ? `import { useModel } from '@@/plugin-model'` : `console.warn(\`[plugins/qiankun]: Seems like you're not using @umijs/plugin-model, you need to install it or some features may not work!\`);
|
|
254
|
+
const useModel = null`
|
|
254
255
|
).replace(
|
|
255
256
|
/from 'qiankun'/g,
|
|
256
257
|
`from '${(0, import_plugin_utils.winPath)((0, import_path.dirname)(require.resolve("qiankun/package")))}'`
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
__USE_MODEL__;
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { qiankunStateFromMasterModelNamespace } from './constants';
|
|
4
5
|
|
|
5
6
|
const noop = () => {};
|
|
6
7
|
|
|
7
8
|
const connectMaster = <T extends object>(Component: React.ComponentType<T>) => {
|
|
8
9
|
return (props: T, ...rest: any[]) => {
|
|
9
|
-
const masterProps =
|
|
10
|
+
const masterProps =
|
|
11
|
+
(useModel || noop)(qiankunStateFromMasterModelNamespace) || {};
|
|
10
12
|
return <Component {...props} {...rest} {...masterProps} />;
|
|
11
13
|
};
|
|
12
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.19",
|
|
4
4
|
"description": "@umijs/plugins",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"styled-components": "6.1.1",
|
|
46
46
|
"tslib": "^2",
|
|
47
47
|
"warning": "^4.0.3",
|
|
48
|
-
"@umijs/bundler-utils": "4.6.
|
|
48
|
+
"@umijs/bundler-utils": "4.6.19",
|
|
49
49
|
"@umijs/valtio": "1.0.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"antd": "^4.24.1",
|
|
53
|
-
"umi": "4.6.
|
|
53
|
+
"umi": "4.6.19"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|