0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-03 22:29:08 -05:00
astro/packages/astro/CHANGELOG.md
Houston (Bot) eaf483fe73
[ci] release (#9785)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-23 19:27:10 -05:00

488 KiB
Raw Blame History

astro

4.2.4

Patch Changes

  • #9792 e22cb8b10c0ca9f6d88cab53cd2713f57875ab4b Thanks @tugrulates! - Accept aria role switch on toolbar audit.

  • #9606 e6945bcf23b6ad29388bbadaf5bb3cc31dd4a114 Thanks @eryue0220! - Fixes escaping behavior for .html files and components

  • #9786 5b29550996a7f5459a0d611feea6e51d44e1d8ed Thanks @Fryuni! - Fixes a regression in routing priority for index pages in rest parameter folders and dynamic sibling trees.

    Considering the following tree:

    src/pages/
    ├── index.astro
    ├── static.astro
    ├── [dynamic_file].astro
    ├── [...rest_file].astro
    ├── blog/
    │   └── index.astro
    ├── [dynamic_folder]/
    │   ├── index.astro
    │   ├── static.astro
    │   └── [...rest].astro
    └── [...rest_folder]/
        ├── index.astro
        └── static.astro
    

    The routes are sorted in this order:

    /src/pages/index.astro
    /src/pages/blog/index.astro
    /src/pages/static.astro
    /src/pages/[dynamic_folder]/index.astro
    /src/pages/[dynamic_file].astro
    /src/pages/[dynamic_folder]/static.astro
    /src/pages/[dynamic_folder]/[...rest].astro
    /src/pages/[...rest_folder]/static.astro
    /src/pages/[...rest_folder]/index.astro
    /src/pages/[...rest_file]/index.astro
    

    This allows for index files to be used as overrides to rest parameter routes on SSR when the rest parameter matching undefined is not desired.

  • #9775 075706f26d2e11e66ef8b52288d07e3c0fa97eb1 Thanks @lilnasy! - Simplifies internals that handle endpoints.

  • #9773 9aa7a5368c502ae488d3a173e732d81f3d000e98 Thanks @LunaticMuch! - Raises the required vite version to address a vulnerability in vite.server.fs.deny that affected the dev mode.

  • #9781 ccc05d54014e24c492ca5fddd4862f318aac8172 Thanks @stevenbenner! - Fix build failure when image file name includes special characters

4.2.3

Patch Changes

4.2.2

Patch Changes

4.2.1

Patch Changes

4.2.0

Minor Changes

  • #9566 165cfc154be477337037185c32b308616d1ed6fa Thanks @OliverSpeir! - Allows remark plugins to pass options specifying how images in .md files will be optimized

  • #9661 d6edc7540864cf5d294d7b881eb886a3804f6d05 Thanks @ematipico! - Adds new helper functions for adapter developers.

    • Astro.clientAddress can now be passed directly to the app.render() method.
    const response = await app.render(request, { clientAddress: '012.123.23.3' });
    
    • Helper functions for converting Node.js HTTP request and response objects to web-compatible Request and Response objects are now provided as static methods on the NodeApp class.
    http.createServer((nodeReq, nodeRes) => {
      const request: Request = NodeApp.createRequest(nodeReq);
      const response = await app.render(request);
      await NodeApp.writeResponse(response, nodeRes);
    });
    
    • Cookies added via Astro.cookies.set() can now be automatically added to the Response object by passing the addCookieHeader option to app.render().
    -const response = await app.render(request)
    -const setCookieHeaders: Array<string> = Array.from(app.setCookieHeaders(webResponse));
    
    -if (setCookieHeaders.length) {
    -    for (const setCookieHeader of setCookieHeaders) {
    -        headers.append('set-cookie', setCookieHeader);
    -    }
    -}
    +const response = await app.render(request, { addCookieHeader: true })
    
  • #9638 f1a61268061b8834f39a9b38bca043ae41caed04 Thanks @ematipico! - Adds a new i18n.routing config option redirectToDefaultLocale to disable automatic redirects of the root URL (/) to the default locale when prefixDefaultLocale: true is set.

    In projects where every route, including the default locale, is prefixed with /[locale]/ path, this property allows you to control whether or not src/pages/index.astro should automatically redirect your site visitors from / to /[defaultLocale].

    You can now opt out of this automatic redirection by setting redirectToDefaultLocale: false:

    // astro.config.mjs
    export default defineConfig({
      i18n: {
        defaultLocale: 'en',
        locales: ['en', 'fr'],
        routing: {
          prefixDefaultLocale: true,
          redirectToDefaultLocale: false,
        },
      },
    });
    
  • #9671 8521ff77fbf7e867701cc30d18253856914dbd1b Thanks @bholmesdev! - Removes the requirement for non-content files and assets inside content collections to be prefixed with an underscore. For files with extensions like .astro or .css, you can now remove underscores without seeing a warning in the terminal.

    src/content/blog/
    post.mdx
    - _styles.css
    - _Component.astro
    + styles.css
    + Component.astro
    

    Continue to use underscores in your content collections to exclude individual content files, such as drafts, from the build output.

  • #9567 3a4d5ec8001ebf95c917fdc0d186d29650533d93 Thanks @OliverSpeir! - Improves the a11y-missing-content rule and error message for audit feature of dev-overlay. This also fixes an error where this check was falsely reporting accessibility errors.

  • #9643 e9a72d9a91a3741566866bcaab11172cb0dc7d31 Thanks @blackmann! - Adds a new markdown.shikiConfig.transformers config option. You can use this option to transform the Shikiji hast (AST format of the generated HTML) to customize the final HTML. Also updates Shikiji to the latest stable version.

    See Shikiji's documentation for more details about creating your own custom transformers, and a list of common transformers you can add directly to your project.

  • #9644 a5f1682347e602330246129d4666a9227374c832 Thanks @rossrobino! - Adds an experimental flag clientPrerender to prerender your prefetched pages on the client with the Speculation Rules API.

    // astro.config.mjs
    {
      prefetch: {
        prefetchAll: true,
        defaultStrategy: 'viewport',
      },
      experimental: {
        clientPrerender: true,
      },
    }
    

    Enabling this feature overrides the default prefetch behavior globally to prerender links on the client according to your prefetch configuration. Instead of appending a <link> tag to the head of the document or fetching the page with JavaScript, a <script> tag will be appended with the corresponding speculation rules.

    Client side prerendering requires browser support. If the Speculation Rules API is not supported, prefetch will fallback to the supported strategy.

    See the Prefetch Guide for more prefetch options and usage.

  • #9439 fd17f4a40b83d14350dce691aeb79d87e8fcaf40 Thanks @Fryuni! - Adds an experimental flag globalRoutePriority to prioritize redirects and injected routes equally alongside file-based project routes, following the same route priority order rules for all routes.

    // astro.config.mjs
    export default defineConfig({
      experimental: {
        globalRoutePriority: true,
      },
    });
    

    Enabling this feature ensures that all routes in your project follow the same, predictable route priority order rules. In particular, this avoids an issue where redirects or injected routes (e.g. from an integration) would always take precedence over local route definitions, making it impossible to override some routes locally.

    The following table shows which route builds certain page URLs when file-based routes, injected routes, and redirects are combined as shown below:

    • File-based route: /blog/post/[pid]
    • File-based route: /[page]
    • Injected route: /blog/[...slug]
    • Redirect: /blog/tags/[tag] -> /[tag]
    • Redirect: /posts -> /blog

    URLs are handled by the following routes:

    Page Current Behavior Global Routing Priority Behavior
    /blog/tags/astro Injected route /blog/[...slug] Redirect to /tags/[tag]
    /blog/post/0 Injected route /blog/[...slug] File-based route /blog/post/[pid]
    /posts File-based route /[page] Redirect to /blog

    In the event of route collisions, where two routes of equal route priority attempt to build the same URL, Astro will log a warning identifying the conflicting routes.

Patch Changes

4.1.3

Patch Changes

4.1.2

Patch Changes

4.1.1

Patch Changes

4.1.0

Minor Changes

  • #9513 e44f6acf99195a3f29b8390fd9b2c06410551b74 Thanks @wtto00! - Adds a 'load' prefetch strategy to prefetch links on page load

  • #9377 fe719e27a84c09e46b515252690678c174a25759 Thanks @bluwy! - Adds "Missing ARIA roles check" and "Unsupported ARIA roles check" audit rules for the dev toolbar

  • #9573 2a8b9c56b9c6918531c57ec38b89474571331aee Thanks @bluwy! - Allows passing a string to --open and server.open to open a specific URL on startup in development

  • #9544 b8a6fa8917ff7babd35dafb3d3dcd9a58cee836d Thanks @bluwy! - Adds a helpful error for static sites when you use the astro preview command if you have not previously run astro build.

  • #9546 08402ad5846c73b6887e74ed4575fd71a3e3c73d Thanks @bluwy! - Adds an option for the Sharp image service to allow large images to be processed. Set limitInputPixels: false to bypass the default image size limit:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      image: {
        service: {
          entrypoint: 'astro/assets/services/sharp',
          config: {
            limitInputPixels: false,
          },
        },
      },
    });
    
  • #9596 fbc26976533bbcf2de9d6dba1aa3ea3dc6ce0853 Thanks @Princesseuh! - Adds the ability to set a rootMargin setting when using the client:visible directive. This allows a component to be hydrated when it is near the viewport, rather than hydrated when it has entered the viewport.

    <!-- Load component when it's within 200px away from entering the viewport -->
    <Component client:visible={{ rootMargin: '200px' }} />
    
  • #9063 f33fe3190b482a42ebc68cc5275fd7f2c49102e6 Thanks @alex-sherwin! - Cookie encoding / decoding can now be customized

    Adds new encode and decode functions to allow customizing how cookies are encoded and decoded. For example, you can bypass the default encoding via encodeURIComponent when adding a URL as part of a cookie:

    ---
    import { encodeCookieValue } from './cookies';
    Astro.cookies.set('url', Astro.url.toString(), {
      // Override the default encoding so that URI components are not encoded
      encode: (value) => encodeCookieValue(value),
    });
    ---
    

    Later, you can decode the URL in the same way:

    ---
    import { decodeCookieValue } from './cookies';
    const url = Astro.cookies.get('url', {
      decode: (value) => decodeCookieValue(value),
    });
    ---
    

