From c90b155c6f3137acda8d94e574ad632ff60e012a Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 4 Jun 2026 02:28:46 +0200 Subject: [PATCH 1/4] feat: make jsx whitespace handling the default --- .changeset/compress-html-jsx-default.md | 9 ++++ packages/astro/src/core/build/generate.ts | 2 +- .../astro/src/core/config/schemas/base.ts | 2 +- packages/astro/src/types/public/config.ts | 12 ++--- .../astro.config.mjs | 5 ++ .../minification-html-default/package.json | 8 +++ .../src/pages/index.astro | 23 ++++++++ packages/astro/test/minification-html.test.ts | 53 +++++++++++++++++++ .../test/units/manifest/serialized.test.ts | 4 +- packages/astro/test/units/test-utils.ts | 2 +- pnpm-lock.yaml | 6 +++ 11 files changed, 115 insertions(+), 11 deletions(-) create mode 100644 .changeset/compress-html-jsx-default.md create mode 100644 packages/astro/test/fixtures/minification-html-default/astro.config.mjs create mode 100644 packages/astro/test/fixtures/minification-html-default/package.json create mode 100644 packages/astro/test/fixtures/minification-html-default/src/pages/index.astro diff --git a/.changeset/compress-html-jsx-default.md b/.changeset/compress-html-jsx-default.md new file mode 100644 index 000000000000..f468d340badc --- /dev/null +++ b/.changeset/compress-html-jsx-default.md @@ -0,0 +1,9 @@ +--- +'astro': major +--- + +Makes `'jsx'` the default value for `compressHTML` + +Astro now strips whitespace from your HTML using JSX rules by default, the same way frameworks like React do. Whitespace and line breaks between elements are removed unless you explicitly write them in your source, for example with `{" "}`. + +This can change rendered output where whitespace between inline elements was previously meaningful. To keep Astro's earlier behavior, set `compressHTML: true` for HTML-aware compression, or `compressHTML: false` to preserve all whitespace. diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 28c946082b3b..073d84462680 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -470,7 +470,7 @@ export async function renderPath({ relativeLocation: locationSite, from: fromPath, }); - if (config.compressHTML === true) { + if (config.compressHTML) { body = body.replaceAll('\n', ''); } if (route.type !== 'redirect') { diff --git a/packages/astro/src/core/config/schemas/base.ts b/packages/astro/src/core/config/schemas/base.ts index 2b47a419d85b..d931cb6cda9b 100644 --- a/packages/astro/src/core/config/schemas/base.ts +++ b/packages/astro/src/core/config/schemas/base.ts @@ -85,7 +85,7 @@ export const ASTRO_CONFIG_DEFAULTS = { devToolbar: { enabled: true, }, - compressHTML: true, + compressHTML: 'jsx', server: { host: false, port: 4321, diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts index 46eeaec198a6..72a7bfb3df42 100644 --- a/packages/astro/src/types/public/config.ts +++ b/packages/astro/src/types/public/config.ts @@ -474,22 +474,22 @@ export interface AstroUserConfig< * @docs * @name compressHTML * @type {boolean | "jsx"} - * @default `true` + * @default `'jsx'` * @description * * Controls how Astro handles whitespace in your HTML. This affects both development mode and the final build output. * - * By default, Astro removes whitespace from your HTML, including line breaks, in a lossless manner from `.astro` components. Some whitespace may be preserved as needed to maintain the visual rendering of your HTML. + * By default (`'jsx'`), Astro applies the JSX whitespace stripping rules used by frameworks like React. Leading and trailing whitespace is only preserved when explicitly included in the source code through constructs such as `{" "}`, and is otherwise removed entirely. * - * Since 6.2.0, this option can also be set to `"jsx"`, Astro will apply the JSX whitespace stripping rules used by frameworks like React. Leading and trailing whitespace is only preserved when explicitly included in the source code through constructs such as `{" "}`, and is otherwise removed entirely. + * Setting this option to `true` instead removes whitespace, including line breaks, in a lossless manner from `.astro` components. Some whitespace may be preserved as needed to maintain the visual rendering of your HTML. * - * Setting this option to false disables HTML compression and preserves all whitespace. + * Setting this option to `false` disables HTML compression and preserves all whitespace. * * ```js * { - * compressHTML: false + * compressHTML: true * // or: - * // compressHTML: 'jsx' + * // compressHTML: false * } * ``` */ diff --git a/packages/astro/test/fixtures/minification-html-default/astro.config.mjs b/packages/astro/test/fixtures/minification-html-default/astro.config.mjs new file mode 100644 index 000000000000..0e82d35d4efe --- /dev/null +++ b/packages/astro/test/fixtures/minification-html-default/astro.config.mjs @@ -0,0 +1,5 @@ +import { defineConfig } from 'astro/config'; + +// https://astro.build/config +// Intentionally does not set `compressHTML` so the default value is exercised. +export default defineConfig({}); diff --git a/packages/astro/test/fixtures/minification-html-default/package.json b/packages/astro/test/fixtures/minification-html-default/package.json new file mode 100644 index 000000000000..f5581f16315b --- /dev/null +++ b/packages/astro/test/fixtures/minification-html-default/package.json @@ -0,0 +1,8 @@ +{ + "name": "@test/minification-html-default", + "version": "0.0.0", + "private": true, + "dependencies": { + "astro": "workspace:*" + } +} diff --git a/packages/astro/test/fixtures/minification-html-default/src/pages/index.astro b/packages/astro/test/fixtures/minification-html-default/src/pages/index.astro new file mode 100644 index 000000000000..b6d18b67d495 --- /dev/null +++ b/packages/astro/test/fixtures/minification-html-default/src/pages/index.astro @@ -0,0 +1,23 @@ +--- +--- + + + + default minification + + +

