GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Flush direct streams in Bun (#28837) · react/react@c113503

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-server/src
    • ReactServerStreamConfigBun.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-server/src/ReactServerStreamConfigBun.js‎

Copy file name to clipboardExpand all lines: packages/react-server/src/ReactServerStreamConfigBun.js
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type BunReadableStreamController = ReadableStreamController & {
1313
end(): mixed,
1414
write(data: Chunk | BinaryChunk): void,
1515
error(error: Error): void,
16+
flush?: () => void,
1617
};
1718
export type Destination = BunReadableStreamController;
1819

@@ -25,8 +26,12 @@ export function scheduleWork(callback: () => void) {
2526
}
2627

2728
export function flushBuffered(destination: Destination) {
28-
// WHATWG Streams do not yet have a way to flush the underlying
29-
// transform streams. https://github.com/whatwg/streams/issues/960
29+
// Bun direct streams provide a flush function.
30+
// If we don't have any more data to send right now.
31+
// Flush whatever is in the buffer to the wire.
32+
if (typeof destination.flush === 'function') {
33+
destination.flush();
34+
}
3035
}
3136

3237
export function beginWriting(destination: Destination) {}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.