github withastro/astro astro@5.0.0-alpha.0

latest releases: astro@4.15.8, @astrojs/mdx@3.1.7, astro@4.15.7...
pre-releaseone month ago

Major Changes

  • #10742 b6fbdaa Thanks @ematipico! - The lowest version of Node supported by Astro is now Node v18.17.1 and higher.

  • #11715 d74617c Thanks @Princesseuh! - Refactor the exported types from the astro module. There should normally be no breaking changes, but if you relied on some previously deprecated types, these might now have been fully removed.

    In most cases, updating your code to move away from previously deprecated APIs in previous versions of Astro should be enough to fix any issues.

  • #11660 e90f559 Thanks @bluwy! - Fixes attribute rendering for non-boolean HTML attributes with boolean values to match proper attribute handling in browsers.

    Previously, non-boolean attributes may not have included their values when rendered to HTML. In Astro v5.0, the values are now explicitly rendered as ="true" or ="false"

    In the following .astro examples, only allowfullscreen is a boolean attribute:

    <!-- src/pages/index.astro --><!-- `allowfullscreen` is a boolean attribute -->
    <p allowfullscreen={true}></p>
    <p allowfullscreen={false}></p>
    
    <!-- `inherit` is *not* a boolean attribute -->
    <p inherit={true}></p>
    <p inherit={false}></p>
    
    <!-- `data-*` attributes are not boolean attributes -->
    <p data-light={true}></p>
    <p data-light={false}></p>

    Astro v5.0 now preserves the full data attribute with its value when rendering the HTML of non-boolean attributes:

      <p allowfullscreen></p>
      <p></p>
    
      <p inherit="true"></p>
    - <p inherit></p>
    + <p inherit="false"></p>
    
    - <p data-light></p>
    + <p data-light="true"></p>
    - <p></p>
    + <p data-light="false"></p>

    If you rely on attribute values, for example to locate elements or to conditionally render, update your code to match the new non-boolean attribute values:

    - el.getAttribute('inherit') === ''
    + el.getAttribute('inherit') === 'false'
    
    - el.hasAttribute('data-light')
    + el.dataset.light === 'true'
  • #11714 8a53517 Thanks @matthewp! - Remove support for functionPerRoute

    This change removes support for the functionPerRoute option both in Astro and @astrojs/vercel.

    This option made it so that each route got built as separate entrypoints so that they could be loaded as separate functions. The hope was that by doing this it would decrease the size of each function. However in practice routes use most of the same code, and increases in function size limitations made the potential upsides less important.

    Additionally there are downsides to functionPerRoute, such as hitting limits on the number of functions per project. The feature also never worked with some Astro features like i18n domains and request rewriting.

    Given this, the feature has been removed from Astro.

Patch Changes

Don't miss a new astro release

NewReleases is sending notifications on new releases.