Patch Changes

4.0.9

Patch Changes

4.0.8

Patch Changes

4.0.7

Patch Changes

4.0.6

Patch Changes

4.0.5

Patch Changes

4.0.4

Patch Changes

  • #9380 ea0918259 Thanks @ematipico! - Correctly handle the rendering of i18n routes when output: "hybrid" is set

  • #9374 65ddb0271 Thanks @bluwy! - Fixes an issue where prerendered route paths that end with .mjs were removed from the final build

  • #9375 26f7023d6 Thanks @bluwy! - Prettifies generated route names injected by integrations

  • #9387 a7c75b333 Thanks @natemoo-re! - Fixes an edge case with astro add that could install a prerelease instead of a stable release version.

    Prior to this change astro add svelte installs svelte@5.0.0-next.22

    After this change astro add svelte installs svelte@4.2.8

  • Updated dependencies [270c6cc27]:

    • @astrojs/markdown-remark@4.0.1

4.0.3

Patch Changes

4.0.2

Patch Changes

  • #9331 cfb20550d Thanks @natemoo-re! - Updates an internal dependency (vitefu) to avoid a common peerDependency warning

  • #9327 3878a91be Thanks @doseofted! - Fixes an edge case for <form method="dialog"> when using View Transitions. Forms with method="dialog" no longer require an additional data-astro-reload attribute.

4.0.1

Patch Changes

  • #9315 631e5d01b Thanks @ematipico! - Fixes an issue where logs that weren't grouped together by route when building the app.

4.0.0

Major Changes

  • #9138 abf601233 Thanks @bluwy! - Updates the unified, remark, and rehype dependencies to latest. Make sure to update your custom remark and rehype plugins as well to be compatible with the latest versions.

    Potentially breaking change: The default value of markdown.remarkRehype.footnoteBackLabel is changed from "Back to content" to "Back to reference 1". See the mdast-util-to-hast commit for more information.

  • #9181 cdabf6ef0 Thanks @bluwy! - Removes support for returning simple objects from endpoints (deprecated since Astro 3.0). You should return a Response instead.

    ResponseWithEncoding is also removed. You can refactor the code to return a response with an array buffer instead, which is encoding agnostic.

    The types for middlewares have also been revised. To type a middleware function, you should now use MiddlewareHandler instead of MiddlewareResponseHandler. If you used defineMiddleware() to type the function, no changes are needed.

  • #9263 3cbd8ea75 Thanks @bluwy! - Removes additional deprecated APIs:

    • The Astro preview server now returns a 404 status instead of a 301 redirect when requesting assets from the public directory without a base.
    • Removes special handling when referencing the astro/client-image type. You should use the astro/client type instead.
    • Removes deprecated built-in rss support in getStaticPaths. You should use @astrojs/rss instead.
    • Removes deprecated Astro.request.params support. You should use Astro.params instead.
  • #9271 47604bd5b Thanks @matthewp! - Renames Dev Overlay to Dev Toolbar

    The previously named experimental Dev Overlay is now known as the Astro Dev Toolbar. Overlay plugins have been renamed as Toolbar Apps. All APIs have been updated to reflect this name change.

    To not break existing APIs, aliases for the Toolbar-based names have been created. The previous API names will continue to function but will be deprecated in the future. All documentation has been updated to reflect Toolbar-based names.

  • #9122 1c48ed286 Thanks @bluwy! - Adds Vite 5 support. There are no breaking changes from Astro. Check the Vite migration guide for details of the breaking changes from Vite instead.

  • #9225 c421a3d17 Thanks @natemoo-re! - Removes the opt-in handleForms property for <ViewTransitions />. Form submissions are now handled by default and this property is no longer necessary. This default behavior can be disabled by setting data-astro-reload on relevant <form /> elements.

  • #9196 37697a2c5 Thanks @bluwy! - Removes support for Shiki custom language's path property. The language JSON file should be imported and passed to the option instead.

    // astro.config.js
    + import customLang from './custom.tmLanguage.json'
    
    export default defineConfig({
      markdown: {
        shikiConfig: {
          langs: [
    -       { path: './custom.tmLanguage.json' },
    +       customLang,
          ],
        },
      },
    })
    
  • #9199 49aa215a0 Thanks @lilnasy! - This change only affects maintainers of third-party adapters. In the Integration API, the app.render() method of the App class has been simplified.

    Instead of two optional arguments, it now takes a single optional argument that is an object with two optional properties: routeData and locals.

     app.render(request)
    
    - app.render(request, routeData)
    + app.render(request, { routeData })
    
    - app.render(request, routeData, locals)
    + app.render(request, { routeData, locals })
    
    - app.render(request, undefined, locals)
    + app.render(request, { locals })
    

    The current signature is deprecated but will continue to function until next major version.

  • #9212 c0383ea0c Thanks @alexanderniebuhr! - Removes deprecated app.match() option, matchNotFound

  • #9168 153a5abb9 Thanks @bluwy! - Removes deprecated features from Astro 3.0

    • Adapters are now required to pass supportedAstroFeatures to specify a list of features they support.
    • The build.split and build.excludeMiddleware options are removed. Use functionPerRoute and edgeMiddleware from adapters instead.
    • The markdown.drafts option and draft feature is removed. Use content collections instead.
    • Lowercase endpoint names are no longer supported. Use uppercase endpoint names instead.
    • getHeaders() exported from markdown files is removed. Use getHeadings() instead.

