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

8623 commits

Author SHA1 Message Date
Bjorn Lu
7adb350a37
Prevent throwing in react and solid component checks (#11624) 2024-08-09 20:01:25 +08:00
Bjorn Lu
cc405dd1fe
Simplify eslint and pnpm config (#11646) 2024-08-09 00:14:39 +08:00
Ben Holmes
13b912a870
Actions: fix missing orThrow type when input is omitted (#11658)
* fix: orThrow missing when input is omitted

* chore: changeset
2024-08-08 11:53:33 -04:00
Florian Lefebvre
a851021498 [ci] format 2024-08-08 12:35:46 +00:00
Florian Lefebvre
32be5494f6
chore: improve astro:env docs (#11653)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-08-08 14:34:55 +02:00
Houston (Bot)
6b99523c3f
[ci] release (#11602)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-08 07:52:00 -04:00
Ben Holmes
589d35158d
Actions: remove "action used with get" error (#11648)
* fix: remove "action used with get" error

* chore: remove unused import

* fix(test): does not throw on GET

* chore: changeset
2024-08-08 07:43:25 -04:00
Erika
07b4ade25f
chore: add formatting commit to blame ignore (#11651) 2024-08-08 12:14:37 +02:00
Darius
72c7ae9901
update formatter config (#11640)
* update formatter config

* format

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-08-08 12:12:50 +02:00
Josh Goldberg ✨
85de47cd98 [ci] format 2024-08-08 09:54:55 +00:00
Josh Goldberg ✨
4c1b769bcf
chore: bump typescript-eslint to v8 (#11649) 2024-08-08 17:54:04 +08:00
Matthew Lee
9aaf58c133
Consistent file hashes (#11628)
* Fix css plugin having inconsistent builds in different environments

Astro's css plugin generates chunk ids that include a hash of all of
the chunk's parent ids.  These ids are currently the absolute file paths
of the parent files.  The generated chunk ids are then inserted into
those pages as import statements.

Because these import statements include a hash based on these absolute
file paths, this causes rollup to generate different hashes for those
pages when a build is run in different environments.  The exact same
project will produce identical assets with different filenames when
built on different machines, or when built from different directories
on the same machine, etc.

To fix this, I've stripped out the working directory of these file paths
before they are added to the hash.  This means that the hash will still
change if the files referencing it chacnge (which I believe is the
intended behavior), but will be stable if the entire project is built
in different environments.

* add changeset

* fixup! use settings.config.root and vite's normalizePath

I've chosen to update the function signature of shortHashedName
to match createSlugger's, so it now accepts the settings object
and returns the actual hashing function.  This way, createSlugger's
function signature doesn't need to update to needlessly accept
an additional argument.

* fixup! remove unused import

* Update .changeset/young-pillows-shave.md

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

* fixup! use fileURLtoPath

---------

Co-authored-by: Matt Lee <mdlee.md@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-08-07 15:55:27 +01:00
Bjorn Lu
ca45fd93c1
Remove tsconfig-resolver from repo (#11642) 2024-08-07 20:10:20 +08:00
Bjorn Lu
ea82b03cd6
Improve regex performance (#11635) 2024-08-07 16:01:23 +08:00
Bjorn Lu
74a093056d [ci] format 2024-08-07 02:42:23 +00:00
Bjorn Lu
c8fe46d562
Remove #astro/* subpath imports (#11636) 2024-08-07 10:41:35 +08:00
Ben Holmes
2716f52aae
Actions: fix 500 on empty object for Vercel serverless (#11634)
* fix: only set content-type when body is defined

* feat(test): content-type is omitted

* chore: changeset
2024-08-06 11:54:42 -04:00
Bjorn Lu
bbd8bfda92
Update changeset base branch (#11632) 2024-08-06 12:51:25 +02:00
Princesseuh
a7dba90e30
chore: enter pre mode 2024-08-06 11:32:54 +02:00
Emanuele Stoppa
b6fbdaa94a
fix(cli): hardcoded supported Node.js version (#10742)
* fix(cli): hardcoded supported Node.js version

* Create chatty-teachers-sit.md

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-08-06 11:23:22 +02:00
Ben Holmes
d532df1222 [ci] format 2024-08-05 12:23:26 +00:00
Ben Holmes
81d7150e02
Actions: Add devalue for serializing complex values (#11593)
* wip: move getActionResult setup to render

* feat: serialize action data for edge

* refactor: serializeActionResult util

* feat: introduce devalue for body parsing

* refactor: orthrow -> main

* feat(test): Date and Set

* refactor: move getAction to separate file for bundling

* docs: changeset

* Revert "refactor: move getAction to separate file for bundling"

This reverts commit ef2b40991f90ff64c063cb4364eb2affcb2328c3.

* Revert "Revert "refactor: move getAction to separate file for bundling""

This reverts commit 40deaeda1dd350b27fa3da994a7c37005ae7a187.

* fix: actions import from client

* feat: add support for URL objects

* refactor: new isActionError utility

* refactor: reuse isInputError in fromJson

* fix: use INTERNAL_SERVER_ERROR for unknown errors
2024-08-05 08:22:38 -04:00
Jeff R
3f27c9d934 [ci] format 2024-08-05 11:30:59 +00:00
Jeff R
6e5676862b
sort newest to oldest (#11587)
* sort newest to oldest

* Update pubDate to preserve a meaningful order in the examples/blog folder
2024-08-05 13:30:06 +02:00
Abu Bakr
196092ae69
fix: audit incorrectly flagging images as above the fold (#10891) (#11617)
* fix: audit incorrectly flagging images as above the fold (#10891)

Previously used lement.offsetTop to find the y position of the image, which does not work when the element parent has a position: relative property.
Instead, this uses lement.getBoundingClientRect().y top get real y position of the image.
There's one issue though, which is that getBoundingClientRect returns the position relative to the user's viewport, not the absolute position.
So, add window.scrollY to the value to cancel that effect out, and you have the element's absolute position.

https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY

* chore: add changeset
2024-08-05 13:29:20 +02:00
renovate[bot]
da86d5459f
fix(deps): update all non-major dependencies (#11618)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 16:22:43 +08:00
renovate[bot]
bc2796436d
chore(deps): update dependency postcss-preset-env to v10 (#11619)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 10:06:00 +08:00
Armand Philippot
09ec2cadce
fix(astro:content): add deprecated to getEntryBySlug & getDataEntryById (#11600)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2024-08-02 16:31:32 +02:00
Sarah Rainsberger
1b3c81c684
[error docs] adds section heading for Actions (#11601) 2024-08-02 11:02:54 -03:00
Houston (Bot)
2abbc281b3
[ci] release (#11590)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-02 09:18:47 -04:00
Mateusz Ż
19adfaa705
chore: Remove unnecessary CSS in basic example (#11596) 2024-08-02 20:21:40 +08:00
Bjorn Lu
d052428e38 [ci] format 2024-08-02 12:20:29 +00:00
Bjorn Lu
69d54b4bf2
Remove more unused code (#11598) 2024-08-02 20:19:41 +08:00
Bjorn Lu
c2d6c1f727
Remove unused code (#11592) 2024-08-02 10:15:42 +08:00
Ben Holmes
ac72ed2f55 [ci] format 2024-08-01 12:25:19 +00:00
Ben Holmes
a65ffe314b
Actions: Remove async local storage dependency (#11584)
* refactor: move from Async local storage to .bind()

* feat: Astro.callAction for server calls

* feat(e2e): update server call

* feat(types): test callAction types

* fix: callAction context on rewrite

* feat: called from server error

* chore: remove store.ts file

* chore: remove getApiContext client stub

* chore: changeset

* fix: src -> dist import

* refactor: move content collection errors together

* fix: move rfc link to hint
2024-08-01 08:24:22 -04:00
Emanuele Stoppa
2531abdab2 [ci] format 2024-08-01 10:49:03 +00:00
Emanuele Stoppa
2e9d183361
fix: changelog formatting (#11589) 2024-08-01 11:48:14 +01:00
Houston (Bot)
4474887937
[ci] release (#11578)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-01 11:55:37 +02:00
Sarah Rainsberger
6aaeec5034
Update errors-data.ts for Astro.rewrite release in 4.13 (#11580)
* Update errors-data.ts

* chore: remove unused error

* deprecate the error instead

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-07-31 14:41:52 +01:00
renovate[bot]
750d5328c9
fix(deps): update all non-major dependencies (#11565)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-31 21:17:26 +08:00
Emanuele Stoppa
45ad326932
feat: stabilise the rewrite APIs (#11542)
* feat: stabilise the rewrite APIs

* chore: rewrite changeset

* oops

* Apply suggestions from code review

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

* chore: fix linting

* fix: update exemple

* code formatting

* edit changeset code examples

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-07-31 12:51:13 +02:00
Emanuele Stoppa
a62345fd18
feat: log slow pages in red (#11507)
* fix: log slow pages in red

* apply feedback

* chore: update based on feedback

* Update .changeset/spotty-rice-shake.md

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

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-07-31 12:37:08 +02:00
Alexander Niebuhr
2cf770d759 [ci] format 2024-07-31 10:18:28 +00:00
Alexander Niebuhr
e5e2d3ed30
chore: unflag contentCollectionJsonSchema (#11379)
* chore: unflag contentCollectionJsonSchema

* chore: improve json schema generation

* remove config option

* Update tasty-spoons-double.md

* Update tasty-spoons-double.md

* Update .changeset/tasty-spoons-double.md

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

* Update .changeset/tasty-spoons-double.md

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

* Update .changeset/tasty-spoons-double.md

* revert whitespace changes

* revert whitespace changes

* revert whitespace changes

* revert whitespace changes

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-07-31 12:17:38 +02:00
Matthew Phillips
60b2766edb
Verify you can use server:defer on self-imported module (#11577) 2024-07-30 15:48:30 -04:00
Houston (Bot)
49db00444e
[ci] release (#11524)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-30 11:54:54 -04:00
Ben Holmes
9f766d8b58 [ci] format 2024-07-30 15:43:44 +00:00
Ben Holmes
1c3265a8c9
Actions: Make .safe() the default return value (#11571)
* feat: new orThrow types

* fix: parens on return type

* feat: switch implementation to orThrow()

* feat(e2e): update PostComment

* fix: remove callSafely from middleware

* fix: toString() for actions

* fix(e2e): more orThrow updates

* feat: remove progressive enhancement from orThrow

* fix: remove _astroActionSafe handler from react

* feat(e2e): update test to use safe calling

* chore: console log

* chore: unused import

* fix: add rewriting: true to test fixture

* fix: correctly throw for server-only actions

* chore: changeset

* fix: update type tests

* fix(test): remove .safe() chain

* docs: use "patch" with BREAKING CHANGE notice

* docs: clarify react integration in changeset
2024-07-30 11:42:52 -04:00
Ben Holmes
a77ed84759 [ci] format 2024-07-30 15:05:04 +00:00