ReactServerStreamConfigBrowser.js — react Source File
Architecture documentation for ReactServerStreamConfigBrowser.js, a javascript file in the react codebase.
Entity Profile
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export type Destination = ReadableStreamController;
export type PrecomputedChunk = Uint8Array;
export opaque type Chunk = Uint8Array;
export type BinaryChunk = Uint8Array;
const channel = new MessageChannel();
const taskQueue = [];
channel.port1.onmessage = () => {
const task = taskQueue.shift();
if (task) {
task();
}
};
export function scheduleWork(callback: () => void) {
taskQueue.push(callback);
channel.port2.postMessage(null);
}
function handleErrorInNextTick(error: any) {
setTimeout(() => {
throw error;
});
}
const LocalPromise = Promise;
export const scheduleMicrotask: (callback: () => void) => void =
typeof queueMicrotask === 'function'
? queueMicrotask
: callback => {
LocalPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
};
export function flushBuffered(destination: Destination) {
// WHATWG Streams do not yet have a way to flush the underlying
// transform streams. https://github.com/whatwg/streams/issues/960
}
const VIEW_SIZE = 2048;
let currentView = null;
let writtenBytes = 0;
export function beginWriting(destination: Destination) {
currentView = new Uint8Array(VIEW_SIZE);
writtenBytes = 0;
}
export function writeChunk(
destination: Destination,
// ... (145 more lines)
Source
Frequently Asked Questions
What does ReactServerStreamConfigBrowser.js do?
ReactServerStreamConfigBrowser.js is a source file in the react codebase, written in javascript.
Where is ReactServerStreamConfigBrowser.js in the architecture?
ReactServerStreamConfigBrowser.js is located at packages/react-server/src/ReactServerStreamConfigBrowser.js (directory: packages/react-server/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free