+ Hello + world +

+
+ hello + world +
+
+  keep
+    this
+      whitespace
+    
+ + diff --git a/packages/astro/test/minification-html.test.ts b/packages/astro/test/minification-html.test.ts index c6bc8b18c90f..65cc1933a3e2 100644 --- a/packages/astro/test/minification-html.test.ts +++ b/packages/astro/test/minification-html.test.ts @@ -122,3 +122,56 @@ describe('HTML minification (JSX mode)', () => { }); }); }); + +describe('HTML minification (default)', () => { + let html: string; + before(async () => { + // This fixture intentionally leaves `compressHTML` unset to exercise the default. + const fixture = await loadFixture({ + root: './fixtures/minification-html-default/', + build: { inlineStylesheets: 'never' }, + outDir: './dist/minification-html-default/', + }); + await fixture.build(); + html = await fixture.readFile('/index.html'); + }); + + it('strips whitespace between inline elements, following JSX rules', () => { + // The discriminator: HTML-aware compression (`true`) keeps a single space + // here, while the default JSX rules remove it entirely. + assert.ok( + html.includes('helloworld'), + 'whitespace between inline elements should be removed', + ); + }); + + it('collapses multi-line text into a single line', () => { + assert.ok(html.includes('

Hello world

')); + }); + + it('preserves whitespace inside
 tags', () => {
+		assert.match(html, /
\n\s+keep\n\s+this\n\s+whitespace/);
+	});
+
+	it('removes every newline outside of 
', () => {
+		const withoutPre = html.replace(//g, '');
+		assert.equal(NEW_LINES.test(withoutPre), false);
+	});
+});
+
+describe('HTML minification (compressHTML: true differs from the default)', () => {
+	it('keeps a single space between inline elements', async () => {
+		const fixture = await loadFixture({
+			root: './fixtures/minification-html-default/',
+			build: { inlineStylesheets: 'never' },
+			outDir: './dist/minification-html-true/',
+			compressHTML: true,
+		});
+		await fixture.build();
+		const html = await fixture.readFile('/index.html');
+		assert.ok(
+			html.includes('hello world'),
+			'HTML-aware compression should preserve inline whitespace as a single space',
+		);
+	});
+});
diff --git a/packages/astro/test/units/manifest/serialized.test.ts b/packages/astro/test/units/manifest/serialized.test.ts
index 28e74d110a5f..f61fcc70da5a 100644
--- a/packages/astro/test/units/manifest/serialized.test.ts
+++ b/packages/astro/test/units/manifest/serialized.test.ts
@@ -165,10 +165,10 @@ describe('serializedManifestPlugin - dev mode', () => {
 	});
 
 	describe('compressHTML', () => {
-		it('is true by default', async () => {
+		it("is 'jsx' by default", async () => {
 			const settings = await createBasicSettings({});
 			const manifest = await getManifest(settings);
-			assert.equal(manifest.compressHTML, true);
+			assert.equal(manifest.compressHTML, 'jsx');
 		});
 
 		it('is false when explicitly disabled', async () => {
diff --git a/packages/astro/test/units/test-utils.ts b/packages/astro/test/units/test-utils.ts
index b78a2d31085b..ee8464644946 100644
--- a/packages/astro/test/units/test-utils.ts
+++ b/packages/astro/test/units/test-utils.ts
@@ -162,7 +162,7 @@ export function createBasicPipeline(
 		adapterName?: string;
 		clientDirectives?: Map;
 		inlinedScripts?: Map;
-		compressHTML?: boolean;
+		compressHTML?: boolean | 'jsx';
 		i18n?: SSRManifest['i18n'];
 		middleware?: SSRManifest['middleware'];
 		routeCache?: RouteCache;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c2ca2247ff35..142345057247 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -3434,6 +3434,12 @@ importers:
         specifier: workspace:*
         version: link:../../..
 
+  packages/astro/test/fixtures/minification-html-default:
+    dependencies:
+      astro:
+        specifier: workspace:*
+        version: link:../../..
+
   packages/astro/test/fixtures/minification-html-jsx:
     dependencies:
       '@astrojs/react':

From bcc0ee0fd7bde219183197ff6671e4f86892419e Mon Sep 17 00:00:00 2001
From: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
Date: Mon, 15 Jun 2026 16:16:28 +0200
Subject: [PATCH 2/4] fix: things

---
 .changeset/compress-html-jsx-default.md       |   2 +-
 packages/astro/package.json                   |   2 +-
 packages/astro/src/types/public/config.ts     |   2 +-
 packages/astro/test/minification-html.test.ts |   2 +-
 packages/astro/test/serializeManifest.test.ts |   2 +-
 pnpm-lock.yaml                                | 113 +++++++++++-------
 6 files changed, 72 insertions(+), 51 deletions(-)

diff --git a/.changeset/compress-html-jsx-default.md b/.changeset/compress-html-jsx-default.md
index f468d340badc..3da7a85972b8 100644
--- a/.changeset/compress-html-jsx-default.md
+++ b/.changeset/compress-html-jsx-default.md
@@ -4,6 +4,6 @@
 
 Makes `'jsx'` the default value for `compressHTML`
 
-Astro now strips whitespace from your HTML using JSX rules by default, the same way frameworks like React do. Whitespace and line breaks between elements are removed unless you explicitly write them in your source, for example with `{" "}`.
+Astro now strips whitespace from your HTML using JSX rules by default, the same way frameworks like React do. Whitespace and line breaks around elements are removed, but meaningful whitespace within a single line — like a space between two inline elements — is preserved. To keep a space that would otherwise be removed, write it explicitly in your source, for example with `{" "}`.
 
 This can change rendered output where whitespace between inline elements was previously meaningful. To keep Astro's earlier behavior, set `compressHTML: true` for HTML-aware compression, or `compressHTML: false` to preserve all whitespace.
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 8d13a4ac3c21..5eaf76c433f3 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -133,7 +133,7 @@
     "test:integration": "astro-scripts test \"test/*.test.ts\" --parallel --strip-types"
   },
   "dependencies": {
-    "@astrojs/compiler-rs": "^0.1.10",
+    "@astrojs/compiler-rs": "^0.2.2",
     "@astrojs/internal-helpers": "workspace:*",
     "@astrojs/markdown-satteri": "workspace:*",
     "@astrojs/telemetry": "workspace:*",
diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts
index 72a7bfb3df42..0559f6d10886 100644
--- a/packages/astro/src/types/public/config.ts
+++ b/packages/astro/src/types/public/config.ts
@@ -479,7 +479,7 @@ export interface AstroUserConfig<
 	 *
 	 * Controls how Astro handles whitespace in your HTML. This affects both development mode and the final build output.
 	 *
-	 * By default (`'jsx'`), Astro applies the JSX whitespace stripping rules used by frameworks like React. Leading and trailing whitespace is only preserved when explicitly included in the source code through constructs such as `{" "}`, and is otherwise removed entirely.
+	 * By default (`'jsx'`), Astro applies the JSX whitespace rules used by frameworks like React. Whitespace and line breaks around elements are removed and multi-line text is collapsed onto a single line, but whitespace within a single line — such as a space between two inline elements — is preserved. To keep a space that would otherwise be removed, include it explicitly in the source through constructs such as `{" "}`.
 	 *
 	 * Setting this option to `true` instead removes whitespace, including line breaks, in a lossless manner from `.astro` components. Some whitespace may be preserved as needed to maintain the visual rendering of your HTML.
 	 *
diff --git a/packages/astro/test/minification-html.test.ts b/packages/astro/test/minification-html.test.ts
index 65cc1933a3e2..71354be64a79 100644
--- a/packages/astro/test/minification-html.test.ts
+++ b/packages/astro/test/minification-html.test.ts
@@ -116,7 +116,7 @@ describe('HTML minification (JSX mode)', () => {
 
 		it('should preserve inline text and elements on the same line', () => {
 			assert.ok(
-				html.includes('helloworld'),
+				html.includes('hello world'),
 				'inline elements should preserve spacing',
 			);
 		});
diff --git a/packages/astro/test/serializeManifest.test.ts b/packages/astro/test/serializeManifest.test.ts
index 36915cc0a42d..80c170640c66 100644
--- a/packages/astro/test/serializeManifest.test.ts
+++ b/packages/astro/test/serializeManifest.test.ts
@@ -39,7 +39,7 @@ describe('astro:config/client', () => {
 						format: 'directory',
 					},
 					trailingSlash: 'always',
-					compressHTML: true,
+					compressHTML: 'jsx',
 					site: 'https://example.com',
 				}),
 			);
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 142345057247..1973beb071fe 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -528,8 +528,8 @@ importers:
   packages/astro:
     dependencies:
       '@astrojs/compiler-rs':
-        specifier: ^0.1.10
-        version: 0.1.10(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
+        specifier: ^0.2.2
+        version: 0.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
       '@astrojs/internal-helpers':
         specifier: workspace:*
         version: link:../internal-helpers
@@ -6770,69 +6770,69 @@ packages:
     resolution: {integrity: sha512-bVzyKzEpIwqjihBU/aUzt1LQckJuHK0agd3/ITdXhPUYculrc6K1/K7H+XG4rwjXtg+ikT3PM05V1MVYWiIvQw==}
     engines: {node: '>=18.14.1'}
 
-  '@astrojs/compiler-binding-darwin-arm64@0.1.10':
-    resolution: {integrity: sha512-zDYwHvXVCm91XUm5xBRPbZK6yx9foM+Ut2qHiL0L37r1daF1bGLhnYjNV/VP35OLH5o/A1j+9uvl1xEX2a3ftw==}
+  '@astrojs/compiler-binding-darwin-arm64@0.2.2':
+    resolution: {integrity: sha512-1WxpECx3izz5X4Ha3l6ex79HZlUHpKBTElGJsfOosnhVvXhccfcXAsBlrYPNmUOKJWiG7mcrje0ELSr1KPE69Q==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [arm64]
     os: [darwin]
 
-  '@astrojs/compiler-binding-darwin-x64@0.1.10':
-    resolution: {integrity: sha512-EqugPJFuQdG11sG6TtO8uq0njcEyv9y/5gdpBRZJE6aSoM3yWFmTQ/aNU8PWIiz1upZFjdNQ/UUnVNzYd7N7Uw==}
+  '@astrojs/compiler-binding-darwin-x64@0.2.2':
+    resolution: {integrity: sha512-PdIQidwQ4nUX/qNL0JXzSwNYadr+yX/Yoo+kZSCxBZqlAqug9SlKR/1H5EG5jSEpkEDRo2d1JdrO1W4kU6uNHw==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [x64]
     os: [darwin]
 
-  '@astrojs/compiler-binding-linux-arm64-gnu@0.1.10':
-    resolution: {integrity: sha512-h1UN8yx2vO/0uwnExN/8MNfsDr7OFADVM3Vv0JWeSpmUO6sFOvTsGVAeBBl29up6c4sdT3QJ5rf6sczQsc25dA==}
+  '@astrojs/compiler-binding-linux-arm64-gnu@0.2.2':
+    resolution: {integrity: sha512-5sZicPkJCoyxTEOW2he+u6UV97pTXY4c7fbHOZ/aslu9ewsunD0231QUBSvnjBB9hRFzzP2JRfNCLY+IvWfw0Q==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [arm64]
     os: [linux]
     libc: [glibc]
 
-  '@astrojs/compiler-binding-linux-arm64-musl@0.1.10':
-    resolution: {integrity: sha512-ot1Lksml0FqrrlYa89wGXQM+n290ncj65PZAq8siEWmXsmwoNCYCbqRSwRO6I/cT+PDlmmV0AcFTrp1DEO3PUA==}
+  '@astrojs/compiler-binding-linux-arm64-musl@0.2.2':
+    resolution: {integrity: sha512-Vto5fqRzMepQNJPeEhQLOIkmAoNbSBQNlpMe64OHTjEbAtQpJYVHEwe+8WJLaEGLA9qBksLv7ctiYPLLxgVVYQ==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [arm64]
     os: [linux]
     libc: [musl]
 
-  '@astrojs/compiler-binding-linux-x64-gnu@0.1.10':
-    resolution: {integrity: sha512-RGKGCbCvDat+DppnQbiWIhif6ptvkyXMdqOa7NjES4UoqIIUjE3YZfRn8gp3bXUe4ReWv4hGO1TQd2eitONt1g==}
+  '@astrojs/compiler-binding-linux-x64-gnu@0.2.2':
+    resolution: {integrity: sha512-NJTTaUDU49WEJT+ImS9evlv3i3x42HN8PbcqdyydI9picnKtuf5TxRL94naoW09YDMYWpkrwVeVqaG7GTSIepQ==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [x64]
     os: [linux]
     libc: [glibc]
 
-  '@astrojs/compiler-binding-linux-x64-musl@0.1.10':
-    resolution: {integrity: sha512-UemMv5Xq9c7trG9Cel4MHAo2wYiCxZ6qIKUnI4NJqBXDtOBqAjcMoqMbw78KYkb9vg2OIewVaJ+YvQrFZs5VBg==}
+  '@astrojs/compiler-binding-linux-x64-musl@0.2.2':
+    resolution: {integrity: sha512-9nFdNDkWaU35bhWUIciDmi439W0fq2ZNgv1GCi2A/LSb+8vTw9l9z+fVW4YEn7Tlvbs8gyQkJvbc62ZD1H76xA==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [x64]
     os: [linux]
     libc: [musl]
 
-  '@astrojs/compiler-binding-wasm32-wasi@0.1.10':
-    resolution: {integrity: sha512-SwawjgiYnm7s5neVKRoHIsnGG06vhuFhKg0iMBO6EsnL19xVbUp61V50gVtdgFlsfXalfH6SHuv2wQw8FhFSNg==}
+  '@astrojs/compiler-binding-wasm32-wasi@0.2.2':
+    resolution: {integrity: sha512-3NWaxRc3KSwr9zHBEGcQ147rMgAhi/HzZWZJPRN2YLbtuLhoeBPruhdX1MIlOYAg3FvJPYdzGCAKvvWWU6pF0A==}
     engines: {node: '>=14.0.0'}
     cpu: [wasm32]
 
-  '@astrojs/compiler-binding-win32-arm64-msvc@0.1.10':
-    resolution: {integrity: sha512-DKGOtbS8AZztvKUUdzvf+bOp7QLudmQiMHSYobSZKFanryQH5SllOMrZsL2pbDAcfBBrf0WsYWp9R+/ga7gGhQ==}
+  '@astrojs/compiler-binding-win32-arm64-msvc@0.2.2':
+    resolution: {integrity: sha512-QsyOgocLGOwDm8zAyuAiziALMzbTTevaqBLv5lvdhyhj2JC5yjp0H3yeEBtE0owRLr1gDQdX0+1qBSc5tTwp4g==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [arm64]
     os: [win32]
 
-  '@astrojs/compiler-binding-win32-x64-msvc@0.1.10':
-    resolution: {integrity: sha512-de9Y0GPm19G6SPgUk86ycZNuWEw7AA7vLZvsi/+cNR7tr/vOabU931O22L4bjjS138PFWmBz+qYOH9CT6h6BDA==}
+  '@astrojs/compiler-binding-win32-x64-msvc@0.2.2':
+    resolution: {integrity: sha512-+/C8Oh9YS8C0fwtaqDtUSPniKwlJqgiQbxp7XuzxCP0RI/Jf7yOlz9ZHNr6jD3ZJa4CHdq0mYq7pd8QFiNGIZA==}
     engines: {node: ^20.19.0 || >=22.12.0}
     cpu: [x64]
     os: [win32]
 
-  '@astrojs/compiler-binding@0.1.10':
-    resolution: {integrity: sha512-XvsWOM1JTjTDETD4qK2rIIHyPSMtBP+t7+Hmgk1kd4/iiUxLPnyLjnwLKX7N5t1MBHNmGiEA39DOslSMtlnfeg==}
+  '@astrojs/compiler-binding@0.2.2':
+    resolution: {integrity: sha512-PkCo+UcSxMt9pufjv28kRy8YU88O/XNgm7apwkyhkrCecLY62QCj5UA3nOTMO88PPyVKnUh/6FZbPefBhDD5IA==}
     engines: {node: ^20.19.0 || >=22.12.0}
 
-  '@astrojs/compiler-rs@0.1.10':
-    resolution: {integrity: sha512-Mul2veNSpEzwd1Zk6coIAu9TKyk6RjBJMWaOOrelBBA+ZmcGXhj7MabjowNTOMgvRUU8YHXAHadzoKD0y49uxw==}
+  '@astrojs/compiler-rs@0.2.2':
+    resolution: {integrity: sha512-C0qoz7Hxa2krlwMYfzQ1ZxOjR6cGmO+iskjRXXCdUM85W/cAPGTi/MSQlLkv0ADMz+Go1/lqeRBjL8AZwsFffQ==}
 
   '@astrojs/compiler@2.13.1':
     resolution: {integrity: sha512-f3FN83d2G/v32ipNClRKgYv30onQlMZX1vCeZMjPsMMPl1mDpmbl0+N5BYo4S/ofzqJyS5hvwacEo0CCVDn/Qg==}
@@ -8636,6 +8636,12 @@ packages:
       '@emnapi/core': ^1.7.1
       '@emnapi/runtime': ^1.7.1
 
+  '@napi-rs/wasm-runtime@1.1.5':
+    resolution: {integrity: sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==}
+    peerDependencies:
+      '@emnapi/core': ^1.7.1
+      '@emnapi/runtime': ^1.7.1
+
   '@netlify/ai@0.4.1':
     resolution: {integrity: sha512-ETLtV/9taYrcGhszwO+BLFgFJJ2MCnJp8BwxfwV6Z/+z3SsaUG4ExC8x4xzNCdB2GPWxXrXkvR2LFNsPFSLcRA==}
     engines: {node: '>=20.6.1'}
@@ -9693,6 +9699,9 @@ packages:
   '@tybys/wasm-util@0.10.1':
     resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==}
 
+  '@tybys/wasm-util@0.10.2':
+    resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==}
+
   '@types/alpinejs@3.13.11':
     resolution: {integrity: sha512-3KhGkDixCPiLdL3Z/ok1GxHwLxEWqQOKJccgaQL01wc0EVM2tCTaqlC3NIedmxAXkVzt/V6VTM8qPgnOHKJ1MA==}
 
@@ -15772,56 +15781,56 @@ snapshots:
       log-update: 5.0.1
       sisteransi: 1.0.5
 
-  '@astrojs/compiler-binding-darwin-arm64@0.1.10':
+  '@astrojs/compiler-binding-darwin-arm64@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-darwin-x64@0.1.10':
+  '@astrojs/compiler-binding-darwin-x64@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-linux-arm64-gnu@0.1.10':
+  '@astrojs/compiler-binding-linux-arm64-gnu@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-linux-arm64-musl@0.1.10':
+  '@astrojs/compiler-binding-linux-arm64-musl@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-linux-x64-gnu@0.1.10':
+  '@astrojs/compiler-binding-linux-x64-gnu@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-linux-x64-musl@0.1.10':
+  '@astrojs/compiler-binding-linux-x64-musl@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-wasm32-wasi@0.1.10(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
+  '@astrojs/compiler-binding-wasm32-wasi@0.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
     dependencies:
-      '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
+      '@napi-rs/wasm-runtime': 1.1.5(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
     transitivePeerDependencies:
       - '@emnapi/core'
       - '@emnapi/runtime'
     optional: true
 
-  '@astrojs/compiler-binding-win32-arm64-msvc@0.1.10':
+  '@astrojs/compiler-binding-win32-arm64-msvc@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding-win32-x64-msvc@0.1.10':
+  '@astrojs/compiler-binding-win32-x64-msvc@0.2.2':
     optional: true
 
-  '@astrojs/compiler-binding@0.1.10(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
+  '@astrojs/compiler-binding@0.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
     optionalDependencies:
-      '@astrojs/compiler-binding-darwin-arm64': 0.1.10
-      '@astrojs/compiler-binding-darwin-x64': 0.1.10
-      '@astrojs/compiler-binding-linux-arm64-gnu': 0.1.10
-      '@astrojs/compiler-binding-linux-arm64-musl': 0.1.10
-      '@astrojs/compiler-binding-linux-x64-gnu': 0.1.10
-      '@astrojs/compiler-binding-linux-x64-musl': 0.1.10
-      '@astrojs/compiler-binding-wasm32-wasi': 0.1.10(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
-      '@astrojs/compiler-binding-win32-arm64-msvc': 0.1.10
-      '@astrojs/compiler-binding-win32-x64-msvc': 0.1.10
+      '@astrojs/compiler-binding-darwin-arm64': 0.2.2
+      '@astrojs/compiler-binding-darwin-x64': 0.2.2
+      '@astrojs/compiler-binding-linux-arm64-gnu': 0.2.2
+      '@astrojs/compiler-binding-linux-arm64-musl': 0.2.2
+      '@astrojs/compiler-binding-linux-x64-gnu': 0.2.2
+      '@astrojs/compiler-binding-linux-x64-musl': 0.2.2
+      '@astrojs/compiler-binding-wasm32-wasi': 0.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
+      '@astrojs/compiler-binding-win32-arm64-msvc': 0.2.2
+      '@astrojs/compiler-binding-win32-x64-msvc': 0.2.2
     transitivePeerDependencies:
       - '@emnapi/core'
       - '@emnapi/runtime'
 
-  '@astrojs/compiler-rs@0.1.10(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
+  '@astrojs/compiler-rs@0.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
     dependencies:
-      '@astrojs/compiler-binding': 0.1.10(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
+      '@astrojs/compiler-binding': 0.2.2(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
     transitivePeerDependencies:
       - '@emnapi/core'
       - '@emnapi/runtime'
@@ -17819,6 +17828,13 @@ snapshots:
       '@tybys/wasm-util': 0.10.1
     optional: true
 
+  '@napi-rs/wasm-runtime@1.1.5(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
+    dependencies:
+      '@emnapi/core': 1.10.0
+      '@emnapi/runtime': 1.10.0
+      '@tybys/wasm-util': 0.10.2
+    optional: true
+
   '@netlify/ai@0.4.1':
     dependencies:
       '@netlify/api': 14.0.18
@@ -18955,6 +18971,11 @@ snapshots:
       tslib: 2.8.1
     optional: true
 
+  '@tybys/wasm-util@0.10.2':
+    dependencies:
+      tslib: 2.8.1
+    optional: true
+
   '@types/alpinejs@3.13.11': {}
 
   '@types/aria-query@5.0.4': {}

From 0ad8fe527e19008dae50910596f87adb9f1eaecb Mon Sep 17 00:00:00 2001
From: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
Date: Mon, 15 Jun 2026 17:12:38 +0200
Subject: [PATCH 3/4] fix: weird assertions

---
 .../test/astro-script-template-dedup.test.ts     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/packages/astro/test/astro-script-template-dedup.test.ts b/packages/astro/test/astro-script-template-dedup.test.ts
index 5272a50cc6a0..9628e4f5d25f 100644
--- a/packages/astro/test/astro-script-template-dedup.test.ts
+++ b/packages/astro/test/astro-script-template-dedup.test.ts
@@ -29,8 +29,8 @@ describe('Scripts inside template elements', () => {
 		const $ = cheerio.load(html);
 
 		// One script inside the