Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/fair-points-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Avoid a `MaxListenersExceededWarning` during `astro dev` startup by increasing the shared Vite watcher listener limit when attaching content server listeners.
5 changes: 5 additions & 0 deletions .changeset/few-houses-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/preact': patch
---

Fix `useId()` collisions across multiple Astro islands by seeding a unique per-island root mask for Preact SSR and hydration.
5 changes: 0 additions & 5 deletions .changeset/fix-dev-toolbar-optimize-deps.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-i18n-redirect-double-slash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-server-islands-prerender.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/new-routes-dev-css.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/quiet-trains-accept.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sparkly-peas-mix.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/swift-terms-lose.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/tame-phones-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/check': patch
---

Fixes Astro not being able to find astro check sometimes
5 changes: 0 additions & 5 deletions .changeset/tricky-otters-go.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wise-cats-check.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/wise-turkeys-tan.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.0.3"
"astro": "^6.0.4"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/mdx": "^5.0.0",
"@astrojs/rss": "^4.0.17",
"@astrojs/sitemap": "^3.7.1",
"astro": "^6.0.3",
"astro": "^6.0.4",
"sharp": "^0.34.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^6.0.3"
"astro": "^6.0.4"
},
"peerDependencies": {
"astro": "^5.0.0 || ^6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@astrojs/react": "^5.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^3.2.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@astrojs/alpinejs": "^0.5.0",
"@types/alpinejs": "^3.13.11",
"alpinejs": "^3.15.8",
"astro": "^6.0.3"
"astro": "^6.0.4"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@astrojs/vue": "^6.0.0",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"astro": "^6.0.3",
"astro": "^6.0.4",
"preact": "^10.28.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@astrojs/preact": "^5.0.0",
"@preact/signals": "^2.8.1",
"astro": "^6.0.3",
"astro": "^6.0.4",
"preact": "^10.28.4"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/react": "^5.0.0",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"astro": "^6.0.3",
"astro": "^6.0.4",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^6.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"solid-js": "^1.9.11"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/svelte": "^8.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"svelte": "^5.53.5"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/vue": "^6.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"vue": "^3.5.29"
}
}
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^10.0.0",
"astro": "^6.0.3"
"@astrojs/node": "^10.0.1",
"astro": "^6.0.4"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^6.0.3"
"astro": "^6.0.4"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.0.3"
"astro": "^6.0.4"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.0.3"
"astro": "^6.0.4"
}
}
4 changes: 2 additions & 2 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^10.0.0",
"@astrojs/node": "^10.0.1",
"@astrojs/svelte": "^8.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"svelte": "^5.53.5"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.0.3",
"astro": "^6.0.4",
"sass": "^1.97.3",
"sharp": "^0.34.3"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@types/node": "^18.17.8",
"astro": "^6.0.3"
"astro": "^6.0.4"
},
"engines": {
"node": ">=22.12.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^1.0.0",
"astro": "^6.0.3"
"astro": "^6.0.4"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@astrojs/mdx": "^5.0.0",
"@astrojs/preact": "^5.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"preact": "^10.28.4"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@astrojs/preact": "^5.0.0",
"@nanostores/preact": "^1.0.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"nanostores": "^1.1.1",
"preact": "^10.28.4"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/mdx": "^5.0.0",
"@tailwindcss/vite": "^4.2.1",
"@types/canvas-confetti": "^1.9.0",
"astro": "^6.0.3",
"astro": "^6.0.4",
"canvas-confetti": "^1.9.4",
"tailwindcss": "^4.2.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^6.0.3",
"astro": "^6.0.4",
"vitest": "^3.2.4"
}
}
18 changes: 18 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# astro

## 6.0.4

### Patch Changes

