Skip to content

Commit

Permalink
fix(#7333): pass compressHTML to manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Jun 27, 2023
1 parent 1a9b644 commit 6885e60
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-spoons-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Pass `compressHTML` setting to server adapters
4 changes: 3 additions & 1 deletion packages/astro/src/core/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export class App {
const url = new URL(request.url);
const pathname = prependForwardSlash(this.removeBase(url.pathname));
const info = this.#routeDataToRouteInfo.get(routeData!)!;
const isCompressHTML = this.#manifest.compressHTML ?? false;
// may be used in the future for handling rel=modulepreload, rel=icon, rel=manifest etc.
const links = new Set<never>();
const styles = createStylesheetElementSet(info.styles);
Expand Down Expand Up @@ -252,7 +253,7 @@ export class App {
page.onRequest as MiddlewareResponseHandler,
apiContext,
() => {
return renderPage({ mod, renderContext, env: this.#env, cookies: apiContext.cookies });
return renderPage({ mod, renderContext, env: this.#env, cookies: apiContext.cookies, isCompressHTML });
}
);
} else {
Expand All @@ -261,6 +262,7 @@ export class App {
renderContext,
env: this.#env,
cookies: apiContext.cookies,
isCompressHTML
});
}
Reflect.set(request, responseSentSymbol, true);
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/core/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type SSRManifest = {
routes: RouteInfo[];
site?: string;
base?: string;
compressHTML?: boolean;
assetsPrefix?: string;
markdown: MarkdownRenderingOptions;
renderers: SSRLoadedRenderer[];
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/core/build/plugins/plugin-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ function buildManifest(
routes,
site: settings.config.site,
base: settings.config.base,
compressHTML: settings.config.compressHTML,
assetsPrefix: settings.config.build.assetsPrefix,
markdown: settings.config.markdown,
componentMetadata: Array.from(internals.componentMetadata),
Expand Down

0 comments on commit 6885e60

Please sign in to comment.