@umijs/plugins 4.0.0-canary.20220718.2 → 4.0.0-canary.20220729.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.
Files changed (72) hide show
  1. package/dist/access.d.ts +0 -1
  2. package/dist/access.js +69 -53
  3. package/dist/analytics.d.ts +0 -1
  4. package/dist/analytics.js +62 -41
  5. package/dist/antd.d.ts +0 -1
  6. package/dist/antd.js +139 -123
  7. package/dist/dva.d.ts +0 -1
  8. package/dist/dva.js +133 -142
  9. package/dist/icons.d.ts +0 -1
  10. package/dist/icons.js +28 -4
  11. package/dist/initial-state.d.ts +0 -1
  12. package/dist/initial-state.js +71 -54
  13. package/dist/layout.d.ts +0 -1
  14. package/dist/layout.js +205 -214
  15. package/dist/locale.d.ts +0 -1
  16. package/dist/locale.js +214 -192
  17. package/dist/mf.d.ts +2 -0
  18. package/dist/mf.js +197 -0
  19. package/dist/model.d.ts +0 -1
  20. package/dist/model.js +79 -78
  21. package/dist/moment2dayjs.d.ts +0 -1
  22. package/dist/moment2dayjs.js +102 -81
  23. package/dist/qiankun/constants.d.ts +0 -1
  24. package/dist/qiankun/constants.js +41 -8
  25. package/dist/qiankun/master.d.ts +0 -1
  26. package/dist/qiankun/master.js +147 -121
  27. package/dist/qiankun/slave.d.ts +0 -1
  28. package/dist/qiankun/slave.js +160 -150
  29. package/dist/qiankun.d.ts +0 -1
  30. package/dist/qiankun.js +46 -19
  31. package/dist/request.d.ts +0 -1
  32. package/dist/request.js +79 -55
  33. package/dist/tailwindcss.d.ts +0 -1
  34. package/dist/tailwindcss.js +70 -49
  35. package/dist/unocss.d.ts +0 -1
  36. package/dist/unocss.js +57 -37
  37. package/dist/utils/astUtils.d.ts +0 -1
  38. package/dist/utils/astUtils.js +38 -34
  39. package/dist/utils/localeUtils.d.ts +0 -1
  40. package/dist/utils/localeUtils.js +125 -120
  41. package/dist/utils/modelUtils.d.ts +0 -1
  42. package/dist/utils/modelUtils.js +216 -237
  43. package/dist/utils/resolveProjectDep.d.ts +0 -1
  44. package/dist/utils/resolveProjectDep.js +36 -13
  45. package/dist/utils/withTmpPath.d.ts +0 -1
  46. package/dist/utils/withTmpPath.js +31 -9
  47. package/libs/locale/localeExports.tpl +7 -3
  48. package/libs/qiankun/master/MicroApp.tsx +8 -2
  49. package/libs/qiankun/slave/lifecycles.ts +15 -7
  50. package/package.json +6 -6
  51. package/dist/access.d.ts.map +0 -1
  52. package/dist/analytics.d.ts.map +0 -1
  53. package/dist/antd.d.ts.map +0 -1
  54. package/dist/dva.d.ts.map +0 -1
  55. package/dist/icons.d.ts.map +0 -1
  56. package/dist/initial-state.d.ts.map +0 -1
  57. package/dist/layout.d.ts.map +0 -1
  58. package/dist/locale.d.ts.map +0 -1
  59. package/dist/model.d.ts.map +0 -1
  60. package/dist/moment2dayjs.d.ts.map +0 -1
  61. package/dist/qiankun/constants.d.ts.map +0 -1
  62. package/dist/qiankun/master.d.ts.map +0 -1
  63. package/dist/qiankun/slave.d.ts.map +0 -1
  64. package/dist/qiankun.d.ts.map +0 -1
  65. package/dist/request.d.ts.map +0 -1
  66. package/dist/tailwindcss.d.ts.map +0 -1
  67. package/dist/unocss.d.ts.map +0 -1
  68. package/dist/utils/astUtils.d.ts.map +0 -1
  69. package/dist/utils/localeUtils.d.ts.map +0 -1
  70. package/dist/utils/modelUtils.d.ts.map +0 -1
  71. package/dist/utils/resolveProjectDep.d.ts.map +0 -1
  72. package/dist/utils/withTmpPath.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import { getPluginManager } from '@@/core/plugin';
3
3
  import ReactDOM from 'react-dom';
4
- import { ApplyPluginsType } from 'umi';
4
+ import { ApplyPluginsType, __getRoot } from 'umi';
5
5
  import { setModelState } from './qiankunModel';
6
6
 
7
7
  const noop = () => {};
@@ -73,7 +73,7 @@ export function genMount(mountElementId: string) {
73
73
  await slaveRuntime.mount(props);
74
74
  }
75
75
 
76
- const { type, ...historyOpts } = props?.history;
76
+ const { type, ...historyOpts } = props?.history || {};
77
77
 
78
78
  // 更新 clientRender 配置