- [#15870](https://github.com/withastro/astro/pull/15870) [`920f10b`](https://github.com/withastro/astro/commit/920f10bb3a49da8355967df99c32c43cc9f53b46) Thanks [@matthewp](https://github.com/matthewp)! - Prebundle `astro/toolbar` in dev when custom dev toolbar apps are registered, preventing re-optimization reloads that can hide or break the toolbar.

- [#15876](https://github.com/withastro/astro/pull/15876) [`f47ac53`](https://github.com/withastro/astro/commit/f47ac5352dcb36daa64ec12b7d4ac193045d10e3) Thanks [@ematipico](https://github.com/ematipico)! - Fixes `redirectToDefaultLocale` producing a protocol-relative URL (`//locale`) instead of an absolute path (`/locale`) when `base` is `'/'`.

- [#15767](https://github.com/withastro/astro/pull/15767) [`e0042f7`](https://github.com/withastro/astro/commit/e0042f720274d8763907c1d429723192a71d6932) Thanks [@matthewp](https://github.com/matthewp)! - Fixes server islands (`server:defer`) not working when only used in prerendered pages with `output: 'server'`.

- [#15873](https://github.com/withastro/astro/pull/15873) [`35841ed`](https://github.com/withastro/astro/commit/35841ed273581a567cd726bb2d14d2ed3886bed0) Thanks [@matthewp](https://github.com/matthewp)! - Fix a dev server bug where newly created pages could miss layout-imported CSS until restart.

- [#15874](https://github.com/withastro/astro/pull/15874) [`ce0669d`](https://github.com/withastro/astro/commit/ce0669d68115c5e2d00238f3e780a2af50f5be11) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a warning when using `prefetchAll`

- [#15754](https://github.com/withastro/astro/pull/15754) [`58f1d63`](https://github.com/withastro/astro/commit/58f1d63cbcdd351d80cc65ceff4cb1a8d1aa1853) Thanks [@rururux](https://github.com/rururux)! - Fixes a bug where a directory at the project root sharing the same name as a page route would cause the dev server to return a 404 instead of serving the page.

- [#15869](https://github.com/withastro/astro/pull/15869) [`76b3a5e`](https://github.com/withastro/astro/commit/76b3a5e4bb1e9f2855d4169602295d601d7e7436) Thanks [@matthewp](https://github.com/matthewp)! - Update the unknown file extension error hint to recommend `vite.resolve.noExternal`, which is the correct Vite 7 config key.

## 6.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "6.0.3",
"version": "6.0.4",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down
7 changes: 7 additions & 0 deletions packages/astro/src/content/server-listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export async function attachContentServerListeners({
logger,
settings,
}: ContentServerListenerParams) {
// The default max listeners is 10, which is easy to exceed in dev when
// integrations and internal features all subscribe to the same watcher.
const maxListeners = viteServer.watcher.getMaxListeners();
if (maxListeners !== 0 && maxListeners < 50) {
viteServer.watcher.setMaxListeners(50);
}

const contentGenerator = await createContentTypesGenerator({
fs,
settings,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { h } from 'preact';
import { useId } from 'preact/hooks';

export default function UseId() {
const id = useId();

return (
<div class="use-id-component">
<label for={id}>Input</label>
<input id={id} data-id={id} />
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import UseId from '../components/UseId.jsx';
---

<html>
<head>
<title>Preact useId</title>
</head>
<body>
<UseId client:load />
<UseId client:load />
<UseId client:only="preact" />
</body>
</html>
21 changes: 21 additions & 0 deletions packages/astro/test/preact-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ describe('Preact component', () => {
assert.equal($('#world').length, 1);
});

it('Can generate unique useId values across islands', async () => {
const html = await fixture.readFile('/use-id/index.html');
const $ = cheerio.load(html);

const useIdInputs = $('.use-id-component input');
assert.equal(useIdInputs.length, 2);

const firstInputId = $(useIdInputs[0]).attr('id');
const secondInputId = $(useIdInputs[1]).attr('id');
assert.notEqual(firstInputId, undefined);
assert.notEqual(secondInputId, undefined);
assert.notEqual(firstInputId, secondInputId);

const islands = $('astro-island');
const firstIslandId = $(islands[0]).attr('data-preact-island-id');
const secondIslandId = $(islands[1]).attr('data-preact-island-id');
assert.notEqual(firstIslandId, undefined);
assert.notEqual(secondIslandId, undefined);
assert.notEqual(firstIslandId, secondIslandId);
});

it('Can export a Fragment', async () => {
const html = await fixture.readFile('/frag/index.html');
const $ = cheerio.load(html);
Expand Down
Loading
Loading