File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
react-server-dom-webpack/src/__tests__ Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ global.ReadableStream =
15
15
global . TextEncoder = require ( 'util' ) . TextEncoder ;
16
16
global . TextDecoder = require ( 'util' ) . TextDecoder ;
17
17
18
+ // Don't wait before processing work on the server.
19
+ // TODO: we can replace this with FlightServer.act().
20
+ global . setTimeout = cb => cb ( ) ;
21
+
18
22
let clientExports ;
19
23
let webpackMap ;
20
24
let webpackModules ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export type PrecomputedChunk = Uint8Array;
13
13
export opaque type Chunk = Uint8Array ;
14
14
15
15
export function scheduleWork ( callback : ( ) = > void ) {
16
- callback ( ) ;
16
+ setTimeout ( callback , 0 ) ;
17
17
}
18
18
19
19
export function flushBuffered ( destination : Destination ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ global.Response = require('node-fetch').Response;
20
20
// Patch for Edge environments for global scope
21
21
global . AsyncLocalStorage = require ( 'async_hooks' ) . AsyncLocalStorage ;
22
22
23
+ // Don't wait before processing work on the server.
24
+ // TODO: we can replace this with FlightServer.act().
25
+ global . setTimeout = cb => cb ( ) ;
26
+
23
27
let fetchCount = 0 ;
24
28
async function fetchMock ( resource , options ) {
25
29
fetchCount ++ ;
You can’t perform that action at this time.
0 commit comments