Minor Changes

  • #9105 6201bbe96 Thanks @FredKSchott! - Update CLI logging experience

  • #9200 b4b851f5a Thanks @ematipico! - Adds a new way to configure the i18n.locales array.

    Developers can now assign a custom URL path prefix that can span multiple language codes:

    // astro.config.mjs
    export default defineConfig({
      experimental: {
        i18n: {
          defaultLocale: 'english',
          locales: ['de', { path: 'english', codes: ['en', 'en-US'] }, 'fr'],
        },
      },
    });
    

    With the above configuration, the URL prefix of the default locale will be /english/. When computing Astro.preferredLocale, Astro will use the codes.

  • #9115 3b77889b4 Thanks @natemoo-re! - Adds the astro preferences command to manage user preferences. User preferences are specific to individual Astro users, unlike the astro.config.mjs file which changes behavior for everyone working on a project.

    User preferences are scoped to the current project by default, stored in a local .astro/settings.json file. Using the --global flag, user preferences can also be applied to every Astro project on the current machine. Global user preferences are stored in an operating system-specific location.

    # Disable the dev overlay for the current user in the current project
    npm run astro preferences disable devOverlay
    # Disable the dev overlay for the current user in all Astro projects on this machine
    npm run astro preferences --global disable devOverlay
    
    # Check if the dev overlay is enabled for the current user
    npm run astro preferences list devOverlay
    
  • #9139 459b26436 Thanks @bluwy! - Reworks Vite's logger to use Astro's logger to correctly log HMR messages

  • #9279 6a9669b81 Thanks @martrapp! - Improves consistency between navigations with and without <ViewTransitions>. See #9279 for more details.

  • #9161 bd0c2e9ae Thanks @bluwy! - Renames the entryPoint property of the injectRoute integrations API to entrypoint for consistency. A warning will be shown prompting you to update your code when using the old name.

  • #9129 8bfc20511 Thanks @FredKSchott! - Update error log formatting

Patch Changes

  • #9118 000e8f465 Thanks @Princesseuh! - Redesign Dev Overlay main screen to show more information, such as the coolest integrations, your current Astro version and more.

  • #9118 000e8f465 Thanks @Princesseuh! - Fixes an issue where links with the same pathname as the current page, but different search params, were not prefetched.

  • #9275 0968cb1a3 Thanks @lilnasy! - Fixes an issue where html annotations relevant only to the dev server were included in the production build.

  • #9252 7b74ec4ba Thanks @ematipico! - Consistently emit fallback routes in the correct folders, and emit routes that consider trailingSlash

  • #9222 279e3c1b3 Thanks @matthewp! - Ensure the dev-overlay-window is anchored to the bottom

  • #9292 5428b3da0 Thanks @natemoo-re! - Improves display for astro preferences list command

  • #9235 9c2342c32 Thanks @Princesseuh! - Fix SVG icons not showing properly in the extended dropdown menu of the dev overlay

  • #9218 f4401c8c1 Thanks @matthewp! - Improve high contrast mode with the Dev Overlay

  • #9254 b750a161e Thanks @matthewp! - Improve highlight/tooltip positioning when in fixed positions

  • #9230 60cfa49e4 Thanks @FredKSchott! - Update the look and feel of the dev overlay

  • #9248 43ddb5217 Thanks @martrapp! - Adds properties of the submit button (name, value) to the form data of a view transition

  • #9170 8a228fce0 Thanks @natemoo-re! - Adds new accessibility audits to the Dev Toolbar's built-in Audits app.

    The audits Astro performs are non-exhaustive and only capable of detecting a handful of common accessibility issues. Please take care to perform a thorough, manual audit of your site to ensure compliance with the Web Content Accessibility Guidelines (WCAG) international standard before publishing your site.

    🧡 Huge thanks to the Svelte team for providing the basis of these accessibility audits!

  • #9149 0fe3a7ed5 Thanks @bluwy! - Removes vendored Vite's importMeta.d.ts file in favour of Vite 5's new vite/types/import-meta.d.ts export

  • #9295 3d2dbb0e5 Thanks @matthewp! - Remove aria-query package

    This is another CJS-only package that breaks usage.

  • #9274 feaba2c7f Thanks @TheOtterlord! - Fix routing prefixes when prefixDefaultLocale is true

  • #9273 9887f2412 Thanks @alexanderniebuhr! - Exports type for Dev Toolbar App under correct name

  • #9150 710be505c Thanks @bluwy! - Refactors virtual modules exports. This should not break your project unless you import Astro's internal modules, including:

    • astro/middleware/namespace
    • astro/transitions
    • astro/transitions/router
    • astro/transitions/events
    • astro/transitions/types
    • astro/prefetch
    • astro/i18n
  • #9227 4b8a42406 Thanks @matthewp! - Ensure overlay x-ray z-index is higher than the island

  • #9255 9ea3e0b94 Thanks @matthewp! - Adds instructions on how to hide the dev overlay

  • #9293 cf5fa4376 Thanks @matthewp! - Removes the 'a11y-role-has-required-aria-props' audit rule

    This audit rule depends on a CommonJS module. To prevent blocking the 4.0 release the rule is being removed temporarily.

  • #9214 4fe523b00 Thanks @Princesseuh! - Fixes a number of small user experience bugs with the dev overlay

  • #9013 ff8eadb95 Thanks @bayssmekanique! - Returns the updated config in the integration astro:config:setup hook's updateConfig() API

  • Updated dependencies [abf601233, addb57c8e, c7953645e]:

    • @astrojs/markdown-remark@4.0.0

4.0.0-beta.7

Patch Changes

  • #9295 3d2dbb0e5 Thanks @matthewp! - Remove aria-query package

    This is another CJS-only package that breaks usage.

4.0.0-beta.6

Patch Changes

  • #9275 0968cb1a3 Thanks @lilnasy! - Fixes an issue where html annotations relevant only to the dev server were included in the production build.

  • #9292 5428b3da0 Thanks @natemoo-re! - Improves display for astro preferences list command

  • #9293 cf5fa4376 Thanks @matthewp! - Removes the 'a11y-role-has-required-aria-props' audit rule

    This audit rule depends on a CommonJS module. To prevent blocking the 4.0 release the rule is being removed temporarily.

4.0.0-beta.5

Minor Changes

  • #9279 6a9669b81 Thanks @martrapp! - Improves consistency between navigations with and without <ViewTransitions>. See #9279 for more details.

Patch Changes

4.0.0-beta.4

Major Changes

  • #9271 47604bd5b Thanks @matthewp! - Renames Dev Overlay to Dev Toolbar

    The previously named experimental Dev Overlay is now known as the Astro Dev Toolbar. Plugins have been renamed as Toolbar Apps. This updates our references to reflect.

    To not break existing APIs, aliases for the Toolbar-based names have been created. The previous API names will continue to function but will be deprecated in the future. All documentation has been updated to reflect Toolbar-based names.

