Skip to content

Commit 1c6cfcf

Browse files
committed
fix: no intercept
1 parent 7f7ec0c commit 1c6cfcf

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

packages/bridge/bridge-react/src/lazy/data-fetch/prefetch.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import {
33
getDataFetchInfo,
44
getDataFetchMap,
55
getDataFetchMapKey,
6-
isServerEnv,
76
} from '../utils';
87
import helpers from '@module-federation/runtime/helpers';
98
import { DataFetchParams } from '../types';
10-
import { MF_DATA_FETCH_TYPE } from '../constant';
119

1210
type PrefetchOptions = {
1311
id: string;
@@ -83,11 +81,8 @@ export async function prefetch(options: PrefetchOptions) {
8381
return;
8482
}
8583

86-
const [getDataFetchGetter, type, getDataFetchPromise] = dataFetchItem[0];
87-
88-
if (type === MF_DATA_FETCH_TYPE.FETCH_CLIENT && !isServerEnv()) {
89-
return;
90-
}
84+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
85+
const [getDataFetchGetter, _type, getDataFetchPromise] = dataFetchItem[0];
9186

9287
let _getDataFetchPromise = getDataFetchPromise;
9388
if (!getDataFetchPromise) {

packages/bridge/bridge-react/src/lazy/data-fetch/runtime-plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
getDataFetchMapKey,
99
isDataLoaderExpose,
1010
loadDataFetchModule,
11+
isServerEnv,
1112
} from '../utils';
1213
import logger from '../logger';
1314
import {
@@ -80,7 +81,7 @@ const autoFetchData: () => FederationRuntimePlugin = () => ({
8081
: MF_DATA_FETCH_TYPE.FETCH_CLIENT;
8182
let finalDataFetchId = dataFetchId;
8283

83-
if (typeof window !== 'undefined') {
84+
if (!isServerEnv()) {
8485
finalDataFetchId =
8586
downgradeType === MF_DATA_FETCH_TYPE.FETCH_CLIENT
8687
? hasDataFetchClient

packages/bridge/bridge-react/src/lazy/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
isBrowserEnv,
3-
composeKeyWithSeparator,
4-
SEPARATOR,
5-
} from '@module-federation/sdk';
1+
import { isBrowserEnv, composeKeyWithSeparator } from '@module-federation/sdk';
62
import logger from './logger';
73
import {
84
DOWNGRADE_KEY,

0 commit comments

Comments
 (0)