Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
4978165
fix(cloudflare): exclude starlight from SSR dep optimization (#16151)
matthewp Mar 30, 2026
9a50757
[ci] release (#16152)
astrobot-houston Mar 30, 2026
ade6f51
refactor(mdx): more unit tests, less integrations (#16158)
ematipico Mar 31, 2026
12602a9
fix: stop CSS traversal at page boundaries (#16116)
riderx Mar 31, 2026
34c6b3a
[ci] format
ematipico Mar 31, 2026
358f826
fix(content): clear stale asset imports on content collection entry u…
dataCenter430 Mar 31, 2026
de669f0
fix(core): append assetQueryParams to inter-chunk JS imports (#15964)…
tmimmanuel Mar 31, 2026
6b6751d
[ci] format
matthewp Mar 31, 2026
34b5f13
chore: move unit tests to ts (#16157)
ematipico Mar 31, 2026
a9138ab
[ci] format
ematipico Mar 31, 2026
d0fe1ec
fix(vercel): edge middleware next() drops HTTP method and body (#16170)
bittoby Mar 31, 2026
4eec0f1
test: don't use tmp fixtures (#16177)
ematipico Apr 1, 2026
1d1448c
fix(preact): pre-optimize @preact/signals to prevent dev reload flaki…
matthewp Apr 1, 2026
b51f297
Preserve head metadata in Cloudflare dev rendering (#16161)
matthewp Apr 1, 2026
a0a49e9
fix(cloudflare): ensure HMR works when `prerenderEnvironment` is set …
rururux Apr 1, 2026
a7e7567
Include injected routes when determining whether renderers are needed…
matthewp Apr 1, 2026
7454854
fix(astro): Fix `isHTMLString` check failing in multi-realm environme…
rururux Apr 1, 2026
814406d
fix(underscore-redirects): respect trailingSlash config in redirects …
alexanderniebuhr Apr 1, 2026
402193e
[ci] format
alexanderniebuhr Apr 1, 2026
b5b8093
[ci] release (#16159)
astrobot-houston Apr 1, 2026
7610ba4
Fix periods in URLs with trailing slashes causing 404s in dev server …
Desel72 Apr 1, 2026
fffd290
docs(language-tools): mention js/ts settings namespace in vscode (#16…
Misrilal-Sah Apr 1, 2026
3cd1b16
fix(e2e): remove bogus Node.js import breaking actions-blog tests (#1…
matthewp Apr 2, 2026
080d867
test: increase testing coverage (#16189)
ematipico Apr 2, 2026
604f939
[ci] format
ematipico Apr 2, 2026
6d5469e
Preserve Cloudflare miniflare instance across dev server config resta…
matthewp Apr 2, 2026
21f9fe2
fix(astro): remove unused re-exports causing Vite build warning (#16197)
SchahinRohani Apr 2, 2026
23425e2
Fix trailingSlash for extensionless endpoints in static builds (#16193)
matthewp Apr 3, 2026
fa8033b
Unblock smoke tests: exclude astro-og-canvas@0.11.0 from minimumRelea…
matthewp Apr 4, 2026
5557dca
feat: erasableSyntaxOnly (#15719)
florian-lefebvre Apr 6, 2026
a2b9eeb
fix: react 19 ssr aito injection preload link (#16224)
fkatsuhiro Apr 6, 2026
73cbb9c
[ci] format
matthewp Apr 6, 2026
2c9bf5e
[ci] release (#16182)
astrobot-houston Apr 6, 2026
756e7be
fix(cloudflare): exclude queue consumers from prerender worker (#16225)
travisbreaks Apr 7, 2026
1da523d
refactor: port tests to ts (#16243)
ematipico Apr 7, 2026
7c65c04
fix: stream Fragment sync siblings before async children resolve (#16…
dataCenter430 Apr 7, 2026
c2a52d6
[ci] format
ematipico Apr 7, 2026
44fd3b8
Port 8 unit test files from JavaScript to TypeScript (#16249)
AmarReddy4 Apr 7, 2026
79d86b8
chore: adapt code to upstream deprecation (#16192)
alexanderniebuhr Apr 8, 2026
922ff31
refactor: migrate blog template to use new astro font loading api (#1…
alexanderdombroski Apr 8, 2026
39a4c43
[ci] format
florian-lefebvre Apr 8, 2026
5bcd03c
fix(assets): resolve Picture TDZ error when combined with content ren…
Desel72 Apr 8, 2026
686c312
Revives UnoCSS in dev mode when used with the client router (#16242)
martrapp Apr 8, 2026
0d278ac
[ci] format
martrapp Apr 8, 2026
34df955
chore: inline dlv dependency (#16259)
gameroman Apr 8, 2026
337d3aa
[ci] format
ematipico Apr 8, 2026
fab9c00
chore: upgrade biome (#16246)
ematipico Apr 8, 2026
dabd2a8
[ci] format
ematipico Apr 8, 2026
673a871
[ci] release (#16244)
astrobot-houston Apr 8, 2026
d198e82
test: port 16 routing unit tests to TypeScript (#16266)
barry3406 Apr 9, 2026
ba18015
[ci] format
ematipico Apr 9, 2026
92fc030
refactor(core): rename logger internal types (#16271)
ematipico Apr 9, 2026
7fe40bc
Bump @qwik.dev/partytown to v0.13.2 (#16265)
ChrisLaRocque Apr 10, 2026
b06eabf
Consolidate inline script escaping into shared utility (#16303)
matthewp Apr 13, 2026
b5c2fba
Skip actions server-output validation when an adapter is configured (…
matthewp Apr 13, 2026
e030bd0
Fix .svelte files in node_modules with Cloudflare prerenderEnvironmen…
matthewp Apr 13, 2026
5f3085b
[ci] format
matthewp Apr 13, 2026
bb4586a
fix: avoid full-reload in scss modules (#14924)
aralroca Apr 13, 2026
1945a93
[ci] release (#16281)
astrobot-houston Apr 13, 2026
94048f2
fix(dev): preserve --port flag after Vite-triggered server restart (#…
Arecsu Apr 14, 2026
a0c1c86
fix: add checkout step back to mergeability check (#15783)
iCiaran Apr 14, 2026
c1404b7
refactor: unit tests that are integration tests (#16280)
ematipico Apr 14, 2026
a81dd3e
Surface console output from workerd during Cloudflare prerendering (#…
matthewp Apr 14, 2026
0fcd04c
fix(core): svg via f=svg (#16316)
ematipico Apr 14, 2026
940afd5
Fix static asset error responses including immutable cache headers (#…
matthewp Apr 14, 2026
a43eb4b
Use redirect: manual in Cloudflare image binding transform (#16320)
matthewp Apr 15, 2026
75bb9f5
test: add unit test for dlv util (#16262)
gameroman Apr 15, 2026
c62516b
fix: netrify image validation (#16027)
fkatsuhiro Apr 15, 2026
8abc6ec
[ci] format
ematipico Apr 15, 2026
71e4bc2
Add nightly Semgrep security scanning workflow (#16205)
FredKSchott Apr 15, 2026
8c8980d
ci: cron job semgrep (#16336)
ematipico Apr 15, 2026
8ddb800
Update github-actions (#16146)
renovate[bot] Apr 15, 2026
eca29c1
[ci] release (#16314)
astrobot-houston Apr 15, 2026
f9cbdea
chore: add rule for detecting incorrect imports (#16343)
ematipico Apr 16, 2026
5ed467f
refactor: migrate react tests to typescript (#16318)
ocavue Apr 16, 2026
03d532e
refactor: migrate custom 404 tests to typescript (#16350)
ocavue Apr 16, 2026
95b0913
refactor: migrate vue tests to typescript (#16349)
ocavue Apr 16, 2026
184700c
fix(deps): update language tools (#16230)
renovate[bot] Apr 16, 2026
80300ea
chore: fix lock file (#16352)
ocavue Apr 16, 2026
245f300
refactor: migrate sitemap tests to typescript (#16353)
ocavue Apr 16, 2026
7d26cd7
fix: stabilize client build output filenames across runs (#16348)
ocavue Apr 16, 2026
e0b240e
changeset: add changeset for telemetry changes (#16257)
gameroman Apr 16, 2026
2dd13fa
refactor: migrate alpinejs tests to typescript (#16354)
ocavue Apr 16, 2026
5b0fdaa
fix(core): fix append of assetQueryParams to inter-chunk JS *dynamic*…
jmurty Apr 16, 2026
69c2453
refactor: migrate markdoc tests to typescript (#16355)
ocavue Apr 16, 2026
747a5b3
refactor: migrate astro-rss tests to typescript (#16357)
ocavue Apr 16, 2026
d012bfe
fix(dev): Passing on allowedDomains configuration. (#16317)
das-peter Apr 16, 2026
37e008f
refactor: migrate svelte tests to typescript (#16351)
ocavue Apr 16, 2026
811015d
chore: remove lone fixtures (#16363)
ematipico Apr 16, 2026
a6866a7
fix(core): clean chunk name (#16367)
ematipico Apr 16, 2026
ec89d39
refactor: migrate telemetry tests to typescript (#16358)
ocavue Apr 16, 2026
bb0ff91
refactor(astro): migrate error tests to typescript (#16377)
ocavue Apr 17, 2026
21cc4dd
refactor(upgrade): migrate tests to typescript (#16372)
ocavue Apr 17, 2026
77beb7e
fix(netlify): correct test describe signature (#16371)
ocavue Apr 17, 2026
dc8a01d
chore: reduce fixtures by merging them (#16364)
ematipico Apr 17, 2026
7134aa0
feat: tweak issue auto-triage (#16284)
Princesseuh Apr 17, 2026
009c421
[ci] format
Princesseuh Apr 17, 2026
6e5bc17
chore: absorb tests into others (#16365)
ematipico Apr 17, 2026
217c5b3
perf(core): cache crawl result (#16381)
ematipico Apr 17, 2026
ba2dbf1
refactor(astro): correct Fixture type signatures in test-utils (#16380)
ocavue Apr 17, 2026
5a84551
Improves Vue scoped style handling in DEV mode during client router n…
martrapp Apr 17, 2026
71c93ca
[ci] format
martrapp Apr 17, 2026
50f0dce
refactor(mdx): migrate tests to typescript (#16359)
ocavue Apr 17, 2026
fad154f
refactor(vercel): migrate tests to typescript (#16360)
ocavue Apr 17, 2026
688044f
chore(deps): update `@types/node` (#16362)
ocavue Apr 17, 2026
63c5c85
[ci] release (#16356)
astrobot-houston Apr 18, 2026
f42fed2
refactor(node): migrate unit tests to typescript (#16388)
maximslo Apr 19, 2026
28a7de8
refactor(remark): migrate tests to typescript (#16392)
ocavue Apr 20, 2026
a002540
fix(i18n): respect trailingSlash config in domain routing (#16022)
mathieumaf Apr 20, 2026
8e13469
refactor(mdx): add SpyIntegrationLogger for test (#16384)
ocavue Apr 20, 2026
9ed6b75
refactor: remove PRERENDER env variable in tests (#16391)
ocavue Apr 20, 2026
7649542
refactor(underscore-redirects): migrate tests to typescript (#16374)
ocavue Apr 20, 2026
763dcda
refactor(cloudflare): migrate tests to typescript (#16378)
ocavue Apr 20, 2026
0f24c22
refactor(astro): migrate css tests to typescript (#16393)
ocavue Apr 20, 2026
be72fd0
refactor(internal-helpers): migrate tests to typescript (#16401)
ocavue Apr 20, 2026
05e70f7
refactor(netlify): migrate tests to typescript (#16395)
ocavue Apr 20, 2026
cf074b3
refactor(astro): migrate ssr tests to typescript (#16394)
ocavue Apr 20, 2026
23ebee5
refactor(node): migrate tests to typescript (#16376)
ocavue Apr 20, 2026
46633f5
refactor(create-astro): migrate tests to typescript (#16400)
ocavue Apr 20, 2026
f31a80d
refactor(db): migrate tests to typescript (#16403)
ocavue Apr 20, 2026
35ea294
refactor(astro): migrate e2e tests to typescript (#16402)
ocavue Apr 20, 2026
32b361d
refactor(astro): migrate 39 tests to typescript (#16405)
ocavue Apr 20, 2026
eda80ea
refactor(astro): migrate 9 tests to typescript (#16410)
ocavue Apr 21, 2026
1886e7a
[ci] format
ematipico Apr 21, 2026
3852adc
refactor(astro): migrate dev tests to typescript (#16408)
ocavue Apr 21, 2026
868566c
refactor(astro): migrate content tests to typescript (#16409)
ocavue Apr 21, 2026
1c477aa
refactor(astro): migrate 10 tests to typescript (#16411)
ocavue Apr 21, 2026
72e9faa
refactor(astro): migrate 19 tests to typescript (#16414)
ocavue Apr 21, 2026
c085cb2
refactor(vercel): remove duplicated test files (#16416)
ocavue Apr 21, 2026
3bdc4ac
refactor(astro): migrate core-image tests to typescript (#16413)
ocavue Apr 21, 2026
8a13969
refactor(astro): migrate 4 tests to typescript (#16427)
ocavue Apr 21, 2026
c4d321b
Support Cloudflare Preview deployments (#16435)
jamesopstad Apr 21, 2026
0c0ae11
refactor(ts-plugin): migrate tests to typescript (#16417)
ocavue Apr 21, 2026
a3951d7
fix(astro): harden astro-island export resolution (#16422)
matthewp Apr 21, 2026
e21de1d
fix(astro): harden error overlay and log formatting (#16420)
matthewp Apr 21, 2026
471a4d6
refactor(astro): migrate all remaining tests to typescript (#16444)
ocavue Apr 22, 2026
1f31d6f
refactor(vscode): migrate tests to typescript (#16443)
ocavue Apr 22, 2026
f7566b8
refactor: unify test setup (#16445)
ocavue Apr 22, 2026
99464ed
Bump vite, picomatch, and unstorage to latest patch versions (#16448)
matthewp Apr 22, 2026
3fcdaf1
fix(upgrade): align command spawning with create-astro (#16424)
matthewp Apr 22, 2026
f3485c3
Harden nested object path lookups (#16419)
matthewp Apr 22, 2026
21ca872
[ci] release (#16399)
astrobot-houston Apr 22, 2026
208b452
Harden command execution in CI and tooling paths (#16418)
matthewp Apr 22, 2026
b2d8eb3
Document trusted patterns for semgrep (#16423)
matthewp Apr 22, 2026
7432e92
chore(deps): update github-actions (#16398)
renovate[bot] Apr 23, 2026
b073bad
ci: add next to release workflow (#16454)
ematipico Apr 23, 2026
8cb1f42
Default Cloudflare compatibility_date to avoid workerd future date re…
matthewp Apr 23, 2026
257d324
[ci] release (#16459)
astrobot-houston Apr 23, 2026
4e2f550
pick lost changes
ematipico Apr 23, 2026
a3dca85
Merge remote-tracking branch 'origin/main' into fix/merge-again-and-f…
ematipico Apr 23, 2026
73dfd35
pick lost changes
ematipico Apr 23, 2026
0b0002b
add this again
ematipico Apr 23, 2026
10e71c0
fix failures
ematipico Apr 24, 2026
7f32b88
thank you rolldown
ematipico Apr 24, 2026
7ed4749
fix another failure
ematipico Apr 24, 2026
4eb2f01
restore lost changes from e2e tests
ematipico Apr 24, 2026
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
6 changes: 4 additions & 2 deletions packages/astro/e2e/cloudflare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
type PreviewServer,
createLoggerSpy,
testFactory,
warmupDevServer,
} from './test-utils.ts';

type LogEntry = { label: string; message: unknown };
Expand Down Expand Up @@ -79,7 +80,7 @@ function sharedTests(testRunner: AstroTest, infoLogs: LogEntry[] | null = null)
});

testRunner('server island with props', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/'));
await page.goto(astro.resolveUrl('/?with-island-props=1'));
const islandProps = page.locator('#island-props');
await expect(islandProps).toContainText('Aria');
});
Expand Down Expand Up @@ -148,10 +149,11 @@ test.describe('Cloudflare', () => {
let devServer: DevServer;
const infoLogs: LogEntry[] = [];

test.beforeAll(async ({ astro }) => {
test.beforeAll(async ({ astro, browser }) => {
const logger = createLoggerSpy({ info: infoLogs });
// @ts-expect-error `logger` is an @internal option stripped from the public type
devServer = await astro.startDevServer({ logger });
await warmupDevServer(browser, astro.resolveUrl('/'));
});

test.afterAll(async () => {
Expand Down
1 change: 1 addition & 0 deletions packages/astro/e2e/hmr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ test.describe('Styles', () => {

test('SCSS modules refresh with HMR', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/scss-module'));
await waitForViteToSettle(page);

page.once('load', throwPageShouldNotReload);

Expand Down
5 changes: 3 additions & 2 deletions packages/astro/e2e/nested-in-preact.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { expect } from '@playwright/test';
import { type DevServer, testFactory, waitForHydrate } from './test-utils.ts';
import { type DevServer, testFactory, waitForHydrate, warmupDevServer } from './test-utils.ts';

const test = testFactory(import.meta.url, { root: './fixtures/nested-in-preact/' });

let devServer: DevServer;

test.beforeAll(async ({ astro }) => {
test.beforeAll(async ({ astro, browser }) => {
devServer = await astro.startDevServer();
await warmupDevServer(browser, astro.resolveUrl('/'));
});

test.afterAll(async () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/astro/e2e/nested-in-react.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { expect } from '@playwright/test';
import { type DevServer, testFactory, waitForHydrate } from './test-utils.ts';
import { type DevServer, testFactory, waitForHydrate, warmupDevServer } from './test-utils.ts';

const test = testFactory(import.meta.url, { root: './fixtures/nested-in-react/' });

let devServer: DevServer;

test.beforeAll(async ({ astro }) => {
test.beforeAll(async ({ astro, browser }) => {
devServer = await astro.startDevServer();
await warmupDevServer(browser, astro.resolveUrl('/'));
});

test.afterAll(async () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/astro/e2e/nested-in-solid.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { expect } from '@playwright/test';
import { type DevServer, testFactory, waitForHydrate } from './test-utils.ts';
import { type DevServer, testFactory, waitForHydrate, warmupDevServer } from './test-utils.ts';

const test = testFactory(import.meta.url, { root: './fixtures/nested-in-solid/' });

let devServer: DevServer;

test.beforeAll(async ({ astro }) => {
test.beforeAll(async ({ astro, browser }) => {
devServer = await astro.startDevServer();
await warmupDevServer(browser, astro.resolveUrl('/'));
});

test.afterAll(async () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/astro/e2e/nested-in-vue.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { expect } from '@playwright/test';
import { type DevServer, testFactory, waitForHydrate } from './test-utils.ts';
import { type DevServer, testFactory, waitForHydrate, warmupDevServer } from './test-utils.ts';

const test = testFactory(import.meta.url, { root: './fixtures/nested-in-vue/' });

let devServer: DevServer;

test.beforeAll(async ({ astro }) => {
test.beforeAll(async ({ astro, browser }) => {
devServer = await astro.startDevServer();
await warmupDevServer(browser, astro.resolveUrl('/'));
});

test.afterAll(async () => {
Expand Down
19 changes: 14 additions & 5 deletions packages/astro/e2e/view-transitions.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Page, expect } from '@playwright/test';
import { type DevServer, testFactory, waitForHydrate } from './test-utils.ts';
import { type DevServer, testFactory, waitForHydrate, warmupDevServer } from './test-utils.ts';

declare global {
interface Window {
Expand All @@ -15,8 +15,9 @@ const test = testFactory(import.meta.url, { root: './fixtures/view-transitions/'

let devServer: DevServer;

test.beforeAll(async ({ astro }) => {
test.beforeAll(async ({ astro, browser }) => {
devServer = await astro.startDevServer();
await warmupDevServer(browser, astro.resolveUrl('/one'));
});

test.afterAll(async () => {
Expand Down Expand Up @@ -574,6 +575,8 @@ test.describe('View Transitions', () => {
let cnt = page.locator('.counter pre');
await expect(cnt).toHaveText('5');

const counter = page.locator('.counter');
await waitForHydrate(page, counter);
await page.click('.increment');
await expect(cnt).toHaveText('6');

Expand All @@ -596,6 +599,8 @@ test.describe('View Transitions', () => {
let cnt = page.locator('.counter pre');
await expect(cnt).toHaveText('A0');

const counter = page.locator('.counter');
await waitForHydrate(page, counter);
await page.click('.increment');
await expect(cnt).toHaveText('A1');

Expand All @@ -615,7 +620,8 @@ test.describe('View Transitions', () => {
await expect(cnt).toHaveText('A1');
});

test('Svelte Islands can persist using transition:persist', async ({ page, astro }) => {
// TODO: Re-enable once Svelte is compatible with Vite v8
test.skip('Svelte Islands can persist using transition:persist', async ({ page, astro }) => {
// Go to page 1
await page.goto(astro.resolveUrl('/island-svelte-one'));
let cnt = page.locator('.counter pre');
Expand All @@ -639,6 +645,8 @@ test.describe('View Transitions', () => {
let cnt = page.locator('.counter pre');
await expect(cnt).toHaveText('AA0');

const counter = page.locator('.counter');
await waitForHydrate(page, counter);
await page.click('.increment');
await expect(cnt).toHaveText('AA1');

Expand Down Expand Up @@ -931,7 +939,7 @@ test.describe('View Transitions', () => {
// go to external page
await page.click('#click-redirect-external');
// doesn't work for playwright when we are too fast
await page.waitForLoadState('load', { timeout: 5000 });
await page.waitForLoadState('commit', { timeout: 5000 });
await page.waitForURL('https://example.com/', { waitUntil: 'commit', timeout: 5000 });
await expect(page.locator('h1'), 'should have content').toHaveText('Example Domain');
expect(loads.length, 'There should be 2 page loads').toEqual(2);
Expand Down Expand Up @@ -975,7 +983,8 @@ test.describe('View Transitions', () => {
expect(styles.length, 'style count has not changed').toEqual(totalExpectedStyles);
});

test('client:only styles are retained on transition (2/2)', async ({ page, astro }) => {
// TODO: Re-enable once Svelte is compatible with Vite v8
test.skip('client:only styles are retained on transition (2/2)', async ({ page, astro }) => {
const totalExpectedStyles_page_three = 11;
const totalExpectedStyles_page_four = 9;

Expand Down
6 changes: 0 additions & 6 deletions packages/astro/src/vite-plugin-hmr-reload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ export default function hmrReload(): Plugin {
return [];
}

// When style modules were skipped, return an empty array to prevent Vite's
// default SSR HMR propagation. Without this, Vite would propagate through the
// module graph to .astro importers, find no HMR acceptor, and trigger a
// full page reload. The client environment handles CSS HMR natively via
// Vite's built-in style update mechanism, which works for all pages
// (with or without framework components).
// When style modules were skipped, return an empty array to prevent Vite's
// default SSR HMR propagation. Without this, Vite would propagate through the
// module graph to .astro importers, find no HMR acceptor, and trigger a
Expand Down
3 changes: 1 addition & 2 deletions packages/astro/test/units/render/render-context.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { RenderContext } from '../../../dist/core/render-context.js';
import { createComponent, render } from '../../../dist/runtime/server/index.js';
import { createComponent, maybeRenderHead, render } from '../../../dist/runtime/server/index.js';
import type { AstroComponentFactory } from '../../../dist/runtime/server/render/index.js';
import { createBasicPipeline } from '../test-utils.ts';
import { maybeRenderHead } from '../../../dist/runtime/server/render/head.js';

const createAstroModule = (AstroComponent: AstroComponentFactory) => ({ default: AstroComponent });

Expand Down
6 changes: 6 additions & 0 deletions packages/integrations/cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @astrojs/cloudflare

## 13.2.1

### Patch Changes

- [#16458](https://github.com/withastro/astro/pull/16458) [`8cb1f42`](https://github.com/withastro/astro/commit/8cb1f42e378bfe6d2989f7c4edb3ccd45eca1f4f) Thanks [@matthewp](https://github.com/matthewp)! - Fixes Cloudflare dev and build failures caused by `@cloudflare/vite-plugin` defaulting `compatibility_date` to today's date, which can exceed the maximum date supported by the bundled `workerd` binary

## 13.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@astrojs/cloudflare",
"description": "Deploy your site to Cloudflare Workers",
"version": "13.2.0",
"version": "13.2.1",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
Expand Down
8 changes: 8 additions & 0 deletions packages/integrations/cloudflare/src/wrangler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ export const DEFAULT_SESSION_KV_BINDING_NAME = 'SESSION';
export const DEFAULT_IMAGES_BINDING_NAME = 'IMAGES';
export const DEFAULT_ASSETS_BINDING_NAME = 'ASSETS';

// Default compatibility date used when the user doesn't set one in their wrangler config.
// The @cloudflare/vite-plugin falls back to today's date, but that can exceed the maximum
// date supported by the bundled workerd binary (which has a ~7 day buffer from its build date),
// causing ERR_RUNTIME_FAILURE. A hard-coded date avoids this issue.
// This should be updated when upgrading wrangler/workerd dependencies.
const DEFAULT_COMPATIBILITY_DATE = '2026-04-15';

interface CloudflareConfigOptions {
sessionKVBindingName?: string | undefined;
needsSessionKVBinding?: boolean;
Expand Down Expand Up @@ -55,6 +62,7 @@ export function cloudflareConfigCustomizer(

return {
...getNonInheritableBindings(config),
compatibility_date: config.compatibility_date ?? DEFAULT_COMPATIBILITY_DATE,
main: config.main ?? '@astrojs/cloudflare/entrypoints/server',
assets: hasAssetsBinding
? undefined
Expand Down
5 changes: 3 additions & 2 deletions packages/integrations/markdoc/test/propagated-assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ describe('Markdoc - propagated assets', () => {
if (mode === 'dev') devServer?.stop();
});

it('Bundles styles', async () => {
it.only('Bundles styles', async () => {
let styleContents;
if (mode === 'dev') {
const styles = stylesDocument.querySelectorAll<HTMLStyleElement>('style');
assert.equal(styles.length, 1);
styleContents = styles[0].textContent;
assert.equal(styleContents.includes('--color-base-purple: 269, 79%;'), true);
} else {
const links = stylesDocument.querySelectorAll<HTMLLinkElement>('link[rel="stylesheet"]');
assert.equal(links.length, 1);
styleContents = await fixture.readFile(links[0].href);
assert.equal(styleContents.includes('--color-base-purple:269, 79%;'), true);
}
assert.equal(styleContents.includes('--color-base-purple: 269, 79%;'), true);
});

it('[fails] Does not bleed styles to other page', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ describe('Skew Protection', { timeout: 120000 }, () => {
for (const file of files) {
const contents = await readFile(new URL(file, chunksURL), 'utf-8');
if (contents.includes(needle)) {
found = true;
break;
const thisContents = await readFile(new URL(file, manifestURL), 'utf-8');
if (
thisContents.includes(
'"internalFetchHeaders":{"X-Netlify-Deploy-ID":"test-deploy-123"}',
)
) {
found = true;
break;
}
}
}
}

assert.ok(
found,
'Manifest should include internalFetchHeaders field with the correct deploy ID value',
Expand Down
3 changes: 2 additions & 1 deletion packages/language-tools/language-server/test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { cli } from '../../../astro/test/test-utils.js';

// Copied from utils.ts so we don't have to import TS code for Node 20
const __filename = fileURLToPath(import.meta.url);
Expand All @@ -12,6 +11,8 @@ export default async function setup() {
// We only run the tests that require sync on Node.js versions other than 20 because the language server supports
// a lower minimum version than Astro itself due to our lowest supported VS Code version, which mean we can't run Astro
if (Number.parseInt(process.versions.node) !== 20) {
// @ts-expect-error
const { cli } = await import('../../../astro/test/test-utils.js');
const res = await cli('sync', '--root', fixtureDir).getResult();
if (res.exitCode !== 0) {
throw new Error(res.stderr);
Expand Down
Loading
Loading