@umijs/plugins 4.0.0-canary.20230531.1 → 4.0.0-canary.20230601.2

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/antd.js CHANGED
@@ -185,10 +185,11 @@ var antd_default = (api) => {
185
185
  ] : [];
186
186
  });
187
187
  api.onGenerateFiles(() => {
188
+ var _a;
188
189
  const withConfigProvider = !!api.config.antd.configProvider;
189
190
  const withAppConfig = appConfigAvailable && !!api.config.antd.appConfig;
190
191
  const styleProvider = api.config.antd.styleProvider;
191
- const ieTarget = !!api.config.targets.ie || !!api.config.legacy;
192
+ const ieTarget = !!((_a = api.config.targets) == null ? void 0 : _a.ie) || !!api.config.legacy;
192
193
  let styleProviderConfig = false;
193
194
  if (isV5 && (ieTarget || styleProvider)) {
194
195
  const cssinjs = (0, import_resolveProjectDep.resolveProjectDep)({
package/dist/dva.js CHANGED
@@ -42,7 +42,7 @@ var import_plugin_utils = require("umi/plugin-utils");
42
42
  var import_modelUtils = require("./utils/modelUtils");
43
43
  var import_withTmpPath = require("./utils/withTmpPath");
44
44
  var dva_default = (api) => {
45
- const pkgPath = (0, import_path.join)(__dirname, "../libs/dva.ts");
45
+ const pkgPath = (0, import_path.join)(__dirname, "../libs/dva.tsx");
46
46
  api.describe({
47
47
  config: {
48
48
  schema({ zod }) {
package/libs/dva.tsx ADDED
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import { create, saga, utils } from 'dva-core';
4
+ import {
5
+ connect,
6
+ Provider,
7
+ useDispatch,
8
+ useSelector,
9
+ useStore,
10
+ } from 'react-redux';
11
+ export { bindActionCreators } from 'redux';
12
+ export { create, saga, utils };
13
+ export { connect, Provider, useDispatch, useSelector, useStore };
14
+
15
+ export default function dva(opts: any) {
16
+ const app = create(opts, {
17
+ initialReducer: {},
18
+ setupApp() {},
19
+ });
20
+ const oldAppStart = app.start;
21
+ app.router = router;
22
+ app.start = start;
23
+ return app;
24
+
25
+ function router(router: any) {
26
+ app._router = router;
27
+ }
28
+
29
+ function start(elem: any) {
30
+ // old dva.start() supports passing arguments
31
+ if (typeof elem !== 'undefined') {
32
+ throw new Error('dva.start() should not be called with any arguments.');
33
+ }
34
+ if (!app._store) {
35
+ oldAppStart.call(app);
36
+ }
37
+ const store = app._store;
38
+ const router = app._router;
39
+ return (extraProps: any) => {
40
+ return (
41
+ <Provider store={store}>{router({ app, ...extraProps })}</Provider>
42
+ );
43
+ };
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20230531.1",
3
+ "version": "4.0.0-canary.20230601.2",
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",
@@ -44,12 +44,12 @@
44
44
  "styled-components": "6.0.0-rc.0",
45
45
  "tslib": "^2",
46
46
  "warning": "^4.0.3",
47
- "@umijs/bundler-utils": "4.0.0-canary.20230531.1",
47
+ "@umijs/bundler-utils": "4.0.0-canary.20230601.2",
48
48
  "@umijs/valtio": "1.0.3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "antd": "^4.24.1",
52
- "umi": "4.0.0-canary.20230531.1"
52
+ "umi": "4.0.0-canary.20230601.2"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"
package/libs/dva.ts DELETED
@@ -1,10 +0,0 @@
1
- // @ts-ignore
2
- export { create, saga, utils } from 'dva-core';
3
- export {
4
- connect,
5
- Provider,
6
- useDispatch,
7
- useSelector,
8
- useStore,
9
- } from 'react-redux';
10
- export { bindActionCreators } from 'redux';