79
79
  const clientRenderOpts = {
@@ -149,12 +149,20 @@ export function genUpdate() {
149
149
 
150
150
  export function genUnmount(mountElementId: string) {
151
151
  return async (props: any) => {
152
- const container = props?.container
153
- ? props.container.querySelector(`#${mountElementId}`)
154
- : document.getElementById(mountElementId);
155
- if (container) {
156
- ReactDOM.unmountComponentAtNode(container);
152
+ const root = __getRoot();
153
+
154
+ // support react 18 unmount
155
+ if (typeof root?.unmount === 'function') {
156
+ root.unmount();
157
+ } else {
158
+ const container = props?.container
159
+ ? props.container.querySelector(`#${mountElementId}`)
160
+ : document.getElementById(mountElementId);
161
+ if (container) {
162
+ ReactDOM.unmountComponentAtNode(container);
163
+ }
157
164
  }
165
+
158
166
  const slaveRuntime = await getSlaveRuntime();
159
167
  if (slaveRuntime.unmount) await slaveRuntime.unmount(props);
160
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20220718.2",
3
+ "version": "4.0.0-canary.20220729.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",
@@ -16,16 +16,16 @@
16
16
  "libs"
17
17
  ],
18
18
  "scripts": {
19
- "build": "pnpm tsc",
19
+ "build": "umi-scripts father build",
20
20
  "build:deps": "umi-scripts bundleDeps",
21
- "dev": "pnpm build --watch",
21
+ "dev": "umi-scripts father dev",
22
22
  "test": "umi-scripts jest-turbo"
23
23
  },
24
24
  "dependencies": {
25
25
  "@ahooksjs/use-request": "^2.0.0",
26
26
  "@ant-design/icons": "^4.7.0",
27
- "@ant-design/pro-layout": "^7.0.1-beta.20",
28
- "@umijs/bundler-utils": "4.0.0-canary.20220718.2",
27
+ "@ant-design/pro-layout": "^7.0.1-beta.28",
28
+ "@umijs/bundler-utils": "4.0.0-canary.20220729.1",
29
29
  "antd-dayjs-webpack-plugin": "^1.0.6",
30
30
  "axios": "^0.27.2",
31
31
  "babel-plugin-import": "^1.13.5",
@@ -44,7 +44,7 @@
44
44
  "warning": "^4.0.3"
45
45
  },
46
46
  "devDependencies": {
47
- "umi": "4.0.0-canary.20220718.2"
47
+ "umi": "4.0.0-canary.20220729.1"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAGN,IAAI;AAAzB,wBA8IE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAEN,IAAI;AAAzB,wBAqEE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"antd.d.ts","sourceRoot":"","sources":["../src/antd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAKN,IAAI;AAAzB,wBA0JE"}
package/dist/dva.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"dva.d.ts","sourceRoot":"","sources":["../src/dva.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;8BAGlC,IAAI;AAAzB,wBA6JE;AAEF,wBAAgB,YAAY,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,cAmB5C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,IAAI,WAIrC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAEN,IAAI;AAAzB,wBAEE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"initial-state.d.ts","sourceRoot":"","sources":["../src/initial-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAGN,IAAI;AAAzB,wBA+HE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAIN,IAAI;AAAzB,wBAgoBE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAuB3B,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,WACb,CAAC;8BAGnB,IAAI;AAAzB,wBAkOE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAKN,IAAI;AAAzB,wBA+DE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"moment2dayjs.d.ts","sourceRoot":"","sources":["../src/moment2dayjs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAQN,IAAI;AAAzB,wBAgGE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/qiankun/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AACjD,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,kCAAkC,2BAA2B,CAAC;AAC3E,eAAO,MAAM,oCAAoC,6BAA6B,CAAC;AAC/E,eAAO,MAAM,iBAAiB,4BAA4B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"master.d.ts","sourceRoot":"","sources":["../../src/qiankun/master.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAU3B,wBAAgB,cAAc,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,GAAG,CAAA;CAAE,WAMvD;8BAEoB,IAAI;AAAzB,wBA8IE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"slave.d.ts","sourceRoot":"","sources":["../../src/qiankun/slave.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAgBN,IAAI;AAAzB,wBAmLE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qiankun.d.ts","sourceRoot":"","sources":["../src/qiankun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAEN,IAAI;AAAzB,wBAmBE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAGN,IAAI;AAAzB,wBAqUE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwindcss.d.ts","sourceRoot":"","sources":["../src/tailwindcss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAGN,IAAI;AAAzB,wBAsDE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"unocss.d.ts","sourceRoot":"","sources":["../src/unocss.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAGN,IAAI;AAAzB,wBA6CE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"astUtils.d.ts","sourceRoot":"","sources":["../../src/utils/astUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,0CAA0C,CAAC;AAClE,OAAO,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,MAAM,CAAA;KAAE;IAelD,YAAY,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IAsCpD,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE;CA4BxC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveProjectDep.d.ts","sourceRoot":"","sources":["../../src/utils/resolveProjectDep.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,sBAWA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"withTmpPath.d.ts","sourceRoot":"","sources":["../../src/utils/withTmpPath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,GAAG,EAAE,IAAI,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,UAUA"}