Skip to content

Commit 9265546

Browse files
matthewpPrincesseuhantonyfarisflorian-lefebvrerenovate[bot]
authored
Merge main into next (#15176)
* fix(ci): Reinstall deps after having published VS Code (#14996) * fix(svelte): allow client directives (#15004) * fix(assets): Fixes missing format option for svgs in the passthrough service (#14987) * fix(assets): Fixes missing format option for svgs in the passthrough service * fix: wtf is going on * chore: changeset * [ci] format * chore: auto format next (#15009) * chore(deps): update github-actions (#15019) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update all non-major dependencies (#15020) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Support extending the image API props type (#15014) * [ci] release (#14997) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(content-layer): Try a smarter solution to normalize bare image paths in JSON (#15028) * fix(content-layer): Try a smarter solution to normalize bare image paths in JSON * chore: changeset * [ci] format * chore: document core/infra architecture (#14815) Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> Co-authored-by: Matt Kane <m@mk.gg> Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Matthew Phillips <matthew@skypack.dev> * [ci] format * fix(astro): assets vite build log (#15034) * chore(sitemap): migrate to astro:routes:resolved (#15033) * fix: Remote images: Prevent internal caching from interfering with Astro's cache (#14954) Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * [ci] format * Update font utility dependencies to use lighter versions (#15055) * Update font utility dependencies to use lighter versions * Add changeset * skip flaky view transitions redirect test (#15060) * chore(deps): update actions-cool/issues-helper action to v3.7.5 (#15071) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * ClientRouter: Preserve hash fragment during redirects (#15088) * try resurrecting a flaky test (#15089) * fix(deps): update astro adapters (#15084) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update all non-major dependencies (#15072) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update astro client runtimes (#15085) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: move ts-plugin node_modules to dist (#15083) * fix: move ts-plugin node_modules to dist * add: changeset * [ci] format * Update image-size (#15105) * fix: components imports paths (#15107) * Tailwind example, README.md: update link (#15099) * fix(assets): Use Vite's isFileLoadingAllowed to check if a file can be loaded (#15052) * fix(assets): Use Vite's isFileLoadingAllowed to check if a file can be loaded * test: add * fix: windwos perhaos? * chore: changeset * [ci] format * Update prettier extension to new one (#15108) * fix(vscode): Correctly handle TypeScript blocks ending with types (#15109) * fix(vscode): Correctly handle TypeScript blocks ending with types * chore: changeset * [ci] format * fix(svelte): improve Svelte children prop type checking (#15070) * chore: Replace fast-glob with tinyglobby in language server (#15057) * chore: Replace fast-glob with tinyglobby in language server * Use `expandDirectories` option for compatibility with fast-glob * Update packages/language-tools/language-server/src/check.ts --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> * view transitions: fix Firefox e2e tests for playwright 1.57 (#15113) * fix(deps): update astro dependencies (#15103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * fix: lint vt test (#15114) * [ci] format * fix(deps): update language tools (#15104) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * Feature/allow node 24 vercel adapter (#15116) * feat(fonts): new font resolver abstraction (#15111) * [ci] format * feat(fonts)!: upgrade unifont and support formats (#15117) Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> * fix(vue): add HTML attributes to generated TypeScript types (#15016) * fix(vue): add HTML attributes to generated TypeScript types Fixes #14686 * fix: add package exports and update tests for HTML attributes support * test(vue): add astro check test for HTML attributes Add test fixture and test case to verify that Vue components correctly accept HTML attributes (class, style, id, data-*) and client directives via astro check. Follows the same pattern as the Svelte integration tests. * chore: update lockfile for vue prop-types fixture * feat: deduplicate context types (#15122) Co-authored-by: Armand Philippot <git@armand.philippot.eu> * perf(astro): group chunks on emit (#15123) Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> Co-authored-by: matthewp <361671+matthewp@users.noreply.github.com> Co-authored-by: florian-lefebvre <69633530+florian-lefebvre@users.noreply.github.com> Co-authored-by: ematipico <602478+ematipico@users.noreply.github.com> * feat(fonts): clean types (#15118) * [ci] release (#15031) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(vscode): Don't update @types/vscode automatically (#15131) * fix(vscode): Don't update @types/vscode automatically * chore: changeset * fix: adjust page warning to only show up in more relevant times (#15127) * fix: adjust page warning to only show up in more relevant times * chore: changeset * [ci] format * Update security contacts list (#15143) * fix(dev): preserve query params when base path is stripped (#15124) Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * fix(assets): hoist ?? inside JSON.stringify in virtual module codegen (#15140) * fix(assets): hoist nullish coalescing inside JSON.stringify Moves ?? fallbacks before serialization to eliminate dead code in generated virtual module. Fixes esbuild suspicious-nullish-coalescing warning. * chore: add changeset * Attempt to reduce falkiness in view transition e2e tests (#15142) * Attempt to reduce falkiness in view transition e2e tests * try wait for idle state * next try * Update view-transitions.test.js * [ci] format * fix(toolbar): skip image audit for framework components (#15149) * fix(toolbar): skip image audit for framework components Images inside astro-island elements (React, Vue, Svelte, etc. with client:* directives) now skip the 'Use the Image component' audit warning, since these components can't directly use Astro's Image component. Fixes #15048 * test: remove unused image * test: use smaller test image (22KB instead of 253KB) * fix: Accept setCookie from both context and headers (#15152) Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * [ci] release (#15132) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(ci): Move ts-plugin-bundle to node_modules after recreating node_modules (#15156) * fix(ci): Move ts-plugin-bundle to node_modules after recreating node_modules * fix: make itw ork in dev * chore: changeset * [ci] release (#15158) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: scripts not rendering with unused Fragment slots (#13847) (#15147) * Fix hydration for framework components in MDX slots (#15150) * Fix hydration for framework components in MDX slots using Astro.slots.render() * Update packages/astro/src/runtime/server/render/slot.ts Co-authored-by: Luiz Ferraz <luiz@lferraz.com> --------- Co-authored-by: Luiz Ferraz <luiz@lferraz.com> * [ci] format * Fixes build * fix: apply trailing slash query params fix to new architecture Port fix from #15124 to vite-plugin-app/app.ts --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> Co-authored-by: Antony Faris <acp325@gmail.com> Co-authored-by: Erika <Princesseuh@users.noreply.github.com> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> Co-authored-by: Matt Kane <m@mk.gg> Co-authored-by: Florian Lefebvre <florian-lefebvre@users.noreply.github.com> Co-authored-by: Volpeon <76151476+volpeon@users.noreply.github.com> Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com> Co-authored-by: fkatsuhiro <113022468+fkatsuhiro@users.noreply.github.com> Co-authored-by: Oliver Speir <115520730+OliverSpeir@users.noreply.github.com> Co-authored-by: Andreas Deininger <andreas@deininger.net> Co-authored-by: Roman <me@rman.dev> Co-authored-by: fabon <syobon.hinata.public@gmail.com> Co-authored-by: Raanelom <code@timid.nl> Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Co-authored-by: Rahul Dogra <rahuldogra1998@gmail.com> Co-authored-by: Armand Philippot <git@armand.philippot.eu> Co-authored-by: James Garbutt <43081j@users.noreply.github.com> Co-authored-by: matthewp <361671+matthewp@users.noreply.github.com> Co-authored-by: florian-lefebvre <69633530+florian-lefebvre@users.noreply.github.com> Co-authored-by: ematipico <602478+ematipico@users.noreply.github.com> Co-authored-by: Pegasus <42954461+leonace924@users.noreply.github.com> Co-authored-by: Cameron Smith <cameron.ray.smith@gmail.com> Co-authored-by: Martin Trapp <martrapp@users.noreply.github.com> Co-authored-by: Rafael ヤスヒデ 須藤 <rururux@gmail.com> Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
1 parent f67b738 commit 9265546

File tree

46 files changed

+1354
-747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1354
-747
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fixes hydration for framework components inside MDX when using `Astro.slots.render()`
6+
7+
Previously, when multiple framework components with `client:*` directives were passed as named slots to an Astro component in MDX, only the first slot would hydrate correctly. Subsequent slots would render their HTML but fail to include the necessary hydration scripts.

.changeset/yummy-peas-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fixes scripts in components not rendering when a sibling `<Fragment slot="...">` exists but is unused

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ jobs:
7575
working-directory: ./packages/language-tools/vscode
7676
run: |
7777
npm run build:grammar
78+
mv node_modules/astro-ts-plugin-bundle ./astro-ts-plugin-bundle # move the ts-plugin out of node_modules to avoid deletion
7879
rm -rf node_modules
7980
# Also delete root package.json and node_modules to avoid vsce picking up any monorepo info
8081
mv ../../../package.json ../../../package.temp.json
8182
rm -rf ../../../node_modules
8283
sleep 60s # wait for npm registry to update
8384
npm i --workspaces=false # vsce does not support pnpm, so we need to pretend this is not a monorepo and use npm
85+
mv ./astro-ts-plugin-bundle ./node_modules/astro-ts-plugin-bundle
8486
8587
- name: Publish to VSCode Marketplace
8688
if: steps.vscode-published.outputs.published == 'true'

SECURITY_CONTACTS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
Fred K. Schott (@fks)
1414
Matthew Phillips (@matthewp)
15-
Nate Moore (@natemoo-re)
15+
Emanuele Stoppa (@ematipico)
1616

packages/astro/CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,92 @@
258258
- Updated dependencies [[`727b0a2`](https://github.com/withastro/astro/commit/727b0a205eb765f1c36f13a73dfc69e17e44df8f)]:
259259
- @astrojs/markdown-remark@7.0.0-alpha.0
260260

261+
## 5.16.8
262+
263+
### Patch Changes
264+
265+
- [#15124](https://github.com/withastro/astro/pull/15124) [`81db3c0`](https://github.com/withastro/astro/commit/81db3c06e8f75bf1ec6f3d4d31a42d16dcf0e969) Thanks [@leonace924](https://github.com/leonace924)! - Fixes an issue where requests with query parameters to the `base` path would return a 404 if trailingSlash was not `'ignore'` in development
266+
267+
- [#15152](https://github.com/withastro/astro/pull/15152) [`39ee41f`](https://github.com/withastro/astro/commit/39ee41fa56b362942162dc17b0b4252d2f881e7e) Thanks [@rururux](https://github.com/rururux)! - Fixes a case where `context.cookies.set()` would be overriden when setting cookies via response headers in development
268+
269+
- [#15140](https://github.com/withastro/astro/pull/15140) [`6f6f8f8`](https://github.com/withastro/astro/commit/6f6f8f8c0c3ccf346d741a8625bbfbe1329e472e) Thanks [@cameronraysmith](https://github.com/cameronraysmith)! - Fixes esbuild warning due to dead code in assets virtual module
270+
271+
- [#15127](https://github.com/withastro/astro/pull/15127) [`2cff904`](https://github.com/withastro/astro/commit/2cff9045256a2b551465750de7cba29087046658) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates "Unsupported page types found" error to only appear in more realistic cases
272+
273+
- [#15149](https://github.com/withastro/astro/pull/15149) [`34f84c2`](https://github.com/withastro/astro/commit/34f84c2437fd078e299a29eeb1f931c9f83c8d2e) Thanks [@rahuld109](https://github.com/rahuld109)! - Skips "Use the Image component" audit warning for images inside framework components (React, Vue, Svelte, etc.)
274+
275+
## 5.16.7
276+
277+
### Patch Changes
278+
279+
- [#15122](https://github.com/withastro/astro/pull/15122) [`b137946`](https://github.com/withastro/astro/commit/b1379466e8c6ded9fbcc3687c7faca4c2d3472b2) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Improves JSDoc annotations for `AstroGlobal`, `AstroSharedContext` and `APIContext` types
280+
281+
- [#15123](https://github.com/withastro/astro/pull/15123) [`3f58fa2`](https://github.com/withastro/astro/commit/3f58fa20540ee3753158d8d0372affa47775c561) Thanks [@43081j](https://github.com/43081j)! - Improves rendering performance by grouping render chunks when emitting from async iterables to avoid encoding costs
282+
283+
- [#14954](https://github.com/withastro/astro/pull/14954) [`7bec4bd`](https://github.com/withastro/astro/commit/7bec4bdadda1d66da1c7dc0a01ad4412a47337d9) Thanks [@volpeon](https://github.com/volpeon)! - Fixes remote images `Etag` header handling by disabling internal cache
284+
285+
- [#15052](https://github.com/withastro/astro/pull/15052) [`b2bcd5a`](https://github.com/withastro/astro/commit/b2bcd5af28dfb75541f3249b0277b458355395cf) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes images not working in development when using setups with port forwarding
286+
287+
- [#15028](https://github.com/withastro/astro/pull/15028) [`87b19b8`](https://github.com/withastro/astro/commit/87b19b8df49d08ee7a7a1855f3645fe7bebf1997) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes certain aliases not working when using images in JSON files with the content layer
288+
289+
- [#15118](https://github.com/withastro/astro/pull/15118) [`cfa382b`](https://github.com/withastro/astro/commit/cfa382b7aa23a9f5a506181c75a0706595208396) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only**
290+
291+
Removes the `defineAstroFontProvider()` type helper.
292+
293+
If you are building a custom font provider, remove any occurrence of `defineAstroFontProvider()` and use the `FontProvider` type instead:
294+
295+
```diff
296+
-import { defineAstroFontProvider } from 'astro/config';
297+
298+
-export function myProvider() {
299+
- return defineAstroFontProvider({
300+
- entrypoint: new URL('./implementation.js', import.meta.url)
301+
- });
302+
-};
303+
304+
+import type { FontProvider } from 'astro';
305+
306+
+export function myProvider(): FontProvider {
307+
+ return {
308+
+ entrypoint: new URL('./implementation.js', import.meta.url)
309+
+ },
310+
+}
311+
```
312+
313+
- [#15055](https://github.com/withastro/astro/pull/15055) [`4e28db8`](https://github.com/withastro/astro/commit/4e28db8d125b693039b393111fa48d7bcc913968) Thanks [@delucis](https://github.com/delucis)! - Reduces Astro’s install size by around 8 MB
314+
315+
- [#15088](https://github.com/withastro/astro/pull/15088) [`a19140f`](https://github.com/withastro/astro/commit/a19140fd11efbc635a391d176da54b0dc5e4a99c) Thanks [@martrapp](https://github.com/martrapp)! - Enables the ClientRouter to preserve the original hash part of the target URL during server side redirects.
316+
317+
- [#15117](https://github.com/withastro/astro/pull/15117) [`b1e8e32`](https://github.com/withastro/astro/commit/b1e8e32670ba601d3b3150514173dd7d1bb25650) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only**
318+
319+
Changes the font format downloaded by default when using the experimental Fonts API. Additionally, adds a new `formats` configuration option to specify which font formats to download.
320+
321+
Previously, Astro was opinionated about which font sources would be kept for usage, mainly keeping `woff2` and `woff` files.
322+
323+
You can now specify what font formats should be downloaded (if available). Only `woff2` files are downloaded by default.
324+
325+
#### What should I do?
326+
327+
If you were previously relying on Astro downloading the `woff` format, you will now need to specify this explicitly with the new `formats` configuration option. Additionally, you may also specify any additional file formats to download if available:
328+
329+
```diff
330+
// astro.config.mjs
331+
import { defineConfig, fontProviders } from 'astro/config'
332+
333+
export default defineConfig({
334+
experimental: {
335+
fonts: [{
336+
name: 'Roboto',
337+
cssVariable: '--font-roboto',
338+
provider: fontProviders.google(),
339+
+ formats: ['woff2', 'woff', 'otf']
340+
}]
341+
}
342+
})
343+
```
344+
345+
- [#15034](https://github.com/withastro/astro/pull/15034) [`8115752`](https://github.com/withastro/astro/commit/811575237d159ceac5d9f0a2ea3bf023df718759) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a vite warning log during builds when using npm
346+
261347
## 5.16.6
262348

263349
### Patch Changes

packages/astro/e2e/dev-toolbar-audits.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,23 @@ test.describe('Dev Toolbar - Audits', () => {
102102
expect(auditHighlights).toHaveCount(1);
103103
});
104104

105+
test('does not warn about image inside framework component', async ({ page, astro }) => {
106+
await page.goto(astro.resolveUrl('/audits-perf-framework'));
107+
108+
const toolbar = page.locator('astro-dev-toolbar');
109+
const appButton = toolbar.locator('button[data-app-id="astro:audit"]');
110+
await appButton.click();
111+
112+
const auditCanvas = toolbar.locator('astro-dev-toolbar-app-canvas[data-app-id="astro:audit"]');
113+
const auditHighlights = auditCanvas.locator('astro-dev-toolbar-highlight');
114+
115+
// Should only warn about the raw <img>, not the one inside the Preact component
116+
await expect(auditHighlights).toHaveCount(1);
117+
118+
const auditCode = await auditHighlights.first().getAttribute('data-audit-code');
119+
expect(auditCode).toBe('perf-use-image-component');
120+
});
121+
105122
test('can handle mutations', async ({ page, astro }) => {
106123
await page.goto(astro.resolveUrl('/audits-mutations'));
107124

22.3 KB
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function ImageComponent() {
2+
// This image is >20KB and would normally trigger the "Use Image component" audit
3+
return <img src="/the-future.jpg" alt="The future" />;
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
import { ImageComponent } from '../components/ImageComponent';
3+
---
4+
5+
<!-- Image inside a framework component should NOT trigger the audit -->
6+
<ImageComponent client:load />
7+
8+
<!-- Raw img tag should still trigger the audit -->
9+
<img src="/the-future.jpg" alt="The future" />

packages/astro/e2e/view-transitions.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ test.describe('View Transitions', () => {
127127

128128
// Go to page 3 which does *not* have ClientRouter enabled
129129
await page.click('#click-three');
130+
// Mainly for Firefox on Windows. Wait for navigation to complete.
131+
// Other tests like wait for URL or networkidle did not work effectively.
132+
await page.waitForTimeout(500);
133+
130134
p = page.locator('#three');
131135
await expect(p, 'should have content').toHaveText('Page 3');
132136

@@ -181,6 +185,9 @@ test.describe('View Transitions', () => {
181185

182186
// Back to page 1
183187
await page.goBack();
188+
// Mainly for Firefox on Windows. Wait for navigation to complete.
189+
// Other tests like wait for URL or networkidle did not work effectively.
190+
await page.waitForTimeout(1000);
184191
p = page.locator('#one');
185192
await expect(p, 'should have content').toHaveText('Page 1');
186193
expect(
@@ -1233,6 +1240,8 @@ test.describe('View Transitions', () => {
12331240

12341241
// Submit the form
12351242
await page.click('#submit');
1243+
const span = page.locator('#contact-name');
1244+
await expect(span, 'should have content').toHaveText('Testing');
12361245

12371246
expect(
12381247
loads.length,
@@ -1268,6 +1277,8 @@ test.describe('View Transitions', () => {
12681277

12691278
// Submit the form
12701279
await page.click('#submit');
1280+
const span = page.locator('#contact-name');
1281+
await expect(span, 'should have content').toHaveText('Testing');
12711282

12721283
expect(
12731284
loads.length,

0 commit comments

Comments
 (0)