🐞 Patch Changes
-
#11459
bc2e74dThanks @mingjunlu! - Fixes false positive audit warnings on elements with the role “tabpanel”. -
#11472
cb4e6d0Thanks @delucis! - Avoids targeting all files in thesrc/directory for eager optimization by Vite. After this change, only JSX, Vue, Svelte, and Astro components get scanned for early optimization. -
#11387
b498461Thanks @bluwy! - Fixes prerendering not removing unused dynamic imported chunks -
#11437
6ccb30eThanks @NuroDev! - Fixes a case where Astro’s configexperimental.env.schemakeys did not allow numbers. Numbers are still not allowed as the first character to be able to generate valid JavaScript identifiers -
#11439
08baf56Thanks @bholmesdev! - Expands theisInputError()utility fromastro:actionsto accept errors of any type. This should now allow type narrowing from a try / catch block.example.ts import { actions, isInputError } from 'astro:actions';try {await actions.like(new FormData());} catch (error) {if (isInputError(error)) {console.log(error.fields);}} -
#11452
0e66849Thanks @FugiTech! - Fixes an issue where using .nullish() in a formdata Astro action would always parse as a string -
#11438
619f07dThanks @bholmesdev! - Exposes utility types fromastro:actionsfor thedefineActionhandler (ActionHandler) and theActionErrorcode (ActionErrorCode). -
#11456
17e048dThanks @RickyC0626! - Fixesastro dev --openunexpected behavior that spawns a new tab every time a config file is saved -
#11337
0a4b31fThanks @florian-lefebvre! - Adds a new propertyexperimental.env.validateSecretsto allow validating private variables on the server.By default, this is set to
falseand only public variables are checked on start. If enabled, secrets will also be checked on start (dev/build modes). This is useful for example in some CIs to make sure all your secrets are correctly set before deploying.astro.config.mjs import { defineConfig, envField } from 'astro/config';export default defineConfig({experimental: {env: {schema: {// ...},validateSecrets: true,},},}); -
#11443
ea4bc04Thanks @bholmesdev! - Expose newActionReturnTypeutility fromastro:actions. This infers the return type of an action by passingtypeof actions.nameas a type argument. This example defines alikeaction that returnslikesas an object:actions/index.ts import { defineAction } from 'astro:actions';export const server = {like: defineAction({handler: () => {/* ... */return { likes: 42 };},}),};In your client code, you can infer this handler return value with
ActionReturnType:client.ts import { actions, ActionReturnType } from 'astro:actions';type LikesResult = ActionReturnType<typeof actions.like>;// -> { likes: number } -
#11436
7dca68fThanks @bholmesdev! - Fixesastro:actionsautocompletion for thedefineActionacceptproperty -
#11455
645e128Thanks @florian-lefebvre! - Improvesastro:envinvalid variables errors