Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an option to disable HTTP streaming #3777

Merged
merged 18 commits into from
Jul 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into fix/cloudflare-polyfill
  • Loading branch information
Tony Sullivan committed Jun 30, 2022
commit 93ff1b7993ae483e95aabf2c03b779d6152971d6
11 changes: 4 additions & 7 deletions packages/astro/src/core/render/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,10 @@ export async function render(opts: RenderOptions): Promise<Response> {
streaming,
});

if (!Component.isAstroComponentFactory) {
const props: Record<string, any> = { ...(pageProps ?? {}), 'server:root': true };
const html = await renderComponent(result, Component.name, Component, props, null);
return new Response(html.toString(), result.response);
} else {
return await renderPage(result, Component, pageProps, null, streaming);
// Support `export const components` for `MDX` pages
if (typeof (mod as any).components === 'object') {
Object.assign(pageProps, { components: (mod as any).components });
}

return await renderPage(result, Component, pageProps, null);
return await renderPage(result, Component, pageProps, null, streaming);
}
You are viewing a condensed version of this merge commit. You can view the full changes here.