4.0.0-beta.3

Major Changes

  • #9263 3cbd8ea75 Thanks @bluwy! - Removes additional deprecated APIs:

    • The Astro preview server now returns a 404 status instead of a 301 redirect when requesting assets from the public directory without a base.
    • Removes special handling when referencing the astro/client-image type. You should use the astro/client type instead.
    • Removes deprecated built-in rss support in getStaticPaths. You should use @astrojs/rss instead.
    • Removes deprecated Astro.request.params support. You should use Astro.params instead.

Minor Changes

  • #9200 b4b851f5a Thanks @ematipico! - Adds a new way to configure the i18n.locales array.

    Developers can now assign a custom URL path prefix that can span multiple language codes:

    // astro.config.mjs
    export default defineConfig({
      experimental: {
        i18n: {
          defaultLocale: 'english',
          locales: ['de', { path: 'english', codes: ['en', 'en-US'] }, 'fr'],
          routingStrategy: 'prefix-always',
        },
      },
    });
    

    With the above configuration, the URL prefix of the default locale will be /english/. When computing Astro.preferredLocale, Astro will use the codes.

  • #9139 459b26436 Thanks @bluwy! - Reworks Vite's logger to use Astro's logger to correctly log HMR messages

Patch Changes

4.0.0-beta.2

Major Changes

  • #9225 c421a3d17 Thanks @natemoo-re! - Removes the opt-in handleForms property for <ViewTransitions />. Form submissions are now handled by default and can be disabled by setting data-astro-reload on relevant <form /> elements.

  • #9199 49aa215a0 Thanks @lilnasy! - This change only affects maintainers of third-party adapters. In the Integration API, the app.render() method of the App class has been simplified.

    Instead of two optional arguments, it now takes a single optional argument that is an object with two optional properties: routeData and locals.

     app.render(request)
    
    - app.render(request, routeData)
    + app.render(request, { routeData })
    
    - app.render(request, routeData, locals)
    + app.render(request, { routeData, locals })
    
    - app.render(request, undefined, locals)
    + app.render(request, { locals })
    

    The current signature is deprecated but will continue to function until next major version.

  • #9212 c0383ea0c Thanks @alexanderniebuhr! - Removes deprecated app.match() option, matchNotFound

Minor Changes

  • #9115 3b77889b4 Thanks @natemoo-re! - Adds the astro preferences command to manage user preferences. User preferences are specific to individual Astro users, unlike the astro.config.mjs file which changes behavior for everyone working on a project.

    User preferences are scoped to the current project by default, stored in a local .astro/settings.json file. Using the --global flag, user preferences can also be applied to every Astro project on the current machine. Global user preferences are stored in an operating system-specific location.

    # Disable the dev overlay for the current user in the current project
    npm run astro preferences disable devOverlay
    # Disable the dev overlay for the current user in all Astro projects on this machine
    npm run astro preferences --global disable devOverlay
    
    # Check if the dev overlay is enabled for the current user
    npm run astro preferences list devOverlay
    
  • #9129 8bfc20511 Thanks @FredKSchott! - Update error log formatting

Patch Changes

4.0.0-beta.1

Patch Changes

  • #9118 000e8f465 Thanks @Princesseuh! - Redesign Dev Overlay main screen to show more information, such as the coolest integrations, your current Astro version and more.

  • #9118 000e8f465 Thanks @Princesseuh! - Fixes an issue where links with the same pathname as the current page, but different search params, were not prefetched.

4.0.0-beta.0

Major Changes

  • #9138 abf601233 Thanks @bluwy! - Updates the unified, remark, and rehype dependencies to latest. Make sure to update your custom remark and rehype plugins as well to be compatible with the latest versions.

    Potentially breaking change: The default value of markdown.remarkRehype.footnoteBackLabel is changed from "Back to content" to "Back to reference 1". See the mdast-util-to-hast commit for more information.

  • #9181 cdabf6ef0 Thanks @bluwy! - Removes support for returning simple objects from endpoints (deprecated since Astro 3.0). You should return a Response instead.

    ResponseWithEncoding is also removed. You can refactor the code to return a response with an array buffer instead, which is encoding agnostic.

    The types for middlewares have also been revised. To type a middleware function, you should now use MiddlewareHandler instead of MiddlewareResponseHandler. If you used defineMiddleware() to type the function, no changes are needed.

  • #9122 1c48ed286 Thanks @bluwy! - Adds Vite 5 support. There are no breaking changes from Astro. Check the Vite migration guide for details of the breaking changes from Vite instead.

  • #9196 37697a2c5 Thanks @bluwy! - Removes support for Shiki custom language's path property. The language JSON file should be imported and passed to the option instead.

    // astro.config.js
    + import customLang from './custom.tmLanguage.json'
    
    export default defineConfig({
      markdown: {
        shikiConfig: {
          langs: [
    -       { path: './custom.tmLanguage.json' },
    +       customLang,
          ],
        },
      },
    })
    
  • #9168 153a5abb9 Thanks @bluwy! - Removes deprecated features from Astro 3.0

    • Adapters are now required to pass supportedAstroFeatures to specify a list of features they support.
    • The build.split and build.excludeMiddleware options are removed. Use functionPerRoute and edgeMiddleware from adapters instead.
    • The markdown.drafts option and draft feature is removed. Use content collections instead.
    • Lowercase endpoint names are no longer supported. Use uppercase endpoint names instead.
    • getHeaders() exported from markdown files is removed. Use getHeadings() instead.

Minor Changes

  • #9105 6201bbe96 Thanks @FredKSchott! - Update CLI logging experience

  • #9161 bd0c2e9ae Thanks @bluwy! - Renames the entryPoint property of the injectRoute integrations API to entrypoint for consistency. A warning will be shown prompting you to update your code when using the old name.

Patch Changes

  • #9149 0fe3a7ed5 Thanks @bluwy! - Removes vendored Vite's importMeta.d.ts file in favour of Vite 5's new vite/types/import-meta.d.ts export

  • #9150 710be505c Thanks @bluwy! - Refactors virtual modules exports. This should not break your project unless you import Astro's internal modules, including:

    • astro/middleware/namespace
    • astro/transitions
    • astro/transitions/router
    • astro/transitions/events
    • astro/transitions/types
    • astro/prefetch
    • astro/i18n
  • Updated dependencies [abf601233, addb57c8e, c7953645e]:

    • @astrojs/markdown-remark@4.0.0-beta.0

3.6.4

Patch Changes

  • #9226 8f8a40e93 Thanks @outofambit! - Fix i18n fallback routing with routing strategy of always-prefix

  • #9179 3f28336d9 Thanks @lilnasy! - Fixes an issue where the presence of a slot in a page led to an error.

  • #9219 067a65f5b Thanks @natemoo-re! - Fix edge case where <style> updates inside of .astro files would ocassionally fail to update without reloading the page.

  • #9236 27d3e86e4 Thanks @ematipico! - The configuration i18n.routingStrategy has been replaced with an object called routing.

    export default defineConfig({
      experimental: {
          i18n: {
    -          routingStrategy: "prefix-always",
    +          routing: {
    +              prefixDefaultLocale: true,
    +          }
          }
      }
    })
    
    export default defineConfig({
      experimental: {
          i18n: {
    -          routingStrategy: "prefix-other-locales",
    +          routing: {
    +              prefixDefaultLocale: false,
    +          }
          }
      }
    })
    

3.6.3

Patch Changes

3.6.2

