@umijs/plugins 4.0.0-canary.20230216.1 → 4.0.0-canary.20230223.1

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/access.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/dva.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/layout.js CHANGED
@@ -318,7 +318,7 @@ const { formatMessage } = useIntl();
318
318
  unAccessible?: JSX.Element;
319
319
  noFound?: JSX.Element;
320
320
  logout?: (initialState: InitDataType['initialState']) => Promise<void> | void;
321
- rightContentRender?: (
321
+ rightContentRender?: ((
322
322
  headerProps: HeaderProps,
323
323
  dom: JSX.Element,
324
324
  props: {
@@ -328,7 +328,7 @@ const { formatMessage } = useIntl();
328
328
  initialState: InitDataType['initialState'];
329
329
  setInitialState: InitDataType['setInitialState'];
330
330
  },
331
- ) => JSX.Element;
331
+ ) => JSX.Element) | false;
332
332
  rightRender?: (
333
333
  initialState: InitDataType['initialState'],
334
334
  setInitialState: InitDataType['setInitialState'],
@@ -399,7 +399,7 @@ export function patchRoutes({ routes }) {
399
399
  const rightRenderContent = `
400
400
  import React from 'react';
401
401
  import { Avatar, version, Dropdown, Menu, Spin } from 'antd';
402
- import { LogoutOutlined } from '@ant-design/icons';
402
+ import { LogoutOutlined } from '${antIconsPath}';
403
403
  {{#Locale}}
404
404
  import { SelectLang } from '@@/plugin-locale';
405
405
  {{/Locale}}
package/dist/locale.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/mf.js CHANGED
@@ -109,6 +109,7 @@ function mf(api) {
109
109
  });
110
110
  api.onGenerateFiles(() => {
111
111
  api.writeTmpFile({
112
+ // ref https://webpack.js.org/concepts/module-federation/#infer-publicpath-from-script
112
113
  content: `/* infer remote public */;
113
114
  __webpack_public_path__ = document.currentScript.src + '/../';`,
114
115
  path: mfSetupPathFileName
package/dist/model.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
  ));
@@ -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
  ));
@@ -38,6 +42,7 @@ var moment2dayjs_default = (api) => {
38
42
  return Joi.alternatives().try(
39
43
  Joi.object({
40
44
  preset: Joi.string(),
45
+ // 'antd' | 'antdv3 | 'none'
41
46
  plugins: Joi.array()
42
47
  }),
43
48
  Joi.boolean().invalid(true)
@@ -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
  ));
@@ -130,6 +134,7 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
130
134
  });
131
135
  api.writeTmpFile({
132
136
  path: "MicroAppLoader.tsx",
137
+ // 开启了 antd 插件的时候,使用 antd 的 loader 组件,否则提示用户必须设置一个自定义的 loader 组件
133
138
  content: api.isPluginEnable("antd") ? getFileContent("AntdLoader.tsx") : `export default function Loader() { console.warn(\`[plugins/qiankun]: Seems like you'r not using @umijs/plugin-antd, you need to provide a custom loader or set autoSetLoading false to shut down this warning!\`); return null; }`
134
139
  });
135
140
  [
@@ -150,6 +155,8 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
150
155
  context: {
151
156
  dynamicRoot: false,
152
157
  hasModelPlugin: api.isPluginEnable("model")
158
+ // dynamicRoot:
159
+ // api.config.exportStatic && api.config.exportStatic.dynamicRoot,
153
160
  }
154
161
  });
155
162
  } else {
@@ -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
  ));
@@ -51,7 +55,7 @@ function handleOriginalHtml(api, microAppEntry, originalHtml) {
51
55
  );
52
56
  const $ = import_utils.cheerio.load(originalHtml);
53
57
  $("head").prepend(
54
- `<script>window.__QIANKUN_DEVELOPMENT__=true<\/script>
58
+ `<script>window.__QIANKUN_DEVELOPMENT__=true</script>
55
59
  <script type="extra-qiankun-config">${JSON.stringify({
56
60
  master: {
57
61
  apps: [
@@ -71,7 +75,7 @@ function handleOriginalHtml(api, microAppEntry, originalHtml) {
71
75
  ],
72
76
  prefetch: false
73
77
  }
74
- })}<\/script>`
78
+ })}</script>`
75
79
  );
76
80
  return api.applyPlugins({
77
81
  key: "modifyMasterHTML",
@@ -139,6 +143,7 @@ export interface IRuntimeConfig {
139
143
  };
140
144
  const modifiedDefaultConfig = {
141
145
  ...memo,
146
+ // 默认开启 runtimePublicPath,避免出现 dynamic import 场景子应用资源地址出问题
142
147
  runtimePublicPath: true,
143
148
  qiankun: {
144
149
  ...memo.qiankun,
package/dist/qiankun.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
  ));
@@ -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
  ));
@@ -91,6 +91,8 @@ var getLocaleList = async (opts) => {
91
91
  return {
92
92
  lang,
93
93
  name,
94
+ // react-intl Function.supportedLocalesOf
95
+ // Uncaught RangeError: Incorrect locale information provided
94
96
  locale: name.split(separator).join("-"),
95
97
  country,
96
98
  antdLocale,
@@ -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
  ));
@@ -210,6 +214,7 @@ ${modelProps.join("\n")}
210
214
  }
211
215
  };
212
216
  var ModelUtils = _ModelUtils;
217
+ // https://github.com/umijs/umi/issues/9837
213
218
  ModelUtils.topologicalSort = (models) => {
214
219
  const graph = [];
215
220
  const namespaceToNode = {};
package/dist/valtio.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
  ));
@@ -144,7 +144,7 @@ export const MicroApp = forwardRef(
144
144
  const stateForSlave = (useModel || noop)(
145
145
  qiankunStateForSlaveModelNamespace,
146
146
  );
147
- const { entry, props: propsFromConfig = {} } = appConfig || {};
147
+ const { entry, props: { settings: settingsFromConfig = {}, ...propsFromConfig } = {} } = appConfig || {};
148
148
 
149
149
  useEffect(() => {
150
150
  setComponentError(null);
@@ -152,6 +152,7 @@ export const MicroApp = forwardRef(
152
152
  const configuration = {
153
153
  globalContext: window,
154
154
  ...globalSettings,
155
+ ...settingsFromConfig,
155
156
  ...settingsFromProps,
156
157
  };
157
158
  microAppRef.current = loadMicroApp(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20230216.1",
3
+ "version": "4.0.0-canary.20230223.1",
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",
@@ -29,7 +29,7 @@
29
29
  "@ant-design/pro-components": "^2.0.1",
30
30
  "@tanstack/react-query": "^4.22.0",
31
31
  "@tanstack/react-query-devtools": "^4.22.0",
32
- "@umijs/bundler-utils": "4.0.0-canary.20230216.1",
32
+ "@umijs/bundler-utils": "4.0.0-canary.20230223.1",
33
33
  "@umijs/valtio": "^1.0.3",
34
34
  "antd-dayjs-webpack-plugin": "^1.0.6",
35
35
  "axios": "^0.27.2",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "antd": "^4.24.1",
56
- "umi": "4.0.0-canary.20230216.1"
56
+ "umi": "4.0.0-canary.20230223.1"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"