@umijs/plugins 4.0.12 → 4.0.13

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/request.js CHANGED
@@ -342,6 +342,7 @@ export {
342
342
  useRequest,
343
343
  UseRequestProvider,
344
344
  request,
345
+ getRequestInstance,
345
346
  } from './request';
346
347
  `
347
348
  });
@@ -18,13 +18,12 @@ import React, {
18
18
  useRef,
19
19
  useState,
20
20
  } from 'react';
21
+ import { qiankunStateForSlaveModelNamespace } from './constants';
21
22
  import { ErrorBoundary } from './ErrorBoundary';
22
23
  import { getMasterOptions } from './masterOptions';
23
24
  import MicroAppLoader from './MicroAppLoader';
24
25
  import { MasterOptions } from './types';
25
26
 
26
- const qiankunStateForSlaveModelNamespace = '@@qiankunStateForSlave';
27
-
28
27
  type HashHistory = {
29
28
  type?: 'hash';
30
29
  } & any;
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React, { ReactComponentElement } from 'react';
9
- import type { IRouteProps } from 'umi';
9
+ import { Navigate, type IRouteProps } from 'umi';
10
10
 
11
11
  export const defaultMountContainerId = 'root-subapp';
12
12
 
@@ -94,6 +94,12 @@ export function patchMicroAppRoute(
94
94
  routeProps,
95
95
  };
96
96
  route.element = React.createElement(getMicroAppRouteComponent(opts), null);
97
+ } else if (route.redirect) {
98
+ // patchClientRoutes 插入的 redirect 不会被转换,所以这里需要手动处理成重定向组件
99
+ route.element = React.createElement(Navigate, {
100
+ to: route.redirect,
101
+ replace: true,
102
+ });
97
103
  }
98
104
  }
99
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.12",
3
+ "version": "4.0.13",
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",
@@ -25,7 +25,7 @@
25
25
  "@ahooksjs/use-request": "^2.0.0",
26
26
  "@ant-design/icons": "^4.7.0",
27
27
  "@ant-design/pro-layout": "^7.0.1-beta.28",
28
- "@umijs/bundler-utils": "4.0.12",
28
+ "@umijs/bundler-utils": "4.0.13",
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.12"
47
+ "umi": "4.0.13"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"