Patch Changes

  • #9189 d90714fc3 Thanks @SpencerWhitehead7! - Fixes an issue where links with the same pathname as the current page, but different search params, were not prefetched.

3.6.4

Patch Changes

  • #9226 8f8a40e93 Thanks @outofambit! - Fix i18n fallback routing with routing strategy of always-prefix

  • #9179 3f28336d9 Thanks @lilnasy! - Fixes an issue where the presence of a slot in a page led to an error.

  • #9219 067a65f5b Thanks @natemoo-re! - Fix edge case where <style> updates inside of .astro files would ocassionally fail to update without reloading the page.

  • #9236 27d3e86e4 Thanks @ematipico! - The configuration i18n.routingStrategy has been replaced with an object called routing.

    export default defineConfig({
      experimental: {
          i18n: {
    -          routingStrategy: "prefix-always",
    +          routing: {
    +              prefixDefaultLocale: true,
    +          }
          }
      }
    })
    
    export default defineConfig({
      experimental: {
          i18n: {
    -          routingStrategy: "prefix-other-locales",
    +          routing: {
    +              prefixDefaultLocale: false,
    +          }
          }
      }
    })
    

3.6.3

Patch Changes

3.6.2

Patch Changes

  • #9189 d90714fc3 Thanks @SpencerWhitehead7! - Fixes an issue where links with the same pathname as the current page, but different search params, were not prefetched.

3.6.1

Patch Changes

  • #9173 04fdc1c61 Thanks @lilnasy! - Fixes an issue where having a middleware prevented the SSR app from being deployed on Netlify.

  • #9186 607542c7c Thanks @martrapp! - Fixes a view transition issue on webKit browsers that prevented scrolling to #fragments

3.6.0

Minor Changes

  • #9090 c87223c21 Thanks @martrapp! - Take full control over the behavior of view transitions!

    Three new events now complement the existing astro:after-swap and astro:page-load events:

    'astro:before-preparation'; // Control how the DOM and other resources of the target page are loaded
    'astro:after-preparation'; // Last changes before taking off? Remove that loading indicator? Here you go!
    'astro:before-swap'; // Control how the DOM is updated to match the new page
    

    The astro:before-* events allow you to change properties and strategies of the view transition implementation. The astro:after-* events are notifications that a phase is complete. Head over to docs to see the full view transitions lifecycle including these new events!

  • #9092 0ea4bd47e Thanks @smitbarmase! - Changes the fallback prefetch behavior on slow connections and when data saver mode is enabled. Instead of disabling prefetch entirely, the tap strategy will be used.

  • #9166 cba6cf32d Thanks @matthewp! - The Picture component is no longer experimental

    The <Picture /> component, part of astro:assets, has exited experimental status and is now recommended for use. There are no code changes to the component, and no upgrade to your project is necessary.

    This is only a change in documentation/recommendation. If you were waiting to use the <Picture /> component until it had exited the experimental stage, wait no more!

  • #9092 0ea4bd47e Thanks @smitbarmase! - Adds a ignoreSlowConnection option to the prefetch() API to prefetch even on data saver mode or slow connection.

3.5.7

Patch Changes

3.5.6

Patch Changes

3.5.5

Patch Changes

  • #9091 536c6c9fd Thanks @ematipico! - The routingStrategy prefix-always should not force its logic to endpoints. This fixes some regression with astro:assets and @astrojs/rss.

  • #9102 60e8210b0 Thanks @Princesseuh! - In the dev overlay, when there's too many plugins enabled at once, some of the plugins will now be hidden in a separate sub menu to avoid the bar becoming too long

3.5.4

Patch Changes

3.5.3

Patch Changes

3.5.2

Patch Changes

3.5.1

Patch Changes

3.5.0

