File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed
packages/bridge/bridge-react/src/lazy Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,9 @@ import {
3
3
getDataFetchInfo ,
4
4
getDataFetchMap ,
5
5
getDataFetchMapKey ,
6
- isServerEnv ,
7
6
} from '../utils' ;
8
7
import helpers from '@module-federation/runtime/helpers' ;
9
8
import { DataFetchParams } from '../types' ;
10
- import { MF_DATA_FETCH_TYPE } from '../constant' ;
11
9
12
10
type PrefetchOptions = {
13
11
id : string ;
@@ -83,11 +81,8 @@ export async function prefetch(options: PrefetchOptions) {
83
81
return ;
84
82
}
85
83
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 ] ;
91
86
92
87
let _getDataFetchPromise = getDataFetchPromise ;
93
88
if ( ! getDataFetchPromise ) {
Original file line number Diff line number Diff line change 8
8
getDataFetchMapKey ,
9
9
isDataLoaderExpose ,
10
10
loadDataFetchModule ,
11
+ isServerEnv ,
11
12
} from '../utils' ;
12
13
import logger from '../logger' ;
13
14
import {
@@ -80,7 +81,7 @@ const autoFetchData: () => FederationRuntimePlugin = () => ({
80
81
: MF_DATA_FETCH_TYPE . FETCH_CLIENT ;
81
82
let finalDataFetchId = dataFetchId ;
82
83
83
- if ( typeof window !== 'undefined' ) {
84
+ if ( ! isServerEnv ( ) ) {
84
85
finalDataFetchId =
85
86
downgradeType === MF_DATA_FETCH_TYPE . FETCH_CLIENT
86
87
? hasDataFetchClient
Original file line number Diff line number Diff line change 1
- import {
2
- isBrowserEnv ,
3
- composeKeyWithSeparator ,
4
- SEPARATOR ,
5
- } from '@module-federation/sdk' ;
1
+ import { isBrowserEnv , composeKeyWithSeparator } from '@module-federation/sdk' ;
6
2
import logger from './logger' ;
7
3
import {
8
4
DOWNGRADE_KEY ,
You can’t perform that action at this time.
0 commit comments