diff --git a/.changeset/rich-seals-switch.md b/.changeset/rich-seals-switch.md new file mode 100644 index 0000000000..15df09b605 --- /dev/null +++ b/.changeset/rich-seals-switch.md @@ -0,0 +1,5 @@ +--- +'@shopify/hydrogen': patch +--- + +Enable streaming by default for all platforms diff --git a/packages/hydrogen/src/entry-server.tsx b/packages/hydrogen/src/entry-server.tsx index adfdf69301..9ac4aae2c4 100644 --- a/packages/hydrogen/src/entry-server.tsx +++ b/packages/hydrogen/src/entry-server.tsx @@ -37,7 +37,6 @@ import { ssrRenderToReadableStream, rscRenderToReadableStream, createFromReadableStream, - isStreamingSupported, bufferReadableStream, } from './streaming.server'; import {RSC_PATHNAME, EVENT_PATHNAME, EVENT_PATHNAME_REGEX} from './constants'; @@ -177,9 +176,7 @@ export const renderHydrogen = (App: any) => { const isStreamable = (hydrogenConfig.enableStreaming ? hydrogenConfig.enableStreaming(request) - : true) && - !isBotUA(url, request.headers.get('user-agent')) && - (!!nodeResponse || (await isStreamingSupported())); + : true) && !isBotUA(url, request.headers.get('user-agent')); if (!isStreamable) response.doNotStream(); diff --git a/packages/hydrogen/src/streaming.server.ts b/packages/hydrogen/src/streaming.server.ts index 84e905dbd2..d776a3fbe2 100644 --- a/packages/hydrogen/src/streaming.server.ts +++ b/packages/hydrogen/src/streaming.server.ts @@ -44,10 +44,6 @@ export const ssrRenderToReadableStream = _ssrRenderToReadableStream as ( options: StreamOptions ) => Promise & {allReady: Promise}>; -export async function isStreamingSupported() { - return Boolean(globalThis.Oxygen?.env?.HYDROGEN_ENABLE_WORKER_STREAMING); -} - export async function bufferReadableStream( reader: ReadableStreamDefaultReader, cb?: (chunk: string) => void