
🍿 Minor Changes
-
#10665
7b4f284Thanks @Princesseuh! - Adds new utilities to ease the creation of toolbar apps includingdefineToolbarAppto make it easier to define your toolbar app andappandserverhelpers for easier communication between the toolbar and the server. These new utilities abstract away some of the boilerplate code that is common in toolbar apps, and lower the barrier of entry for app authors.For example, instead of creating an event listener for the
app-toggledevent and manually typing the value in the callback, you can now use theonAppToggledmethod. Additionally, communicating with the server does not require knowing any of the Vite APIs anymore, as a newserverobject is passed to theinitfunction that contains easy to use methods for communicating with the server.import { defineToolbarApp } from "astro/toolbar";export default defineToolbarApp({init(canvas, app, server) {app.addEventListener("app-toggled", (e) => {console.log(`App is now ${state ? "enabled" : "disabled"}`);.});app.onToggled(({ state }) => {console.log(`App is now ${state ? "enabled" : "disabled"}`);});if (import.meta.hot) {import.meta.hot.send("my-app:my-client-event", { message: "world" });}server.send("my-app:my-client-event", { message: "world" })if (import.meta.hot) {import.meta.hot.on("my-server-event", (data: {message: string}) => {console.log(data.message);});}server.on<{ message: string }>("my-server-event", (data) => {console.log(data.message); // data is typed using the type parameter});},})Server helpers are also available on the server side, for use in your integrations, through the new
toolbarobject:"astro:server:setup": ({ toolbar }) => {toolbar.on<{ message: string }>("my-app:my-client-event", (data) => {console.log(data.message);toolbar.send("my-server-event", { message: "hello" });});}This is a backwards compatible change and your your existing dev toolbar apps will continue to function. However, we encourage you to build your apps with the new helpers, following the updated Dev Toolbar API documentation.
-
#10734
6fc4c0eThanks @Princesseuh! - Astro will now automatically check for updates when you run the dev server. If a new version is available, a message will appear in the terminal with instructions on how to update. Updates will be checked once per 10 days, and the message will only appear if the project is multiple versions behind the latest release.This behavior can be disabled by running
astro preferences disable checkUpdatesor setting theASTRO_DISABLE_UPDATE_CHECKenvironment variable tofalse. -
#10762
43ead8fThanks @bholmesdev! - Enables type checking for JavaScript files when using thestrictestTS config. This ensures consistency with Astro’s other TS configs, and fixes type checking for integrations like Astro DB when using anastro.config.mjs.If you are currently using the
strictestpreset and would like to still disable.jsfiles, setallowJS: falsein yourtsconfig.json.
🐞 Patch Changes
-
#10861
b673bc8Thanks @mingjunlu! - Fixes an issue whereastro buildwrites type declaration files tooutDirwhen it’s outside of root directory. -
#10684
8b59d5dThanks @PeterDraex! - Update sharp to 0.33 to fix issue with Alpine Linux