0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
Commit graph

3250 commits

Author SHA1 Message Date
Piotr Losiak
ec7d2ebbd9
fix(sitemap): url when rest parameter is used in page file names (#9975)
* fix(sitemap): url when rest parameter is used in page file names

* Update .changeset/sour-ties-sparkle.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* Apply suggestions from code review

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-02-21 07:43:22 +00:00
Emanuele Stoppa
a46249173e
fix(i18n): move transformation outside the user schema (#10169)
* fix(i18n): move transformation outside the user schema

* fix condition

* cleanup

* ops

* fix regression
2024-02-21 07:42:06 +00:00
Houston (Bot)
052d3271d4
[ci] release (#10131)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-20 20:18:30 +05:30
Arsh
5acc3135ba
refactor: pipeline lifetime (#9795)
* Base Environment

* SSRRoutePipeline -> AppEnvironment

* BuildPipeline -> BuildEnvironment

* DevPipeline -> DevEnvironment

* per-request pipeline

* internal middleware: i18n

* delete callEndpoint

* pipeline access for internal middleware

* Address review comments

`environment.ts` is now lives directly in `src/core`, rather than `src/core/render`.

`environment.createPipeline` is removed. `Pipeline.create` is used instead.

Constructors with positional arguments are replaced by `Environment.create` with named arguments.

Clarifies the use of `HiddenPipeline`.

* migrate some of `RenderContext`'s responsibilities to `Pipeline`

* delete renderPage

* RenderContext.params -> Pipeline.params

* delete `RenderContext`

* `Pipeline` -> `RenderContext`

* `Environment` -> `Pipeline`

* `AppEnvironment` -> `AppPipeline`

* `BuildEnvironment` -> `BuildPipeline`

* `DevEnvironment` -> `DevPipeline`

* provide locals directly to renderContext

* add changeset
2024-02-20 20:10:13 +05:30
ktym4a
80f8996514
Fix to get Integration Data even when a page is transitioned by ViewTransition (#10079)
* Fix to get Integration Data even when a page is transitioned by ViewTransition.

* add test case

* add changeset

* fix test

* Fix typo
2024-02-20 14:09:20 +01:00
Ming-jun Lu
b92d35f102
Fix an issue where audit fails to initialize when encountered <a> inside <svg> (#10163)
* Fix an issue where audit fails to initialize when encountered `<a>` inside `<svg>`

* Add changeset
2024-02-20 11:22:05 +01:00
Emanuele Stoppa
d50dddb71d
fix(i18n): make i18n.routing fields optional (#10165)
* fix(i18n): make `i18n.routing` fields optional

* update user config

* Update packages/astro/src/core/config/schema.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

---------

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2024-02-20 10:17:40 +00:00
ktym4a
9b78c99275
Add option to prefix sitemap (#9846)
* Add option to prefix sitemap

* Fix call resolve twice

* let to const

* Apply suggestions from code review

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* change changeset patch to minor

* use node:test

* Update changeset

* Add regex validation for prefix

* Update .changeset/eighty-falcons-tease.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update prefix regex in SitemapOptionsSchema

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-02-20 08:36:09 +00:00
Bjorn Lu
3c73441eb2
Fix Astro HMR style-only change detection (#10139) 2024-02-19 21:56:13 +08:00
Bjorn Lu
1da9c5f2f3
Remove server-destroy dependency (#10132) 2024-02-15 22:59:03 +08:00
Mohamed
1f598b3724
fix(cli): load polyfill before loading config during astro add (#10105)
* Adds crypto import to Vercel adapter

* Update the 'crypto' import to 'node:crypto'

* load polyfills before loading config

* add changeset

* load polyfills for `astro info`, `astro preferences` etc

* update changeset

* clarify impact

---------

Co-authored-by: lilnasy <69170106+lilnasy@users.noreply.github.com>
2024-02-15 07:42:03 -07:00
Houston (Bot)
141f2fb757
[ci] release (#10109)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-15 12:00:03 +01:00
Oliver Speir
91f75afbc6
Add inferSize to getImage so width and height are optional for remote images (#9976)
* add remote image dimension probing, and param for getImage options, and new astro error

* add inferSize parameter to getImage, which probes remote image size, and respective types to picture and image component

* add fixture and tests

* add changeset

* attempt to fix pnpm-lock.yaml

* fix pnpm-lock.yaml again

* pnpm-lock spacing

* fix pnpm-lock AGAIN

* better description of error for docgen

* improve failed to probe error message and correct required dimensions error

* increase timeout for mdx tests

* increasing mdx timeout to 2min to see if it passes, will reduce if it does

* setting mdx timeout to 70 seconds

* Update packages/astro/src/assets/services/service.ts

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

* refactor to move logic to getImage instead of validateOptions and  to not add a third type to image and picture

* fix broken link created by docs PR

* remove the probe-image-size library due to its use of node APIs

* undo all changes to service.ts that were left  after moving inferSize logic to getImage

* update error message

* remove probe-image-size library all together, update error message, add vendored version of complete image-size library instead of refactored version

* Update .changeset/tame-cameras-change.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/tame-cameras-change.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* reword the error message based on Sarah's previous review

* remove probe-image-size from pnpmlock

* fix lockfile?

* update error message name

* move image-size into vendor folder

* add eslint ignore to a line in image-size

* test if change to mdx test timeout was needed

* Update .changeset/tame-cameras-change.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* update changset syntax

* patch parse heif to account for filetype block being out of order

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-02-15 10:24:03 +01:00
Bjorn Lu
787e6f5247
Update to Vite 5.1 (#10120) 2024-02-15 17:20:38 +08:00
Arsh
4bcc249a9f
fix(dev): preload matched routes sequentially (#10116)
* fix(dev): preload matched routes sequentially

* add changeset
2024-02-14 17:27:53 -05:00
Hippo
51b6ff7403
Fix invalid URLs being returned from getRegistry, synchronize all copies (#10117) 2024-02-14 17:27:18 -05:00
Erika
476b79a611
Rename Astro app to astro:home (#10112)
* Rename Astro app to astro:home

* Create silent-hotels-approve.md

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-02-14 16:37:37 +01:00
Matthew Phillips
d469bebd7b
Improve Node.js performance using an AsyncIterable (#9614)
* Improve Node.js performance using an AsyncIterable

* Oops

* Get rid of extra abstraction

* Update .changeset/hip-cherries-behave.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* Check if already resolved

* Resolve on done

* Get rid of unneeded "done"

* Done when length is zero

* Let errors resolve

* Update packages/astro/src/runtime/server/render/astro/render.ts

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Move doctype to top-level

* Document the new function

* Update .changeset/hip-cherries-behave.md

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Update .changeset/hip-cherries-behave.md

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-02-14 10:14:05 -05:00
Martin Trapp
b340f8fe3a
Re-encode view-transition-names (#10099)
* Fixes an issue with view transition names containing spaces or punctuation.

* reworked, more robust approach

* better readability and also escapes the escape character (_)

* update changeset

* add comemnts to describe the re-encoding

* updated changeset

* typos

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* simplify decoding it ever required.

* better coverage and now also checks animation behavior

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-02-14 14:07:31 +00:00
Erika
7443929381
feat(audits): Add UI with list of audits (#10074)
* feat(audits): Add UI with list of audits

* style: slightly better UI

* requested design changes

* chore: changeset

* add test

* remove unwanted file
2024-02-14 14:46:36 +01:00
Erika
6884b103c8
feat(audits): Add initial perf audits (#10015)
* feat(audits): Add initial perf audits

* feat(audits): Setup dev astro-island

* fix(audits): Don't take scroll into account when getting an element's position

* nit: lint

* Fix tests

* chore: changeset

* maybe: Move this.hydrator outside the perf check

* Update packages/astro/e2e/dev-toolbar.test.js

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* address feedback

* address feedback

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-02-14 14:01:53 +01:00
Ben Holmes
748b2e87cd
Refine content collection warnings (#10001)
* feat: remove nonexistent collection warning

* fix: remove markdown syntax from console.warn

* fix: respect configured collections in types when dir is missing

* chore: changeset

* chore: revert test schema

* docs: "Removes"

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

---------

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2024-02-14 10:09:31 +00:00
Luiz Ferraz
227cd83a51
Fixes regression on routing priority for multi-layer index pages (#10096)
* Reproduce regression

* Simplify sorting algorithm

* Add changeset

* Fix changeset typo

* Rename assertion utility function

* Fix index detection

* Add changeset for index fix

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-02-14 10:06:38 +00:00
Houston (Bot)
e24db1d8a6
[ci] release (#10092)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-13 14:25:59 -07:00
Arsh
71273edbb4
qol(islands): improve hydration errors (#10075)
* improve error messages for island hydration

* add changeset

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-13 10:28:28 -07:00
YS.Y
73bd900754
Fixes audit when multiple role values exist. (#9857)
* fix: Fixing the issue of errors caused by multiple values in the role, when multiple roles exist, check each role.

fix #9856

* Update .changeset/eight-flowers-remain.md

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-13 11:27:33 -06:00
Florian Lefebvre
2ffc5721bc
fix(vercel): trailing slash conflict (#10082) 2024-02-13 11:36:22 +00:00
Ming-jun Lu
d9266c4467
Fix an issue where ReadableStream wasn't canceled in dev mode (#9971)
* Fix an issue where ReadableStream wasn't canceled in dev mode

* Add changeset

* add test

---------

Co-authored-by: lilnasy <69170106+lilnasy@users.noreply.github.com>
2024-02-13 11:28:14 +00:00
Arsh
8106178043
qol(routing): improve endpoint error message (#10072)
* Clarify error messages in endpoint routing.

* add changeset
2024-02-12 20:55:46 +05:30
Houston (Bot)
7371e1b5fc
[ci] release (#10029)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-12 14:25:50 +00:00
Marawan Mohamed
dac759798c
Fix and update shikiji core (#10063)
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-02-12 21:26:25 +08:00
Arsh
1810309e65
fix(integration api): improve module resolution (#10060)
* fix(integration api): improve module resolution

* add changeset
2024-02-09 08:22:04 -07:00
Emanuele Stoppa
989ea63bb2
fix(i18n): regression where emitted URLs had // (#10067)
* fix(i18n): regression

* fix(i18n): regression

* fix bug regression

* remove double changeset
2024-02-09 14:58:09 +00:00
Erika
14ce8a6ebf
feat(markdoc): Add support for using a custom component for images (#9958)
* feat(markdoc): Add support for using a custom component for images

* chore: changeset

* test: add test

* Update .changeset/shaggy-spies-sit.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-02-08 07:54:40 +01:00
ktym4a
8fb67c81bb
Change view transitions rule (#9991)
* WIP: change view transitions rule

* Apply suggestions from code review

Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>

* add changeset

* Apply suggestions from code review

Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>

---------

Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
2024-02-07 23:49:10 +01:00
Houston (Bot)
ef00224a86
[ci] release (#10018)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-07 23:55:29 +05:30
Arsh
3fc76efb2a
fix(astro:content): include required type declarations (#10022)
* include types/content.d.ts

* add changeset

* Update .changeset/cool-walls-fail.md

Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-07 23:48:09 +05:30
StandardGage
20ca3154fb
Fix Issues with passing void elements to React with experimentalReactChildren flag set (#9849)
* Create simple react element if element has no children

* Fix for when element has text

* add changeset

* minor -> patch

---------

Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-07 23:38:44 +05:30
Arsh
0699f34d5c
feat(vercel): middleware verification (#9987)
* feat(vercel): verification for edge middleware

* add changeset

* Apply suggestions from code review

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-07 21:39:39 +05:30
Emanuele Stoppa
037e4f12dd
fix(i18n): don't consider URLs that start with the name of the defaut locale (#10016) 2024-02-07 14:42:51 +00:00
Houston (Bot)
fa9218e836
[ci] release (#10014)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-07 15:38:45 +01:00
Chris Swithinbank
e6b5306a7d
Move astro:content types declaration to manual ambient module (#10013)
* Move `astro:content` types declaration to manual ambient module

* Add changeset

---------

Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2024-02-07 13:58:11 +00:00
Arsh
e2fe51c828
feat(vercel): ISR (#9714)
* feat(vercel): isr

* bypass token

* exclusion of certain paths

* add test

* remove search params in dev mode

* Apply suggestions from code review

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* fix missing await

* escape src for regex

* cleanup

* revalidate -> expiration

* update type docs

* always exclude /_image

* add changeset

* Apply suggestions from code review

* always create serverless function for /_image

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Apply suggestions from code review

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-02-07 19:06:37 +05:30
Ben Holmes
ce4283331f
Fix: support strict() on content collection schemas when slug is present (#10003)
* fix: use correct data object when parsing schema

* feat(test): add `strict()` to slug schema test

* chore: changeset

* docs: "Adds support for"

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

---------

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2024-02-07 07:26:16 -05:00
Houston (Bot)
e4999083bf
[ci] release (#9973)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-06 16:28:12 +00:00
Emanuele Stoppa
18ac0940ea
fix(i18n): fix regression in current locale (#9998)
* fix(i18n): fix regression in current locale

* Update .changeset/shy-wolves-ring.md

* Update packages/astro/test/i18n-routing.test.js

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* Update .changeset/six-fishes-beg.md

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* fix test case

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-02-06 16:13:15 +00:00
Happydev
c53a31321a
Revert "fix(compiler): Support dynamic slot names (#9605)" (#9999)
* Revert "fix(compiler): Support dynamic slot names (#9605)"

This reverts commit 8ce40a417c.

* chore: changeset

* Update .changeset/weak-pans-sit.md

* chore: bump compiler version

* fix failing test

We were expecting the source code to produce an error, but in
2.4.0 of the compiler, that generates valid code

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-02-06 16:44:02 +01:00
Matthew Phillips
81acac24a3
Fix HMR in MDX deps in Content Collections (#9956)
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2024-02-06 22:56:22 +08:00
Florian Lefebvre
3c0876cbed
feat(astro): improve astro:content types (#9906)
* feat: improve stro:content types

* fix: do not change tsconfig

* "astro/zod" -> "zod"

* `CollectionConfig` parameter extends `BaseSchema`

* fix: update import to zod

* feat: add fallbacks for every export

* Update .changeset/young-bulldogs-tickle.md

---------

Co-authored-by: lilnasy <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-05 11:53:18 -06:00
Marco Campos
8b8f26fdf2
FIX: allow rss feeds to have an enclosure with length of 0 (#9967)
* fix: allow rss feeds to have an enclosure with length of 0

* chore: add changeset

* fix: typo on test

* fix: update changeset description

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-02-04 20:42:26 +01:00