mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
[ci] release (#11524)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
9f766d8b58
commit
49db00444e
50 changed files with 253 additions and 208 deletions
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Excludes hoisted scripts and styles from Astro components imported with `?url` or `?raw`
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Uses the correct pageSize default in `page.size` JSDoc comment
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'create-astro': patch
|
||||
---
|
||||
|
||||
Logs underlying error when a template cannot be downloaded
|
|
@ -1,29 +0,0 @@
|
|||
---
|
||||
'@astrojs/react': patch
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
**BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
|
||||
|
||||
Make `.safe()` the default return value for actions. This means `{ data, error }` will be returned when calling an action directly. If you prefer to get the data while allowing errors to throw, chain the `.orThrow()` modifier.
|
||||
|
||||
```ts
|
||||
import { actions } from 'astro:actions';
|
||||
|
||||
// Before
|
||||
const { data, error } = await actions.like.safe();
|
||||
// After
|
||||
const { data, error } = await actions.like();
|
||||
|
||||
// Before
|
||||
const newLikes = await actions.like();
|
||||
// After
|
||||
const newLikes = await actions.like.orThrow();
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
To migrate your existing action calls:
|
||||
|
||||
- Remove `.safe` from existing _safe_ action calls
|
||||
- Add `.orThrow` to existing _unsafe_ action calls
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Remove "SSR Only" mention in `Astro.redirect` inline documentation and update reference link.
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes a case where the build was failing when `experimental.actions` was enabled, an adapter was in use, and there were not actions inside the user code base.
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes line with the error not being properly highlighted in the error overlay
|
|
@ -1,53 +0,0 @@
|
|||
---
|
||||
'@astrojs/react': patch
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
**BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
|
||||
|
||||
Updates the Astro Actions fallback to support `action={actions.name}` instead of using `getActionProps().` This will submit a form to the server in zero-JS scenarios using a search parameter:
|
||||
|
||||
```astro
|
||||
---
|
||||
import { actions } from 'astro:actions';
|
||||
---
|
||||
|
||||
<form action={actions.logOut}>
|
||||
<!--output: action="?_astroAction=logOut"-->
|
||||
<button>Log Out</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
You may also construct form action URLs using string concatenation, or by using the `URL()` constructor, with the an action's `.queryString` property:
|
||||
|
||||
```astro
|
||||
---
|
||||
import { actions } from 'astro:actions';
|
||||
|
||||
const confirmationUrl = new URL('/confirmation', Astro.url);
|
||||
confirmationUrl.search = actions.queryString;
|
||||
---
|
||||
|
||||
<form method="POST" action={confirmationUrl.pathname}>
|
||||
<button>Submit</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
`getActionProps()` is now deprecated. To use the new fallback pattern, remove the `getActionProps()` input from your form and pass your action function to the form `action` attribute:
|
||||
|
||||
```diff
|
||||
---
|
||||
import {
|
||||
actions,
|
||||
- getActionProps,
|
||||
} from 'astro:actions';
|
||||
---
|
||||
|
||||
+ <form method="POST" action={actions.logOut}>
|
||||
- <form method="POST">
|
||||
- <input {...getActionProps(actions.logOut)} />
|
||||
<button>Log Out</button>
|
||||
</form>
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Allows actions to return falsy values without an error
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes an issue in content collection caching, where two documents with the same contents were generating an error during the build.
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes `astro add` for packages with only prerelease versions
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes DomException errors not being handled properly
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix server islands with trailingSlash: always
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
"@astrojs/mdx": "^3.1.3",
|
||||
"@astrojs/rss": "^4.0.7",
|
||||
"@astrojs/sitemap": "^3.1.6",
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
],
|
||||
"scripts": {},
|
||||
"devDependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.0.0"
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2",
|
||||
"@astrojs/react": "^3.6.0",
|
||||
"astro": "^4.12.3",
|
||||
"@astrojs/react": "^3.6.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"vitest": "^2.0.3"
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
"@astrojs/alpinejs": "^0.4.0",
|
||||
"@types/alpinejs": "^3.13.10",
|
||||
"alpinejs": "^3.14.1",
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/lit": "^4.3.0",
|
||||
"@webcomponents/template-shadowroot": "^0.2.1",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"lit": "^3.1.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.1",
|
||||
"@astrojs/react": "^3.6.0",
|
||||
"@astrojs/react": "^3.6.1",
|
||||
"@astrojs/solid-js": "^4.4.0",
|
||||
"@astrojs/svelte": "^5.7.0",
|
||||
"@astrojs/vue": "^4.5.0",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"preact": "^10.22.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.1",
|
||||
"@preact/signals": "^1.3.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"preact": "^10.22.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/react": "^3.6.0",
|
||||
"@astrojs/react": "^3.6.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/solid-js": "^4.4.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"solid-js": "^1.8.18"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/svelte": "^5.7.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"svelte": "^4.2.18"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/vue": "^4.5.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"vue": "^3.4.33"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^8.3.2",
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
],
|
||||
"scripts": {},
|
||||
"devDependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.0.0"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^8.3.2",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"html-minifier": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/node": "^8.3.2",
|
||||
"@astrojs/react": "^3.6.0",
|
||||
"@astrojs/react": "^3.6.1",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@fortawesome/fontawesome-free": "^6.6.0",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"postcss": "^8.4.39",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/node": "^8.3.2",
|
||||
"@astrojs/svelte": "^5.7.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"svelte": "^4.2.18"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"sass": "^1.77.8",
|
||||
"sharp": "^0.33.3"
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
"./app": "./dist/app.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
"devDependencies": {
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@astrojs/node": "^8.3.2",
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdoc": "^0.11.3",
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdown-remark": "^5.2.0",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"hast-util-select": "^6.0.2",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^4.12.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/mdx": "^3.1.3",
|
||||
"@astrojs/preact": "^3.5.1",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"preact": "^10.22.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.1",
|
||||
"@nanostores/preact": "^0.5.1",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"nanostores": "^0.10.3",
|
||||
"preact": "^10.22.1"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@astrojs/mdx": "^3.1.3",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@types/canvas-confetti": "^1.6.4",
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"canvas-confetti": "^1.9.3",
|
||||
"postcss": "^8.4.39",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"test": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.12.2",
|
||||
"astro": "^4.12.3",
|
||||
"vitest": "^2.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,103 @@
|
|||
# astro
|
||||
|
||||
## 4.12.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#11509](https://github.com/withastro/astro/pull/11509) [`dfbca06`](https://github.com/withastro/astro/commit/dfbca06dda674c64c7010db2f4de951496a1e631) Thanks [@bluwy](https://github.com/bluwy)! - Excludes hoisted scripts and styles from Astro components imported with `?url` or `?raw`
|
||||
|
||||
- [#11561](https://github.com/withastro/astro/pull/11561) [`904f1e5`](https://github.com/withastro/astro/commit/904f1e535aeb7a14ba7ce07c3130e25f3e708266) Thanks [@ArmandPhilippot](https://github.com/ArmandPhilippot)! - Uses the correct pageSize default in `page.size` JSDoc comment
|
||||
|
||||
- [#11571](https://github.com/withastro/astro/pull/11571) [`1c3265a`](https://github.com/withastro/astro/commit/1c3265a8c9c0b1b1bd597f756b63463146bacc3a) Thanks [@bholmesdev](https://github.com/bholmesdev)! - **BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
|
||||
|
||||
Make `.safe()` the default return value for actions. This means `{ data, error }` will be returned when calling an action directly. If you prefer to get the data while allowing errors to throw, chain the `.orThrow()` modifier.
|
||||
|
||||
```ts
|
||||
import { actions } from 'astro:actions';
|
||||
|
||||
// Before
|
||||
const { data, error } = await actions.like.safe();
|
||||
// After
|
||||
const { data, error } = await actions.like();
|
||||
|
||||
// Before
|
||||
const newLikes = await actions.like();
|
||||
// After
|
||||
const newLikes = await actions.like.orThrow();
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
To migrate your existing action calls:
|
||||
|
||||
- Remove `.safe` from existing _safe_ action calls
|
||||
- Add `.orThrow` to existing _unsafe_ action calls
|
||||
|
||||
- [#11546](https://github.com/withastro/astro/pull/11546) [`7f26de9`](https://github.com/withastro/astro/commit/7f26de906e87f1e8973a1f84399f23e36e506bb3) Thanks [@ArmandPhilippot](https://github.com/ArmandPhilippot)! - Remove "SSR Only" mention in `Astro.redirect` inline documentation and update reference link.
|
||||
|
||||
- [#11525](https://github.com/withastro/astro/pull/11525) [`8068131`](https://github.com/withastro/astro/commit/80681318c6cb0f612fcb5188933fdd20a8f474a3) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a case where the build was failing when `experimental.actions` was enabled, an adapter was in use, and there were not actions inside the user code base.
|
||||
|
||||
- [#11574](https://github.com/withastro/astro/pull/11574) [`e3f29d4`](https://github.com/withastro/astro/commit/e3f29d416a2e0a0b5328ae1075b12575260dddfd) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes line with the error not being properly highlighted in the error overlay
|
||||
|
||||
- [#11570](https://github.com/withastro/astro/pull/11570) [`84189b6`](https://github.com/withastro/astro/commit/84189b6511dc2a14bcfe608696f56a64c2046f39) Thanks [@bholmesdev](https://github.com/bholmesdev)! - **BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
|
||||
|
||||
Updates the Astro Actions fallback to support `action={actions.name}` instead of using `getActionProps().` This will submit a form to the server in zero-JS scenarios using a search parameter:
|
||||
|
||||
```astro
|
||||
---
|
||||
import { actions } from 'astro:actions';
|
||||
---
|
||||
|
||||
<form action={actions.logOut}>
|
||||
<!--output: action="?_astroAction=logOut"-->
|
||||
<button>Log Out</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
You may also construct form action URLs using string concatenation, or by using the `URL()` constructor, with the an action's `.queryString` property:
|
||||
|
||||
```astro
|
||||
---
|
||||
import { actions } from 'astro:actions';
|
||||
|
||||
const confirmationUrl = new URL('/confirmation', Astro.url);
|
||||
confirmationUrl.search = actions.queryString;
|
||||
---
|
||||
|
||||
<form method="POST" action={confirmationUrl.pathname}>
|
||||
<button>Submit</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
`getActionProps()` is now deprecated. To use the new fallback pattern, remove the `getActionProps()` input from your form and pass your action function to the form `action` attribute:
|
||||
|
||||
```diff
|
||||
---
|
||||
import {
|
||||
actions,
|
||||
- getActionProps,
|
||||
} from 'astro:actions';
|
||||
---
|
||||
|
||||
+ <form method="POST" action={actions.logOut}>
|
||||
- <form method="POST">
|
||||
- <input {...getActionProps(actions.logOut)} />
|
||||
<button>Log Out</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
- [#11559](https://github.com/withastro/astro/pull/11559) [`1953dbb`](https://github.com/withastro/astro/commit/1953dbbd41d2d7803837601a9e192654f02275ef) Thanks [@bryanwood](https://github.com/bryanwood)! - Allows actions to return falsy values without an error
|
||||
|
||||
- [#11553](https://github.com/withastro/astro/pull/11553) [`02c85b5`](https://github.com/withastro/astro/commit/02c85b541241a07db45bf9e15717e111104898e5) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue in content collection caching, where two documents with the same contents were generating an error during the build.
|
||||
|
||||
- [#11548](https://github.com/withastro/astro/pull/11548) [`602c5bf`](https://github.com/withastro/astro/commit/602c5bf05de4fe5ec1ea97f8e10455485aceb05f) Thanks [@TheOtterlord](https://github.com/TheOtterlord)! - Fixes `astro add` for packages with only prerelease versions
|
||||
|
||||
- [#11566](https://github.com/withastro/astro/pull/11566) [`0dcef3a`](https://github.com/withastro/astro/commit/0dcef3ab171bd7f81c2f99e9366db3724aa7091b) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes DomException errors not being handled properly
|
||||
|
||||
- [#11529](https://github.com/withastro/astro/pull/11529) [`504c383`](https://github.com/withastro/astro/commit/504c383e20dfb5d8eb0825a70935f221b43577b2) Thanks [@matthewp](https://github.com/matthewp)! - Fix server islands with trailingSlash: always
|
||||
|
||||
## 4.12.2
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "astro",
|
||||
"version": "4.12.2",
|
||||
"version": "4.12.3",
|
||||
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
||||
"type": "module",
|
||||
"author": "withastro",
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# create-astro
|
||||
|
||||
## 4.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#11567](https://github.com/withastro/astro/pull/11567) [`d27cf6d`](https://github.com/withastro/astro/commit/d27cf6df7bd612642a1e8da5948333b00b70e8bd) Thanks [@ascorbic](https://github.com/ascorbic)! - Logs underlying error when a template cannot be downloaded
|
||||
|
||||
## 4.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "create-astro",
|
||||
"version": "4.8.0",
|
||||
"version": "4.8.1",
|
||||
"type": "module",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -1,5 +1,83 @@
|
|||
# @astrojs/react
|
||||
|
||||
## 3.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#11571](https://github.com/withastro/astro/pull/11571) [`1c3265a`](https://github.com/withastro/astro/commit/1c3265a8c9c0b1b1bd597f756b63463146bacc3a) Thanks [@bholmesdev](https://github.com/bholmesdev)! - **BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
|
||||
|
||||
Make `.safe()` the default return value for actions. This means `{ data, error }` will be returned when calling an action directly. If you prefer to get the data while allowing errors to throw, chain the `.orThrow()` modifier.
|
||||
|
||||
```ts
|
||||
import { actions } from 'astro:actions';
|
||||
|
||||
// Before
|
||||
const { data, error } = await actions.like.safe();
|
||||
// After
|
||||
const { data, error } = await actions.like();
|
||||
|
||||
// Before
|
||||
const newLikes = await actions.like();
|
||||
// After
|
||||
const newLikes = await actions.like.orThrow();
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
To migrate your existing action calls:
|
||||
|
||||
- Remove `.safe` from existing _safe_ action calls
|
||||
- Add `.orThrow` to existing _unsafe_ action calls
|
||||
|
||||
- [#11570](https://github.com/withastro/astro/pull/11570) [`84189b6`](https://github.com/withastro/astro/commit/84189b6511dc2a14bcfe608696f56a64c2046f39) Thanks [@bholmesdev](https://github.com/bholmesdev)! - **BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
|
||||
|
||||
Updates the Astro Actions fallback to support `action={actions.name}` instead of using `getActionProps().` This will submit a form to the server in zero-JS scenarios using a search parameter:
|
||||
|
||||
```astro
|
||||
---
|
||||
import { actions } from 'astro:actions';
|
||||
---
|
||||
|
||||
<form action={actions.logOut}>
|
||||
<!--output: action="?_astroAction=logOut"-->
|
||||
<button>Log Out</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
You may also construct form action URLs using string concatenation, or by using the `URL()` constructor, with the an action's `.queryString` property:
|
||||
|
||||
```astro
|
||||
---
|
||||
import { actions } from 'astro:actions';
|
||||
|
||||
const confirmationUrl = new URL('/confirmation', Astro.url);
|
||||
confirmationUrl.search = actions.queryString;
|
||||
---
|
||||
|
||||
<form method="POST" action={confirmationUrl.pathname}>
|
||||
<button>Submit</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
`getActionProps()` is now deprecated. To use the new fallback pattern, remove the `getActionProps()` input from your form and pass your action function to the form `action` attribute:
|
||||
|
||||
```diff
|
||||
---
|
||||
import {
|
||||
actions,
|
||||
- getActionProps,
|
||||
} from 'astro:actions';
|
||||
---
|
||||
|
||||
+ <form method="POST" action={actions.logOut}>
|
||||
- <form method="POST">
|
||||
- <input {...getActionProps(actions.logOut)} />
|
||||
<button>Log Out</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
## 3.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@astrojs/react",
|
||||
"description": "Use React components within Astro",
|
||||
"version": "3.6.0",
|
||||
"version": "3.6.1",
|
||||
"type": "module",
|
||||
"types": "./dist/index.d.ts",
|
||||
"author": "withastro",
|
||||
|
|
68
pnpm-lock.yaml
generated
68
pnpm-lock.yaml
generated
|
@ -128,7 +128,7 @@ importers:
|
|||
examples/basics:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/blog:
|
||||
|
@ -143,22 +143,22 @@ importers:
|
|||
specifier: ^3.1.6
|
||||
version: link:../../packages/integrations/sitemap
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/component:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/container-with-vitest:
|
||||
dependencies:
|
||||
'@astrojs/react':
|
||||
specifier: ^3.6.0
|
||||
specifier: ^3.6.1
|
||||
version: link:../../packages/integrations/react
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
react:
|
||||
specifier: ^18.3.1
|
||||
|
@ -189,7 +189,7 @@ importers:
|
|||
specifier: ^3.14.1
|
||||
version: 3.14.1
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/framework-lit:
|
||||
|
@ -201,7 +201,7 @@ importers:
|
|||
specifier: ^0.2.1
|
||||
version: 0.2.1
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
lit:
|
||||
specifier: ^3.1.4
|
||||
|
@ -213,7 +213,7 @@ importers:
|
|||
specifier: ^3.5.1
|
||||
version: link:../../packages/integrations/preact
|
||||
'@astrojs/react':
|
||||
specifier: ^3.6.0
|
||||
specifier: ^3.6.1
|
||||
version: link:../../packages/integrations/react
|
||||
'@astrojs/solid-js':
|
||||
specifier: ^4.4.0
|
||||
|
@ -231,7 +231,7 @@ importers:
|
|||
specifier: ^18.3.0
|
||||
version: 18.3.0
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.22.1
|
||||
|
@ -261,7 +261,7 @@ importers:
|
|||
specifier: ^1.3.0
|
||||
version: 1.3.0(preact@10.22.1)
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.22.1
|
||||
|
@ -270,7 +270,7 @@ importers:
|
|||
examples/framework-react:
|
||||
dependencies:
|
||||
'@astrojs/react':
|
||||
specifier: ^3.6.0
|
||||
specifier: ^3.6.1
|
||||
version: link:../../packages/integrations/react
|
||||
'@types/react':
|
||||
specifier: ^18.3.3
|
||||
|
@ -279,7 +279,7 @@ importers:
|
|||
specifier: ^18.3.0
|
||||
version: 18.3.0
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
react:
|
||||
specifier: ^18.3.1
|
||||
|
@ -294,7 +294,7 @@ importers:
|
|||
specifier: ^4.4.0
|
||||
version: link:../../packages/integrations/solid
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
solid-js:
|
||||
specifier: ^1.8.18
|
||||
|
@ -306,7 +306,7 @@ importers:
|
|||
specifier: ^5.7.0
|
||||
version: link:../../packages/integrations/svelte
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
svelte:
|
||||
specifier: ^4.2.18
|
||||
|
@ -318,7 +318,7 @@ importers:
|
|||
specifier: ^4.5.0
|
||||
version: link:../../packages/integrations/vue
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
vue:
|
||||
specifier: ^3.4.33
|
||||
|
@ -330,13 +330,13 @@ importers:
|
|||
specifier: ^8.3.2
|
||||
version: link:../../packages/integrations/node
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/integration:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/middleware:
|
||||
|
@ -345,7 +345,7 @@ importers:
|
|||
specifier: ^8.3.2
|
||||
version: link:../../packages/integrations/node
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
html-minifier:
|
||||
specifier: ^4.0.0
|
||||
|
@ -358,19 +358,19 @@ importers:
|
|||
examples/minimal:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/non-html-pages:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/portfolio:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/server-islands:
|
||||
|
@ -379,7 +379,7 @@ importers:
|
|||
specifier: ^8.3.2
|
||||
version: link:../../packages/integrations/node
|
||||
'@astrojs/react':
|
||||
specifier: ^3.6.0
|
||||
specifier: ^3.6.1
|
||||
version: link:../../packages/integrations/react
|
||||
'@astrojs/tailwind':
|
||||
specifier: ^5.1.0
|
||||
|
@ -397,7 +397,7 @@ importers:
|
|||
specifier: ^18.3.0
|
||||
version: 18.3.0
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
postcss:
|
||||
specifier: ^8.4.39
|
||||
|
@ -421,7 +421,7 @@ importers:
|
|||
specifier: ^5.7.0
|
||||
version: link:../../packages/integrations/svelte
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
svelte:
|
||||
specifier: ^4.2.18
|
||||
|
@ -430,7 +430,7 @@ importers:
|
|||
examples/starlog:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
sass:
|
||||
specifier: ^1.77.8
|
||||
|
@ -442,7 +442,7 @@ importers:
|
|||
examples/toolbar-app:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/view-transitions:
|
||||
|
@ -454,7 +454,7 @@ importers:
|
|||
specifier: ^5.1.0
|
||||
version: link:../../packages/integrations/tailwind
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-markdoc:
|
||||
|
@ -463,7 +463,7 @@ importers:
|
|||
specifier: ^0.11.3
|
||||
version: link:../../packages/integrations/markdoc
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-markdown-plugins:
|
||||
|
@ -472,7 +472,7 @@ importers:
|
|||
specifier: ^5.2.0
|
||||
version: link:../../packages/markdown/remark
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
hast-util-select:
|
||||
specifier: ^6.0.2
|
||||
|
@ -493,7 +493,7 @@ importers:
|
|||
examples/with-markdown-shiki:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-mdx:
|
||||
|
@ -505,7 +505,7 @@ importers:
|
|||
specifier: ^3.5.1
|
||||
version: link:../../packages/integrations/preact
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.22.1
|
||||
|
@ -520,7 +520,7 @@ importers:
|
|||
specifier: ^0.5.1
|
||||
version: 0.5.1(nanostores@0.10.3)(preact@10.22.1)
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
nanostores:
|
||||
specifier: ^0.10.3
|
||||
|
@ -541,7 +541,7 @@ importers:
|
|||
specifier: ^1.6.4
|
||||
version: 1.6.4
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
autoprefixer:
|
||||
specifier: ^10.4.19
|
||||
|
@ -559,7 +559,7 @@ importers:
|
|||
examples/with-vitest:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.12.2
|
||||
specifier: ^4.12.3
|
||||
version: link:../../packages/astro
|
||||
vitest:
|
||||
specifier: ^2.0.3
|
||||
|
|
Loading…
Add table
Reference in a new issue