Posts tagged "Astro"

Subscribe to feed
  • ’Astro 7 just works on Netlify’

    Astro 7 is out today, and it just works on Netlify on day one. To upgrade, run:

    npx @astrojs/upgrade

    This will update Astro, the Netlify adapter, and all other official integrations together. You can also check out the official migration guide.

    What’s new

    Some highlights include:

    • Vite 8 — Astro 7 upgrades to Vite 8, bringing faster builds and improved dev tooling.
    • Sätteri is now the default markdown processor — Astro’s new native markdown pipeline replaces remark/rehype as the default. If your project uses remark or rehype plugins, you’ll need to install @astrojs/markdown-remark separately to keep them working.
    • Advanced routing is stable — Previously behind an experimental flag, advanced routing is now enabled by default. The default entry point has moved from src/app.ts to src/fetch.ts.
    • Streaming rendering is stable — The streaming-based rendering engine is now the default, replacing the legacy queued approach.
    • Background dev server for AI coding agents — astro dev now detects AI coding environments and runs as a background process automatically. New astro dev stop, astro dev status, and astro dev logs commands let you manage it directly.
    • Astro DB is deprecated — The astro db, astro login, astro logout, astro link, and astro init CLI commands have been removed. Switch to a dedicated database client.
    • Custom logger is stable — context.logger is now always available in API routes and middleware, with built-in json, node, and console handlers.

    Check the full upgrade guide for all the details.

    Watch out for the new markdown defaults

    If your site uses remark or rehype plugins, you’ll need to take action before upgrading. In Astro 7, the default markdown pipeline is Sätteri — Astro’s own native processor. The remark/rehype pipeline is no longer included by default.

    To keep your existing plugins working, install the remark package separately:

    npm install @astrojs/markdown-remark

    Once installed, your existing markdown.remarkPlugins, markdown.rehypePlugins, and markdown.remarkRehype config options will continue to work as before. If you’re not using any remark or rehype plugins, no changes are needed — Sätteri handles standard Markdown out of the box.

    Deploy an Astro 7 site on Netlify

    If you want to get started with a new site, start with the Astro on Netlify doc, or just click this button:

    Deploy to Netlify

    Permalink to ’Astro 7 just works on Netlify’
  • Astro 6 just works on Netlify

    Astro 6 is out today, and it just works on Netlify on day one. To upgrade, run:

    npx @astrojs/upgrade

    This will update Astro, the Netlify adapter, and all other official integrations together.

    What’s new

    Some highlights include:

    • Vite 7 and a redesigned dev server — Faster builds and a better dev server built from the ground up.
    • Content Layer API — Legacy content collections are fully removed. All collections must now use the Content Layer API.
    • Node 22 — Node 18 and 20 are no longer supported.

    Check the full upgrade guide for all the details.

    Watch out for import.meta.env

    One change worth calling out: import.meta.env values are now always inlined at build time in Astro 6. This means if you were relying on import.meta.env to read environment variables at runtime in your server-side code, those values will be baked into your build output instead.

    To read environment variables at runtime, use process.env instead:

    - const apiKey = import.meta.env.API_KEY;
    + const apiKey = process.env.API_KEY;

    This is especially important for secrets. If a secret is inlined into your server bundle, it’s no longer secret. The good news: Netlify’s smart secret scanning will automatically detect exposed secrets in your build output and fail the build before it goes live, so you’ll know right away if something slipped through.

    Deploy an Astro 6 site on Netlify

    If you want to get started with a new site, start with the Astro on Netlify doc, or just click this button:

    Deploy to Netlify

    Permalink to Astro 6 just works on Netlify
  • Netlify Vite Plugin now supports AI Gateway locally

    You can now use AI Gateway in local development with just npm run dev when using the Netlify Vite Plugin. Previously, AI Gateway’s auto-configured environment variables only worked when running netlify dev, which added friction for developers using Vite-powered frameworks like Astro.

    With this update, AI Gateway environment variables are automatically populated when running your Vite development server directly. This means you can run standard framework commands without extra steps:

    # Works with any Vite-based framework
    npm run dev

    This is part of our ongoing effort to streamline the developer experience for Vite frameworks. Modern frameworks like Astro let you specify Netlify as your deployment target and handle everything automatically—now AI Gateway works the same way.

    This change also improves compatibility with AI coding agents and other automated workflows that expect standard development commands to work without additional configuration.

    Learn more about the Netlify Vite Plugin and AI Gateway in the documentation.

    Permalink to Netlify Vite Plugin now supports AI Gateway locally