@lemon-fe/vite-plugin-micro-frontend 2.0.0-beta.2 → 2.0.0-beta.3

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.
@@ -1,6 +1,5 @@
1
1
  import * as _module_federation_bridge_react from '@module-federation/bridge-react';
2
- import { ReactNode, ComponentType } from 'react';
3
- import { ResourceLoadRecovery } from './runtime-dynamic.js';
2
+ import { ComponentType } from 'react';
4
3
 
5
4
  interface MicroFrontendLocation {
6
5
  pathname: string;
@@ -8,20 +7,38 @@ interface MicroFrontendLocation {
8
7
  hash: string;
9
8
  state?: unknown;
10
9
  }
10
+ type RouterTo = string | {
11
+ pathname?: string;
12
+ search?: string;
13
+ hash?: string;
14
+ state?: unknown;
15
+ };
16
+ interface MicroFrontendRouterContext {
17
+ location: MicroFrontendLocation;
18
+ history: {
19
+ action?: string;
20
+ length?: number;
21
+ location: MicroFrontendLocation;
22
+ createHref: (to: RouterTo) => string;
23
+ push: (to: RouterTo, state?: unknown) => unknown;
24
+ replace: (to: RouterTo, state?: unknown) => unknown;
25
+ go: (n: number) => unknown;
26
+ goBack: () => unknown;
27
+ goForward: () => unknown;
28
+ listen: (listener: (location: MicroFrontendLocation, action?: string) => void) => () => void;
29
+ block?: (prompt: (location: MicroFrontendLocation, action?: string) => unknown) => () => void;
30
+ };
31
+ match?: unknown;
32
+ staticContext?: unknown;
33
+ }
11
34
  interface MicroFrontendProps {
12
35
  container?: HTMLElement;
13
36
  basename?: string;
14
37
  mountElementId?: string;
15
- /** 基座可选的路由通知。启用 Bridge Router 时由插件自动调用,业务无需透传。 */
16
- onNavigate?: (location: MicroFrontendLocation) => void;
17
- /** 资源加载失败时请求基座检查版本并局部重载当前应用。 */
18
- onResourceLoadError?: ResourceLoadRecovery;
38
+ /** 基座 Router 的 history/location;由 Bridge provider 在微应用 Root 内自动注入 Router。 */
39
+ routerContext?: MicroFrontendRouterContext;
19
40
  [key: string]: unknown;
20
41
  }
21
- /** @internal 为官方 Router 补充基座菜单/页签通知,不接管 history 或 basename。 */
22
- declare function withBridgeRouteSync<Props extends {
23
- children?: ReactNode;
24
- }>(Router: ComponentType<Props>, useLocation: () => MicroFrontendLocation): ComponentType<Props>;
25
42
  interface MicroFrontendLifeCycle {
26
43
  renderContainer: (props: MicroFrontendProps) => void | Promise<void>;
27
44
  bootstrap?: () => void | Promise<void>;
@@ -35,42 +52,14 @@ interface CreateMicroFrontendBridgeProviderOptions {
35
52
  }
36
53
  interface CreateMicroFrontendRootBridgeProviderOptions<Props extends MicroFrontendProps = MicroFrontendProps> {
37
54
  rootComponent: ComponentType<Props>;
55
+ /** 应用在 Bridge 容器内使用的稳定根节点 id。 */
56
+ mountElementId?: string;
38
57
  }
39
- /** 注册完整微应用生命周期;由插件生成的 export-app provider 消费。 */
40
- declare function registerMicroFrontend(lifeCycle: MicroFrontendLifeCycle): void;
41
- /**
42
- * 为现有入口创建官方 React Bridge provider。
43
- * 该函数由构建插件自动注入,业务代码通常不需要直接调用。
44
- */
45
- declare function createMicroFrontendBridgeProvider(options: CreateMicroFrontendBridgeProviderOptions): () => {
46
- render(info: _module_federation_bridge_react.RenderParams): Promise<void>;
47
- destroy(info: _module_federation_bridge_react.DestroyParams): void;
48
- };
49
58
  /** 为组件式应用创建官方 React 18 Bridge provider。 */
50
59
  declare function createMicroFrontendRootBridgeProvider<Props extends MicroFrontendProps = MicroFrontendProps>(options: CreateMicroFrontendRootBridgeProviderOptions<Props>): () => {
51
60
  render(info: _module_federation_bridge_react.RenderParams): Promise<void>;
52
61
  destroy(info: _module_federation_bridge_react.DestroyParams): void;
53
62
  };
54
- /** @deprecated 请改用 MicroFrontendProps。 */
55
- interface QiankunProps extends MicroFrontendProps {
56
- [key: string]: any;
57
- }
58
- /** @deprecated 请改用 MicroFrontendLifeCycle。 */
59
- interface QiankunLifeCycle {
60
- renderContainer: (props: QiankunProps) => void | Promise<void>;
61
- bootstrap?: () => void | Promise<void>;
62
- mount?: (props: QiankunProps) => void | Promise<void>;
63
- unmount?: (props: QiankunProps) => void | Promise<void>;
64
- update?: (props: QiankunProps) => void | Promise<void>;
65
- }
66
- /** @deprecated 请直接使用 Window。 */
67
- interface QiankunWindow extends Window {
68
- [key: string]: any;
69
- }
70
- /** @deprecated 请改用 registerMicroFrontend。名称仅为旧业务入口的源码兼容别名。 */
71
- declare function renderWithQiankun(lifeCycle: QiankunLifeCycle): void;
72
- /** @deprecated 请使用 globalThis/window。该别名不再表示 qiankun proxy window。 */
73
- declare const qiankunWindow: (Window & typeof globalThis) | QiankunWindow;
74
63
 
75
- export { createMicroFrontendBridgeProvider, createMicroFrontendRootBridgeProvider, qiankunWindow, registerMicroFrontend, renderWithQiankun, withBridgeRouteSync };
76
- export type { CreateMicroFrontendBridgeProviderOptions, CreateMicroFrontendRootBridgeProviderOptions, MicroFrontendLifeCycle, MicroFrontendLocation, MicroFrontendProps, QiankunLifeCycle, QiankunProps, QiankunWindow };
64
+ export { createMicroFrontendRootBridgeProvider };
65
+ export type { CreateMicroFrontendBridgeProviderOptions, CreateMicroFrontendRootBridgeProviderOptions, MicroFrontendLifeCycle, MicroFrontendLocation, MicroFrontendProps, MicroFrontendRouterContext };
@@ -1,185 +1,96 @@
1
- import { createContext, createElement, useContext, useRef, useEffect, useState } from 'react';
2
- import ReactDOM from 'react-dom';
1
+ import { createElement, useMemo } from 'react';
3
2
  import { createBridgeComponent } from '@module-federation/bridge-react/v18';
4
- import { ResourceLoadRecoveryContext } from './runtime-dynamic.js';
3
+ import { Router, BrowserRouter } from 'react-router-dom';
5
4
 
6
5
  /**
7
6
  * Module Federation React Bridge 运行时。
8
7
  * 这是浏览器入口,不得引入 Node.js API。
9
8
  */
10
- const BridgeNavigationContext = createContext(undefined);
11
- /** @internal 为官方 Router 补充基座菜单/页签通知,不接管 history 或 basename。 */
12
- function withBridgeRouteSync(Router, useLocation) {
13
- function RouteSync() {
14
- const onNavigate = useContext(BridgeNavigationContext);
15
- const location = useLocation();
16
- const lastLocation = useRef();
17
- useEffect(() => {
18
- if (!onNavigate)
19
- return;
20
- const previous = lastLocation.current;
21
- if (previous?.pathname === location.pathname &&
22
- previous.search === location.search &&
23
- previous.hash === location.hash &&
24
- Object.is(previous.state, location.state)) {
25
- return;
26
- }
27
- const next = {
28
- pathname: location.pathname,
29
- search: location.search,
30
- hash: location.hash,
31
- state: location.state,
32
- };
33
- lastLocation.current = next;
34
- onNavigate(next);
35
- }, [location.pathname, location.search, location.hash, location.state, onNavigate]);
36
- return null;
9
+ function stripRouterBasename(pathname, basename) {
10
+ if (!basename || basename === '/')
11
+ return pathname;
12
+ const normalizedBasename = `/${basename.replace(/^\/+|\/+$/g, '')}`;
13
+ if (pathname === normalizedBasename)
14
+ return '/';
15
+ if (pathname.startsWith(`${normalizedBasename}/`)) {
16
+ return pathname.slice(normalizedBasename.length) || '/';
37
17
  }
38
- return function BridgeRouter(props) {
39
- return createElement(Router, props, createElement(RouteSync), props.children);
40
- };
41
- }
42
- const registrations = [];
43
- function findMountElement(container, mountElementId) {
44
- return Array.from(container.querySelectorAll('[id]')).find(element => element.id === mountElementId);
18
+ return pathname;
45
19
  }
46
- function ensureBootstrap(registration) {
47
- if (!registration.bootstrapPromise) {
48
- registration.bootstrapPromise = Promise.resolve(registration.lifeCycle.bootstrap?.());
20
+ function scopeRouterBasename(pathname, basename) {
21
+ // 相对路径交给基座 history 按当前地址解析,提前补 basename 会把它变成绝对路径。
22
+ if (!basename || basename === '/' || (pathname !== '' && !pathname.startsWith('/'))) {
23
+ return pathname;
49
24
  }
50
- return registration.bootstrapPromise;
51
- }
52
- async function mountApplication(registration, props) {
53
- await ensureBootstrap(registration);
54
- if (registration.lifeCycle.mount) {
55
- await registration.lifeCycle.mount(props);
56
- return;
25
+ const normalizedBasename = `/${basename.replace(/^\/+|\/+$/g, '')}`;
26
+ if (pathname === normalizedBasename ||
27
+ pathname.startsWith(`${normalizedBasename}/`) ||
28
+ pathname.startsWith(`${normalizedBasename}?`) ||
29
+ pathname.startsWith(`${normalizedBasename}#`)) {
30
+ return pathname;
57
31
  }
58
- await registration.lifeCycle.renderContainer(props);
32
+ return `${normalizedBasename}${pathname || '/'}`;
59
33
  }
60
- async function unmountApplication(registration, props, mountElementId) {
61
- if (registration.lifeCycle.unmount) {
62
- await registration.lifeCycle.unmount(props);
63
- return;
64
- }
65
- const container = props.container;
66
- const mountElement = container ? findMountElement(container, mountElementId) : undefined;
67
- if (mountElement) {
68
- ReactDOM.unmountComponentAtNode(mountElement);
69
- }
70
- }
71
- /** 注册完整微应用生命周期;由插件生成的 export-app provider 消费。 */
72
- function registerMicroFrontend(lifeCycle) {
73
- const registration = {
74
- lifeCycle,
75
- claimed: false,
76
- standaloneMounted: false,
77
- };
78
- registrations.push(registration);
79
- if (typeof document === 'undefined')
80
- return;
81
- const mountStandalone = () => {
82
- queueMicrotask(() => {
83
- if (registration.claimed || registration.standaloneMounted)
84
- return;
85
- registration.standaloneMounted = true;
86
- void mountApplication(registration, { container: document.body }).catch(error => {
87
- registration.standaloneMounted = false;
88
- console.error('[micro-frontend] 独立运行挂载失败:', error);
89
- });
90
- });
34
+ function adaptRouterContext(context, basename) {
35
+ const { history, location } = context;
36
+ const unscope = (nextLocation) => ({
37
+ ...nextLocation,
38
+ pathname: stripRouterBasename(nextLocation.pathname, basename),
39
+ });
40
+ const toHostLocation = (to) => typeof to === 'string'
41
+ ? scopeRouterBasename(to, basename)
42
+ : typeof to.pathname === 'string'
43
+ ? { ...to, pathname: scopeRouterBasename(to.pathname, basename) }
44
+ : to;
45
+ const scopedLocation = unscope(location);
46
+ const scopedHistory = {
47
+ ...history,
48
+ get action() {
49
+ return history.action;
50
+ },
51
+ get length() {
52
+ return history.length;
53
+ },
54
+ get location() {
55
+ return unscope(history.location);
56
+ },
57
+ createHref: (to) => history.createHref(toHostLocation(to)),
58
+ push: (to, state) => history.push(toHostLocation(to), state),
59
+ replace: (to, state) => history.replace(toHostLocation(to), state),
60
+ listen: (listener) => history.listen((nextLocation, action) => listener(unscope(nextLocation), action)),
61
+ ...(history.block
62
+ ? {
63
+ block: (prompt) => history.block?.((nextLocation, action) => prompt(unscope(nextLocation), action)) ??
64
+ (() => { }),
65
+ }
66
+ : {}),
91
67
  };
92
- if (document.readyState === 'loading') {
93
- document.addEventListener('DOMContentLoaded', mountStandalone, {
94
- once: true,
95
- });
96
- }
97
- else {
98
- mountStandalone();
99
- }
68
+ return { ...context, location: scopedLocation, history: scopedHistory };
100
69
  }
101
- function claimLifeCycle(appName) {
102
- const registration = [...registrations]
103
- .reverse()
104
- .find(candidate => !candidate.claimed && !candidate.standaloneMounted);
105
- if (!registration) {
106
- throw new Error(`[micro-frontend] ${appName} 未注册应用生命周期。` +
107
- '请在 federation.application.entry 中调用 registerMicroFrontend()。');
70
+ function HostRouterProvider(props) {
71
+ const scopedContext = useMemo(() => props.routerContext ? adaptRouterContext(props.routerContext, props.basename) : undefined, [props.basename, props.routerContext]);
72
+ if (scopedContext) {
73
+ return createElement(Router, { history: scopedContext.history }, props.children);
108
74
  }
109
- registration.claimed = true;
110
- return registration;
111
- }
112
- /**
113
- * 为现有入口创建官方 React Bridge provider。
114
- * 该函数由构建插件自动注入,业务代码通常不需要直接调用。
115
- */
116
- function createMicroFrontendBridgeProvider(options) {
117
- const registration = claimLifeCycle(options.appName);
118
- const BridgeApplication = props => {
119
- const containerRef = useRef(null);
120
- const mountPromiseRef = useRef();
121
- const isInitialUpdateEffectRef = useRef(true);
122
- const [mountError, setMountError] = useState();
123
- const mountElementId = props.mountElementId || options.mountElementId;
124
- useEffect(() => {
125
- const container = containerRef.current;
126
- if (!container)
127
- return undefined;
128
- const lifeCycleProps = { ...props, container };
129
- const mountPromise = mountApplication(registration, lifeCycleProps);
130
- mountPromiseRef.current = mountPromise;
131
- mountPromise.catch(setMountError);
132
- return () => {
133
- void mountPromise
134
- .then(() => unmountApplication(registration, lifeCycleProps, mountElementId))
135
- .catch(error => {
136
- console.error('[micro-frontend] 应用卸载失败:', error);
137
- });
138
- };
139
- // Bridge provider 的 dom 生命周期决定挂载和卸载,入口节点 id 不应动态变化。
140
- // eslint-disable-next-line react-hooks/exhaustive-deps
141
- }, []);
142
- useEffect(() => {
143
- if (isInitialUpdateEffectRef.current) {
144
- isInitialUpdateEffectRef.current = false;
145
- return;
146
- }
147
- if (!registration.lifeCycle.update)
148
- return;
149
- void mountPromiseRef.current
150
- ?.then(() => registration.lifeCycle.update?.({
151
- ...props,
152
- container: containerRef.current || undefined,
153
- }))
154
- .catch(setMountError);
155
- }, [props]);
156
- if (mountError) {
157
- throw mountError;
158
- }
159
- return createElement('div', {
160
- ref: containerRef,
161
- 'data-mf-bridge-app': options.appName,
162
- style: { height: '100%', width: '100%' },
163
- }, createElement('div', { id: mountElementId }));
164
- };
165
- return createBridgeComponent({
166
- rootComponent: BridgeApplication,
167
- });
75
+ // SSR/tests have no browser history. The host path is only available when mounted by the base.
76
+ if (typeof window === 'undefined')
77
+ return props.children;
78
+ return createElement(BrowserRouter, undefined, props.children);
168
79
  }
169
80
  /** 为组件式应用创建官方 React 18 Bridge provider。 */
170
81
  function createMicroFrontendRootBridgeProvider(options) {
171
82
  const RootComponent = options.rootComponent;
172
- const BridgeRoot = props => createElement(BridgeNavigationContext.Provider, { value: props.onNavigate }, createElement(ResourceLoadRecoveryContext.Provider, { value: props.onResourceLoadError }, createElement(RootComponent, props)));
83
+ const BridgeRoot = props => {
84
+ const content = createElement(RootComponent, props);
85
+ const routedContent = createElement(HostRouterProvider, { basename: props.basename, routerContext: props.routerContext }, content);
86
+ return options.mountElementId
87
+ ? createElement('div', { id: options.mountElementId }, routedContent)
88
+ : routedContent;
89
+ };
173
90
  return createBridgeComponent({
174
91
  rootComponent: BridgeRoot,
175
92
  });
176
93
  }
177
- /** @deprecated 请改用 registerMicroFrontend。名称仅为旧业务入口的源码兼容别名。 */
178
- function renderWithQiankun(lifeCycle) {
179
- registerMicroFrontend(lifeCycle);
180
- }
181
- /** @deprecated 请使用 globalThis/window。该别名不再表示 qiankun proxy window。 */
182
- const qiankunWindow = typeof window === 'undefined' ? {} : window;
183
94
 
184
- export { createMicroFrontendBridgeProvider, createMicroFrontendRootBridgeProvider, qiankunWindow, registerMicroFrontend, renderWithQiankun, withBridgeRouteSync };
95
+ export { createMicroFrontendRootBridgeProvider };
185
96
  //# sourceMappingURL=runtime-bridge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-bridge.js","sources":["../src/runtime/bridge.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAiCH,MAAM,uBAAuB,GAAG,aAAa,CAAmC,SAAS,CAAC;AAE1F;AACM,SAAU,mBAAmB,CACjC,MAA4B,EAC5B,WAAwC,EAAA;AAExC,IAAA,SAAS,SAAS,GAAA;AAChB,QAAA,MAAM,UAAU,GAAG,UAAU,CAAC,uBAAuB,CAAC;AACtD,QAAA,MAAM,QAAQ,GAAG,WAAW,EAAE;AAC9B,QAAA,MAAM,YAAY,GAAG,MAAM,EAAyB;QAEpD,SAAS,CAAC,MAAK;AACb,YAAA,IAAI,CAAC,UAAU;gBAAE;AACjB,YAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO;AACrC,YAAA,IACE,QAAQ,EAAE,QAAQ,KAAK,QAAQ,CAAC,QAAQ;AACxC,gBAAA,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;AACnC,gBAAA,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;AAC/B,gBAAA,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EACzC;gBACA;YACF;AACA,YAAA,MAAM,IAAI,GAAG;gBACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;aACtB;AACD,YAAA,YAAY,CAAC,OAAO,GAAG,IAAI;Y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KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,SAAS,EAC3F,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,CACtC;IAED,IAAI,aAAa,EAAE;AACjB,QAAA,OAAO,aAAa,CAClB,MAGE,EACF,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,EAClC,KAAK,CAAC,QAAQ,CACf;IACH;;IAGA,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC,QAAQ;IACxD,OAAO,aAAa,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;AAChE;AAuBA;AACM,SAAU,qCAAqC,CAEnD,OAA4D,EAAA;AAC5D,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa;AAC3C,IAAA,MAAM,UAAU,GAAyB,KAAK,IAAG;QAC/C,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,EAAE,KAAK,CAAC;QAEnD,MAAM,aAAa,GAAG,aAAa,CACjC,kBAAkB,EAClB,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,EAChE,OAAO,CACR;QACD,OAAO,OAAO,CAAC;AACb,cAAE,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,cAAc,EAAE,EAAE,aAAa;cAClE,aAAa;AACnB,IAAA,CAAC;AAED,IAAA,OAAO,qBAAqB,CAAQ;AAClC,QAAA,aAAa,EAAE,UAAU;AAC1B,KAAA,CAAC;AACJ;;;;"}
@@ -1,11 +1,5 @@
1
- import * as react from 'react';
2
1
  import { ComponentType } from 'react';
3
2
 
4
- type ResourceLoadRecovery = (error: Error, options?: {
5
- manual?: boolean;
6
- }) => Promise<boolean>;
7
- /** 由 Bridge provider 按应用注入,不通过 window 共享多个微应用的恢复状态。 */
8
- declare const ResourceLoadRecoveryContext: react.Context<ResourceLoadRecovery | undefined>;
9
3
  interface DynamicOptions<P = Record<string, unknown>> {
10
4
  /** 动态加载函数,返回一个包含 default 导出的 Promise */
11
5
  loader: () => Promise<{
@@ -25,5 +19,5 @@ declare function isChunkLoadError(error: Error): boolean;
25
19
  */
26
20
  declare function dynamic<P = Record<string, unknown>>(options: DynamicOptions<P>): ComponentType<P>;
27
21
 
28
- export { ResourceLoadRecoveryContext, dynamic, isChunkLoadError };
29
- export type { DynamicOptions, ResourceLoadRecovery };
22
+ export { dynamic, isChunkLoadError };
23
+ export type { DynamicOptions };
@@ -1,7 +1,5 @@
1
- import { createContext, Component, createElement, lazy, Suspense } from 'react';
1
+ import { lazy, createElement, Suspense, Component } from 'react';
2
2
 
3
- /** 由 Bridge provider 按应用注入,不通过 window 共享多个微应用的恢复状态。 */
4
- const ResourceLoadRecoveryContext = createContext(undefined);
5
3
  /**
6
4
  * 检测是否是 chunk 加载失败错误
7
5
  * 只有这类错误才会被 ErrorBoundary 捕获并显示 Loading
@@ -18,49 +16,19 @@ function isChunkLoadError(error) {
18
16
  class DynamicErrorBoundary extends Component {
19
17
  constructor(props) {
20
18
  super(props);
21
- this.disposed = false;
22
- this.state = { hasError: false, error: null, recovering: false, recoveryAttempted: false };
19
+ this.state = { hasError: false, error: null };
23
20
  }
24
21
  static getDerivedStateFromError(error) {
25
22
  // 先捕获所有错误,在 render 中根据错误类型决定处理方式
26
23
  return { hasError: true, error };
27
24
  }
28
- componentDidMount() {
29
- this.disposed = false;
30
- }
31
- componentWillUnmount() {
32
- this.disposed = true;
33
- }
34
- componentDidCatch(error) {
35
- if (isChunkLoadError(error) && this.context)
36
- this.recover(error);
37
- }
38
- recover(error, manual = false) {
39
- const handler = this.context;
40
- if (!handler || this.state.recovering)
41
- return;
42
- this.setState({ recovering: true, recoveryAttempted: true });
43
- void Promise.resolve()
44
- .then(() => handler(error, { manual }))
45
- .catch(() => false)
46
- .then(reloading => {
47
- if (!this.disposed && !reloading)
48
- this.setState({ recovering: false });
49
- });
50
- }
51
25
  render() {
52
26
  if (this.state.hasError && this.state.error) {
53
27
  // 只有 chunk 加载错误才显示 Loading 组件
54
- if (isChunkLoadError(this.state.error)) {
55
- const recovering = this.state.recovering || (this.context && !this.state.recoveryAttempted);
56
- if (this.props.LoadingComponent) {
57
- return createElement(this.props.LoadingComponent, {
58
- error: recovering ? undefined : this.state.error,
59
- retry: this.context ? () => this.recover(this.state.error, true) : undefined,
60
- });
61
- }
62
- if (recovering)
63
- return null;
28
+ if (isChunkLoadError(this.state.error) && this.props.LoadingComponent) {
29
+ return createElement(this.props.LoadingComponent, {
30
+ error: this.state.error,
31
+ });
64
32
  }
65
33
  // 业务逻辑错误:重新抛出,让上层处理
66
34
  throw this.state.error;
@@ -68,7 +36,6 @@ class DynamicErrorBoundary extends Component {
68
36
  return this.props.children;
69
37
  }
70
38
  }
71
- DynamicErrorBoundary.contextType = ResourceLoadRecoveryContext;
72
39
  /**
73
40
  * 封装动态导入函数,兼容 Umi 的 dynamic
74
41
  */
@@ -82,5 +49,5 @@ function dynamic(options) {
82
49
  };
83
50
  }
84
51
 
85
- export { ResourceLoadRecoveryContext, dynamic, isChunkLoadError };
52
+ export { dynamic, isChunkLoadError };
86
53
  //# sourceMappingURL=runtime-dynamic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-dynamic.js","sources":["../src/runtime/dynamic.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAgBA;MACa,2BAA2B,GAAG,aAAa,CACtD,SAAS;AA0BX;;;;AAIG;AACG,SAAU,gBAAgB,CAAC,KAAY,EAAA;AAC3C,IAAA,QACE,KAAK,CAAC,IAAI,KAAK,gBAAgB;QAC/B,oLAAoL,CAAC,IAAI,CACvL,KAAK,CAAC,OAAO,CACd;AAEL;AAEA;;;AAGG;AACH,MAAM,oBAAqB,SAAQ,SAAiD,CAAA;AAKlF,IAAA,WAAA,CAAY,KAAyB,EAAA;QACnC,KAAK,CAAC,KAAK,CAAC;QAHN,IAAA,CAAA,QAAQ,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