Blog Logo
TAGS

Astro 4.8 Release Highlights: Experimental Support for Astro Actions and Request Rewriting, Performance Improvements, and More

Astro 4.8 is out now! This release includes experimental support for Astro actions and request rewriting, performance improvements, and more. Full release highlights include: Experimental: Astro Actions, Experimental: Request Rewriting, Performance improvements, Ability to define multiple routes with the same entrypoint. To upgrade an existing project, use the automated @astrojs/upgrade CLI tool. Alternatively, upgrade manually by running the upgrade command for your package manager. Experimental: Astro Actions introduce a long-awaited feature: Astro actions! Actions make it easy to define and call backend functions with full type-safety from your client code. To use this feature, add a server build output and enable the `experimental.actions` option in your Astro config. Actions can be defined in a `src/actions/index.ts` file using `defineAction()`. You can define actions that accept JSON or form requests, and the handler function will be called with your type-safe input. Plus, no more casting `formData.get()` results. Astro will automatically parse form requests to objects using your Zod schema. You can also call actions from any client component using the actions object from `astro:actions`. For more information on Astro actions, visit the experimental actions docs. Experimental: Request Rewriting introduces