Astro: [email protected] Release

Release date:
February 28, 2025
Previous version:
[email protected] (released February 27, 2025)
Magnitude:
0 Diff Delta
Contributors:
0 total committers
Data confidence:
Commits:

Top Contributors in [email protected]

Could not determine top contributors for this release.

Directory Browser for [email protected]

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

Patch Changes

  • #13336 8f632ef Thanks @ematipico! - Fixes a regression where some asset utilities were move across monorepo, and not re-exported anymore.

  • #13320 b5dabe9 Thanks @{! - Adds support for typing experimental session data

    You can add optional types to your session data by creating a src/env.d.ts file in your project that extends the global App.SessionData interface. For example:

    declare namespace App {
      interface SessionData {
    
          id: string;
          email: string;
        };
        lastLogin: Date;
      }
    }
    

    Any keys not defined in this interface will be treated as any.

    Then when you access Astro.session in your components, any defined keys will be typed correctly:

    ---
    const user = await Astro.session.get('user');
    //    ^? const: user: { id: string; email: string; } | undefined
    
    const something = await Astro.session.get('something');
    //    ^? const: something: any
    
    Astro.session.set('user', 1);
    //    ^? Argument of type 'number' is not assignable to parameter of type '{ id: string; email: string; }'.
    ---
    

    See the experimental session docs for more information.

  • #13330 5e7646e Thanks @ematipico! - Fixes an issue with the conditional rendering of scripts.

    This change updates a v5.0 breaking change when experimental.directRenderScript became the default script handling behavior.

    If you have already successfully upgraded to Astro v5, you may need to review your script tags again and make sure they still behave as desired after this release. See the v5 Upgrade Guide for more details.