Skip to content

Commit

Permalink
Import executionAsyncId too
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Dec 16, 2023
1 parent 2ba9670 commit 273e0ba
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {createAsyncHook} from './ReactFlightServerConfig';
import {createAsyncHook, executionAsyncId} from './ReactFlightServerConfig';
import {enableAsyncDebugInfo} from 'shared/ReactFeatureFlags';

// Initialize the tracing of async operations.
Expand All @@ -23,6 +23,7 @@ export function initAsyncDebugInfo(): void {
},
promiseResolve(asyncId: number): void {
// TODO
executionAsyncId();
},
destroy(asyncId: number): void {
// TODO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ export const createAsyncHook: HookCallbacks => AsyncHook =
disable() {},
}: any);
};
export const executionAsyncId: () => number =
typeof async_hooks === 'object' ? async_hooks.executionAsyncId : (null: any);
export * from '../ReactFlightServerConfigDebugNode';
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ export const createAsyncHook: HookCallbacks => AsyncHook =
disable() {},
}: any);
};
export const executionAsyncId: () => number =
typeof async_hooks === 'object' ? async_hooks.executionAsyncId : (null: any);
export * from '../ReactFlightServerConfigDebugNode';
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export const supportsRequestStorage = true;
export const requestStorage: AsyncLocalStorage<Request> =
new AsyncLocalStorage();

export {createHook as createAsyncHook} from 'async_hooks';
export {createHook as createAsyncHook, executionAsyncId} from 'async_hooks';
export * from '../ReactFlightServerConfigDebugNode';
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const supportsRequestStorage = true;
export const requestStorage: AsyncLocalStorage<Request> =
new AsyncLocalStorage();

export {createHook as createAsyncHook} from 'async_hooks';
export {createHook as createAsyncHook, executionAsyncId} from 'async_hooks';
export * from '../ReactFlightServerConfigDebugNode';
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const supportsRequestStorage = true;
export const requestStorage: AsyncLocalStorage<Request> =
new AsyncLocalStorage();

export {createHook as createAsyncHook} from 'async_hooks';
export {createHook as createAsyncHook, executionAsyncId} from 'async_hooks';
export * from '../ReactFlightServerConfigDebugNode';

0 comments on commit 273e0ba

Please sign in to comment.