Skip to content

Commit

Permalink
Disable AsyncLocalStorage check in browser builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Feb 6, 2023
1 parent d18a93b commit 0f29a5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/react-server/src/ReactServerStreamConfigBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ export function flushBuffered(destination: Destination) {
// transform streams. https://github.com/whatwg/streams/issues/960
}

// For now we support AsyncLocalStorage as a global for the "browser" builds
// TODO: Move this to some special WinterCG build.
export const supportsRequestStorage = typeof AsyncLocalStorage === 'function';
export const supportsRequestStorage = false;
export const requestStorage: AsyncLocalStorage<Map<Function, mixed>> =
supportsRequestStorage ? new AsyncLocalStorage() : (null: any);
(null: any);

const VIEW_SIZE = 512;
let currentView = null;
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/__tests__/ReactFetch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ global.TextDecoder = require('util').TextDecoder;
global.Headers = require('node-fetch').Headers;
global.Request = require('node-fetch').Request;
global.Response = require('node-fetch').Response;
// Patch for Browser environments to be able to polyfill AsyncLocalStorage
global.AsyncLocalStorage = require('async_hooks').AsyncLocalStorage;

let fetchCount = 0;
async function fetchMock(resource, options) {
Expand Down

0 comments on commit 0f29a5b

Please sign in to comment.