Minor Changes

  • #8869 f5bdfa272 Thanks @matthewp! - ## Integration Hooks to add Middleware

    It's now possible in Astro for an integration to add middleware on behalf of the user. Previously when a third party wanted to provide middleware, the user would need to create a src/middleware.ts file themselves. Now, adding third-party middleware is as easy as adding a new integration.

    For integration authors, there is a new addMiddleware function in the astro:config:setup hook. This function allows you to specify a middleware module and the order in which it should be applied:

    // my-package/middleware.js
    import { defineMiddleware } from 'astro:middleware';
    
    export const onRequest = defineMiddleware(async (context, next) => {
      const response = await next();
    
      if (response.headers.get('content-type') === 'text/html') {
        let html = await response.text();
        html = minify(html);
        return new Response(html, {
          status: response.status,
          headers: response.headers,
        });
      }
    
      return response;
    });
    

    You can now add your integration's middleware and specify that it runs either before or after the application's own defined middleware (defined in src/middleware.{js,ts})

    // my-package/integration.js
    export function myIntegration() {
      return {
        name: 'my-integration',
        hooks: {
          'astro:config:setup': ({ addMiddleware }) => {
            addMiddleware({
              entrypoint: 'my-package/middleware',
              order: 'pre',
            });
          },
        },
      };
    }
    
  • #8854 3e1239e42 Thanks @natemoo-re! - Provides a new, experimental build cache for Content Collections as part of the Incremental Build RFC. This includes multiple refactors to Astro's build process to optimize how Content Collections are handled, which should provide significant performance improvements for users with many collections.

    Users building a static site can opt-in to preview the new build cache by adding the following flag to your Astro config:

    // astro.config.mjs
    export default {
      experimental: {
        contentCollectionCache: true,
      },
    };
    

    When this experimental feature is enabled, the files generated from your content collections will be stored in the cacheDir (by default, node_modules/.astro) and reused between builds. Most CI environments automatically restore files in node_modules/ by default.

    In our internal testing on the real world Astro Docs project, this feature reduces the bundling step of astro build from 133.20s to 10.46s, about 92% faster. The end-to-end astro build process used to take 4min 58s and now takes just over 1min for a total reduction of 80%.

    If you run into any issues with this experimental feature, please let us know!

    You can always bypass the cache for a single build by passing the --force flag to astro build.

    astro build --force
    
  • #8963 fda3a0213 Thanks @matthewp! - Form support in View Transitions router

    The <ViewTransitions /> router can now handle form submissions, allowing the same animated transitions and stateful UI retention on form posts that are already available on <a> links. With this addition, your Astro project can have animations in all of these scenarios:

    • Clicking links between pages.
    • Making stateful changes in forms (e.g. updating site preferences).
    • Manually triggering navigation via the navigate() API.

    This feature is opt-in for semver reasons and can be enabled by adding the handleForms prop to the ` component:

    ---
    // src/layouts/MainLayout.astro
    import { ViewTransitions } from 'astro:transitions';
    ---
    
    <html>
      <head>
        <!-- ... -->
        <ViewTransitions handleForms />
      </head>
      <body>
        <!-- ... -->
      </body>
    </html>
    

    Just as with links, if you don't want the routing handling a form submission, you can opt out on a per-form basis with the data-astro-reload property:

    ---
    // src/components/Contact.astro
    ---
    
    <form class="contact-form" action="/request" method="post" data-astro-reload>
      <!-- ...-->
    </form>
    

    Form support works on post method="get" and method="post" forms.

  • #8954 f0031b0a3 Thanks @Princesseuh! - Updates the Image Services API to now delete original images from the final build that are not used outside of the optimization pipeline. For users with a large number of these images (e.g. thumbnails), this should reduce storage consumption and deployment times.

  • #8984 26b1484e8 Thanks @Princesseuh! - Adds a new property propertiesToHash to the Image Services API to allow specifying which properties of getImage() / <Image /> / <Picture /> should be used for hashing the result files when doing local transformations. For most services, this will include properties such as src, width or quality that directly changes the content of the generated image.

  • #9010 100b61ab5 Thanks @jasikpark! - The <Picture /> component will now use jpg and jpeg respectively as fallback formats when the original image is in those formats.

  • #8974 143bacf39 Thanks @ematipico! - Experimental support for i18n routing.

    Astro's experimental i18n routing API allows you to add your multilingual content with support for configuring a default language, computing relative page URLs, and accepting preferred languages provided by your visitor's browser. You can also specify fallback languages on a per-language basis so that your visitors can always be directed to existing content on your site.

    Enable the experimental routing option by adding an i18n object to your Astro configuration with a default location and a list of all languages to support:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        i18n: {
          defaultLocale: 'en',
          locales: ['en', 'es', 'pt-br'],
        },
      },
    });
    

    Organize your content folders by locale depending on your i18n.routingStrategy, and Astro will handle generating your routes and showing your preferred URLs to your visitors.

    ├── src
    │   ├── pages
    │   │   ├── about.astro
    │   │   ├── index.astro
    │   │   ├── es
    │   │   │   ├── about.astro
    │   │   │   ├── index.astro
    │   │   ├── pt-br
    │   │   │   ├── about.astro
    │   │   │   ├── index.astro
    

    Compute relative URLs for your links with getRelativeLocaleUrl from the new astro:i18n module:

    ---
    import { getRelativeLocaleUrl } from 'astro:i18n';
    const aboutUrl = getRelativeLocaleUrl('pt-br', 'about');
    ---
    
    <p>Learn more <a href={aboutURL}>About</a> this site!</p>
    

    Enabling i18n routing also provides two new properties for browser language detection: Astro.preferredLocale and Astro.preferredLocaleList. These combine the browser's Accept-Langauge header, and your site's list of supported languages and can be used to automatically respect your visitor's preferred languages.

    Read more about Astro's experimental i18n routing in our documentation.

  • #8951 38e21d127 Thanks @bluwy! - Prefetching is now supported in core

    You can enable prefetching for your site with the prefetch: true config. It is enabled by default when using View Transitions and can also be used to configure the prefetch behaviour used by View Transitions.

    You can enable prefetching by setting prefetch:true in your Astro config:

    // astro.config.js
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      prefetch: true,
    });
    

    This replaces the @astrojs/prefetch integration, which is now deprecated and will eventually be removed. Visit the Prefetch guide for more information.

  • #8903 c5010aad3 Thanks @horo-fox! - Adds experimental support for multiple shiki themes with the new markdown.shikiConfig.experimentalThemes option.

Patch Changes

  • #9016 1ecc9aa32 Thanks @Princesseuh! - Add ability to "Click to go editor" on auditted elements in the dev overlay

  • #9029 29b83e9e4 Thanks @Princesseuh! - Use UInt8Array instead of Buffer for both the input and return values of the transform() hook of the Image Service API to ensure compatibility with non-Node runtimes.

    This change is unlikely to affect you, but if you were previously relying on the return value being a Buffer, you may convert an UInt8Array to a Buffer using Buffer.from(your_array).

  • Updated dependencies [c5010aad3]:

    • @astrojs/markdown-remark@3.4.0

3.4.4

Patch Changes

  • #9000 35739d01e Thanks @martrapp! - Fixes an error in dev mode on Safari where view transitions prevented navigating to pages with client:only components

  • #9014 d979b8f0a Thanks @Princesseuh! - Add animations, shadows and general styling tweaks to the Dev Overlay to better match the intended design.

  • #8996 3988bbcc9 Thanks @bluwy! - Adds compatibility for shiki languages with the path property

  • #8986 910eb00fe Thanks @Princesseuh! - Fix sizes attribute not being present on source elements when using it on the Picture component

3.4.3

Patch Changes

3.4.2

Patch Changes

3.4.1

Patch Changes

3.4.0

Minor Changes

  • #8755 fe4079f05 Thanks @matthewp! - Page Partials

    A page component can now be identified as a partial page, which will render its HTML content without including a <! DOCTYPE html> declaration nor any <head> content.

    A rendering library, like htmx or Stimulus or even just jQuery can access partial content on the client to dynamically update only parts of a page.

    Pages marked as partials do not have a doctype or any head content included in the rendered result. You can mark any page as a partial by setting this option:

    ---
    export const partial = true;
    ---
    
    <li>This is a single list item.</li>
    

    Other valid page files that can export a value (e.g. .mdx) can also be marked as partials.

    Read more about Astro page partials in our documentation.

  • #8821 4740d761a Thanks @Princesseuh! - Improved image optimization performance

    Astro will now generate optimized images concurrently at build time, which can significantly speed up build times for sites with many images. Additionally, Astro will now reuse the same buffer for all variants of an image. This should improve performance for websites with many variants of the same image, especially when using remote images.

    No code changes are required to take advantage of these improvements.

  • #8757 e99586787 Thanks @Princesseuh! - Dev Overlay (experimental)

    Provides a new dev overlay for your browser preview that allows you to inspect your page islands, see helpful audits on performance and accessibility, and more. A Dev Overlay Plugin API is also included to allow you to add new features and third-party integrations to it.

    You can enable access to the dev overlay and its API by adding the following flag to your Astro config:

    // astro.config.mjs
    export default {
      experimental: {
        devOverlay: true,
      },
    };
    

    Read the Dev Overlay Plugin API documentation for information about building your own plugins to integrate with Astro's dev overlay.

  • #8880 8c3d4a859 Thanks @alexanderniebuhr! - Moves the logic for overriding the image service out of core and into adapters. Also fixes a regression where a valid astro:assets image service configuration could be overridden.

3.3.4

Patch Changes

  • #8877 26b77b8fe Thanks @bluwy! - Fixes CSS modules ordering by rendering styles before links

  • Updated dependencies [341ef6578]:

    • @astrojs/telemetry@3.0.4

3.3.3

Patch Changes

3.3.2

Patch Changes

3.3.1

Patch Changes

3.3.0

Minor Changes

  • #8808 2993055be Thanks @delucis! - Adds support for an --outDir CLI flag to astro build

  • #8502 c4270e476 Thanks @bluwy! - Updates the internal shiki syntax highlighter to shikiji, an ESM-focused alternative that simplifies bundling and maintenance.

    There are no new options and no changes to how you author code blocks and syntax highlighting.

    Potentially breaking change: While this refactor should be transparent for most projects, the transition to shikiji now produces a smaller HTML markup by attaching a fallback color style to the pre or code element, instead of to the line span directly. For example:

    Before:

    <code class="astro-code" style="background-color: #24292e">
      <pre>
        <span class="line" style="color: #e1e4e8">my code</span>
      </pre>
    </code>
    

    After:

    <code class="astro-code" style="background-color: #24292e; color: #e1e4e8">
      <pre>
        <span class="line">my code<span>
      </pre>
    </code>
    

    This does not affect the colors as the span will inherit the color from the parent, but if you're relying on a specific HTML markup, please check your site carefully after upgrading to verify the styles.

  • #8798 f369fa250 Thanks @Princesseuh! - Fixed tsconfig.json's new array format for extends not working. This was done by migrating Astro to use tsconfck instead of tsconfig-resolver to find and parse tsconfig.json files.

  • #8620 b2ae9ee0c Thanks @Princesseuh! - Adds experimental support for generating srcset attributes and a new <Picture /> component.

    srcset support

    Two new properties have been added to Image and getImage(): densities and widths.

    These properties can be used to generate a srcset attribute, either based on absolute widths in pixels (e.g. [300, 600, 900]) or pixel density descriptors (e.g. ["2x"] or [1.5, 2]).

    ---
    import { Image } from 'astro';
    import myImage from './my-image.jpg';
    ---
    
    <Image src={myImage} width={myImage.width / 2} densities={[1.5, 2]} alt="My cool image" />
    
    <img
      src="/_astro/my_image.hash.webp"
      srcset="/_astro/my_image.hash.webp 1.5x, /_astro/my_image.hash.webp 2x"
      alt="My cool image"
    />
    

    Picture component

    The experimental <Picture /> component can be used to generate a <picture> element with multiple <source> elements.

    The example below uses the format property to generate a <source> in each of the specified image formats:

    ---
    import { Picture } from 'astro:assets';
    import myImage from './my-image.jpg';
    ---
    
    <Picture src={myImage} formats={['avif', 'webp']} alt="My super image in multiple formats!" />
    

    The above code will generate the following HTML, and allow the browser to determine the best image to display:

    <picture>
      <source srcset="..." type="image/avif" />
      <source srcset="..." type="image/webp" />
      <img src="..." alt="My super image in multiple formats!" />
    </picture>
    

    The Picture component takes all the same props as the Image component, including the new densities and widths properties.

Patch Changes

  • #8771 bd5aa1cd3 Thanks @lilnasy! - Fixed an issue where the transitions router did not work within framework components.

  • #8800 391729686 Thanks @lilnasy! - Fixed an issue where attempting to assign a variable onto locals threw an error.

  • #8795 f999365b8 Thanks @bluwy! - Fix markdown page charset to be utf-8 by default (same as Astro 2)

  • #8810 0abff97fe Thanks @jacobthesheep! - Remove network-information-types package since TypeScript supports Network Information API natively.

  • #8813 3bef32f81 Thanks @martrapp! - Save and restore focus for persisted input elements during view transitions

  • Updated dependencies [c4270e476]:

    • @astrojs/markdown-remark@3.3.0

3.2.4

Patch Changes

3.2.3

Patch Changes

3.2.2

Patch Changes

3.2.1

Patch Changes

  • #8680 31c59ad8b Thanks @bluwy! - Fix hydration on slow connection

  • #8698 47ea310f0 Thanks @Princesseuh! - Use a Node-specific image endpoint to resolve images in dev and Node SSR. This should fix many issues related to getting 404 from the _image endpoint under certain configurations

  • #8706 345808170 Thanks @bluwy! - Fix duplicated Astro and Vite injected styles

3.2.0

Minor Changes

  • #8696 2167ffd72 Thanks @matthewp! - Support adding integrations dynamically

    Astro integrations can now themselves dynamically add and configure additional integrations during set-up. This makes it possible for integration authors to bundle integrations more intelligently for their users.

    In the following example, a custom integration checks whether @astrojs/sitemap is already configured. If not, the integration adds Astros sitemap integration, passing any desired configuration options:

    import sitemap from '@astrojs/sitemap';
    import type { AstroIntegration } from 'astro';
    
    const MyIntegration = (): AstroIntegration => {
      return {
        name: 'my-integration',
    
        'astro:config:setup': ({ config, updateConfig }) => {
          // Look for sitemap in user-configured integrations.
          const userSitemap = config.integrations.find(
            ({ name }) => name === '@astrojs/sitemap'
          );
    
          if (!userSitemap) {
            // If sitemap wasnt found, add it.
            updateConfig({
              integrations: [sitemap({ /* opts */ }],
            });
          }
        },
      };
    };
    
  • #8696 2167ffd72 Thanks @matthewp! - View transitions can now be triggered from JavaScript!

    Import the client-side router from "astro:transitions/client" and enjoy your new remote control for navigation:

    import { navigate } from 'astro:transitions/client';
    
    // Navigate to the selected option automatically.
    document.querySelector('select').onchange = (ev) => {
      let href = ev.target.value;
      navigate(href);
    };
    
  • #8696 2167ffd72 Thanks @matthewp! - Route Announcer in <ViewTransitions />

    The View Transitions router now does route announcement. When transitioning between pages with a traditional MPA approach, assistive technologies will announce the page title when the page finishes loading. This does not automatically happen during client-side routing, so visitors relying on these technologies to announce routes are not aware when a page has changed.

    The view transitions route announcer runs after the astro:page-load event, looking for the page <title> to announce. If one cannot be found, the announcer falls back to the first <h1> it finds, or otherwise announces the pathname. We recommend you always include a <title> in each page for accessibility.

    See the View Transitions docs for more on how accessibility is handled.

Patch Changes

3.1.4

Patch Changes

3.1.3

Patch Changes

3.1.2

Patch Changes

3.1.1

Patch Changes

3.1.0

Minor Changes

  • #8467 ecc65abbf Thanks @Princesseuh! - Add a new image.endpoint setting to allow using a custom endpoint in dev and SSR

  • #8518 2c4fc878b Thanks @Princesseuh! - Adds support for using AVIF (.avif) files with the Image component. Importing an AVIF file will now correctly return the same object shape as other image file types. See the Image docs for more information on the different properties available on the returned object.

  • #8464 c92e0acd7 Thanks @Princesseuh! - Add types for the object syntax for style (ex: style={{color: 'red'}})

Patch Changes

3.0.13

Patch Changes

3.0.12

Patch Changes

3.0.11

Patch Changes

3.0.10

Patch Changes

3.0.9

Patch Changes

3.0.8

Patch Changes

3.0.7

Patch Changes

3.0.6

Patch Changes

3.0.5

Patch Changes

3.0.4

Patch Changes

  • #8324 0752cf368 Thanks @matthewp! - Prevent React hook call warnings when used with MDX

    When React and MDX are used in the same project, if the MDX integration is added before React, previously you'd get a warning about hook calls.

    This makes it so that the MDX integration's JSX renderer is last in order.

3.0.3

Patch Changes

3.0.2

Patch Changes

3.0.1

Patch Changes

  • #8290 ef37f9e29 Thanks @matthewp! - Remove "experimental" text from the image config options, for docs and editor etc. text displayed.

  • #8290 ef37f9e29 Thanks @matthewp! - Prevent astro check cache issues

    astro check hits cache issues in 3.0 causing it never to work on the first try.

  • #8283 c32f52a62 Thanks @ematipico! - Add useful warning when deprecated options are still used.

3.0.0

Major Changes

  • #8188 d0679a666 Thanks @ematipico! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.

  • #8188 364d861bd Thanks @ematipico! - Removed automatic flattening of getStaticPaths result. .flatMap and .flat should now be used to ensure that you're returning a flat array.

  • #8113 2484dc408 Thanks @Princesseuh! - This import alias is no longer included by default with astro:assets. If you were using this alias with experimental assets, you must convert them to relative file paths, or create your own import aliases.

    ---
    // src/pages/posts/post-1.astro
    - import rocket from '~/assets/rocket.png'
    + import rocket from '../../assets/rocket.png';
    ---
    
  • #8142 81545197a Thanks @natemoo-re! - Fixes for the class:list directive

    • Previously, class:list would ocassionally not be merged the class prop when passed to Astro components. Now, class:list is always converted to a class prop (as a string value).
    • Previously, class:list diverged from clsx in a few edge cases. Now, class:list uses clsx directly.
      • class:list used to deduplicate matching values, but it no longer does
      • class:list used to sort individual values, but it no longer does
      • class:list used to support Set and other iterables, but it no longer does
  • #8179 6011d52d3 Thanks @matthewp! - Astro 3.0 Release Candidate

  • #8188 80f1494cd Thanks @ematipico! - The build.split and build.excludeMiddleware configuration options are deprecated and have been replaced by options in the adapter config.

    If your config includes the build.excludeMiddleware option, replace it with edgeMiddleware in your adapter options:

    import { defineConfig } from "astro/config";
    import netlify from "@astrojs/netlify/functions";
    
    export default defineConfig({
         build: {
    -        excludeMiddleware: true
         },
         adapter: netlify({
    +        edgeMiddleware: true
         }),
    });
    

    If your config includes the build.split option, replace it with functionPerRoute in your adapter options:

    import { defineConfig } from "astro/config";
    import netlify from "@astrojs/netlify/functions";
    
    export default defineConfig({
         build: {
    -        split: true
         },
         adapter: netlify({
    +        functionPerRoute: true
         }),
    });
    
  • #8207 e45f30293 Thanks @natemoo-re! - Change the View Transition built-in animation options.

    The transition:animate value morph has been renamed to initial. Also, this is no longer the default animation.

    If no transition:animate directive is specified, your animations will now default to fade.

    Astro also supports a new transition:animate value, none. This value can be used on a page's <html> element to disable animated full-page transitions on an entire page.

  • #8188 c0de7a7b0 Thanks @ematipico! - Sharp is now the default image service used for astro:assets. If you would prefer to still use Squoosh, you can update your config with the following:

    import { defineConfig, squooshImageService } from 'astro/config';
    
    // https://astro.build/config
    export default defineConfig({
      image: {
        service: squooshImageService(),
      },
    });
    

    However, not only do we recommend using Sharp as it is faster and more reliable, it is also highly likely that the Squoosh service will be removed in a future release.

  • #8188 3c3100851 Thanks @ematipico! - Remove support for Astro.__renderMarkdown which is used by @astrojs/markdown-component.

    The <Markdown /> component was deprecated in Astro v1 and is completely removed in v3. This integration must now be removed from your project.

    As an alternative, you can use community packages that provide a similar component like https://github.com/natemoo-re/astro-remote instead.

  • #8019 34cb20021 Thanks @bluwy! - Remove backwards-compatible kebab-case transform for camelCase CSS variable names passed to the style attribute. If you were relying on the kebab-case transform in your styles, make sure to use the camelCase version to prevent missing styles. For example:

    ---
    const myValue = 'red';
    ---
    
    <!-- input -->
    <div style={{ '--myValue': myValue }}></div>
    
    <!-- output (before) -->
    <div style="--my-value:var(--myValue);--myValue:red"></div>
    
    <!-- output (after) -->
    <div style="--myValue:red"></div>
    
    <style>
      div {
    -   color: var(--my-value);
    +   color: var(--myValue);
      }
    </style>
    
  • #8170 be6bbd2c8 Thanks @bluwy! - Remove deprecated config option types, deprecated script/style attributes, and deprecated image export from astro:content

  • #8188 7511a4980 Thanks @ematipico! - When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits of astro:assets such as enforcing alt, no CLS etc to users

  • #7979 dbc97b121 Thanks @bluwy! - Export experimental dev, build, preview, and sync APIs from astro. These APIs allow you to run Astro's commands programmatically, and replaces the previous entry point that runs the Astro CLI.

    While these APIs are experimental, the inline config parameter is relatively stable without foreseeable changes. However, the returned results of these APIs are more likely to change in the future.

    import { dev, build, preview, sync, type AstroInlineConfig } from 'astro';
    
    // Inline Astro config object.
    // Provide a path to a configuration file to load or set options directly inline.
    const inlineConfig: AstroInlineConfig = {
      // Inline-specific options...
      configFile: './astro.config.mjs',
      logLevel: 'info',
      // Standard Astro config options...
      site: 'https://example.com',
    };
    
    // Start the Astro dev server
    const devServer = await dev(inlineConfig);
    await devServer.stop();
    
    // Build your Astro project
    await build(inlineConfig);
    
    // Preview your built project
    const previewServer = await preview(inlineConfig);
    await previewServer.stop();
    
    // Generate types for your Astro project
    await sync(inlineConfig);
    
  • #8188 7d2f311d4 Thanks @ematipico! - Removed support for old syntax of the API routes.

  • #8085 68efd4a8b Thanks @bluwy! - Remove exports for astro/internal/* and astro/runtime/server/* in favour of astro/runtime/*. Add new astro/compiler-runtime export for compiler-specific runtime code.

    These are exports for Astro's internal API and should not affect your project, but if you do use these entrypoints, you can migrate like below:

    - import 'astro/internal/index.js';
    + import 'astro/runtime/server/index.js';
    
    - import 'astro/server/index.js';
    + import 'astro/runtime/server/index.js';
    
    import { transform } from '@astrojs/compiler';
    
    const result = await transform(source, {
    - internalURL: 'astro/runtime/server/index.js',
    + internalURL: 'astro/compiler-runtime',
      // ...
    });
    
  • #7893 7bd1b86f8 Thanks @ematipico! - Implements a new scope style strategy called "attribute". When enabled, styles are applied using data-* attributes.

    The default value of scopedStyleStrategy is "attribute".

    If you want to use the previous behaviour, you have to use the "where" option:

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
    +    scopedStyleStrategy: 'where',
    });
    
  • #7924 519a1c4e8 Thanks @matthewp! - Astro's JSX handling has been refactored with better support for each framework.

    Previously, Astro automatically scanned your components to determine which framework-specific transformations should be used. In practice, supporting advanced features like Fast Refresh with this approach proved difficult.

    Now, Astro determines which framework to use with include and exclude config options where you can specify files and folders on a per-framework basis. When using multiple JSX frameworks in the same project, users should manually control which files belong to each framework using the include and exclude options.

    export default defineConfig({
      // The `include` config is only needed in projects that use multiple JSX frameworks;
      // if only using one no extra config is needed.
      integrations: [
        preact({
          include: ['**/preact/*'],
        }),
        react({
          include: ['**/react/*'],
        }),
        solid({
          include: ['**/solid/*'],
        }),
      ],
    });
    
  • #8030 5208a3c8f Thanks @natemoo-re! - Removed duplicate astro/dist/jsx export. Please use the astro/jsx export instead

  • #8188 84af8ed9d Thanks @ematipico! - Remove MDX plugin re-ordering hack

  • #8180 f003e7364 Thanks @ematipico! - The scoped hash created by the Astro compiler is now lowercase.

  • #7878 0f637c71e Thanks @bluwy! - The value of import.meta.env.BASE_URL, which is derived from the base option, will no longer have a trailing slash added by default or when trailingSlash: "ignore" is set. The existing behavior of base in combination with trailingSlash: "always" or trailingSlash: "never" is unchanged.

    If your base already has a trailing slash, no change is needed.

    If your base does not have a trailing slash, add one to preserve the previous behaviour:

    // astro.config.mjs
    - base: 'my-base',
    + base: 'my-base/',
    
  • #8118 8a5b0c1f3 Thanks @lilnasy! - Astro is smarter about CSS! Small stylesheets are now inlined by default, and no longer incur the cost of additional requests to your server. Your visitors will have to wait less before they see your pages, especially those in remote locations or in a subway.

    This may not be news to you if you had opted-in via the build.inlineStylesheets configuration. Stabilized in Astro 2.6 and set to "auto" by default for Starlight, this configuration allows you to reduce the number of requests for stylesheets by inlining them into