Astro: @astrojs/node@1.1.0 Release

Release date:
September 29, 2022
Previous version:
@astrojs/node@1.0.1 (released August 31, 2022)
Magnitude:
12,821 Diff Delta
Contributors:
30 total committers
Data confidence:
Commits:

218 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored September 22, 2022
Authored September 7, 2022
Authored September 22, 2022
Authored September 15, 2022
Authored September 29, 2022
Authored September 20, 2022
Authored September 14, 2022
Authored September 22, 2022
Authored September 6, 2022
Authored September 9, 2022
Authored September 16, 2022
Authored September 22, 2022
Authored September 7, 2022
Authored September 21, 2022
Authored September 2, 2022
Authored September 22, 2022

Top Contributors in @astrojs/node@1.1.0

ematipico
Jutanium
bholmesdev
tony-sullivan-525d
mrienstra
rishi-raj-jain-01ee
yuhang-dong
tony-sull
ElianCodes
DerYeger

Directory Browser for @astrojs/node@1.1.0

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

Release Notes Published

Minor Changes

  • #4876 d3091f89e Thanks @matthewp! - Adds the Astro.cookies API

    Astro.cookies is a new API for manipulating cookies in Astro components and API routes.

    In Astro components, the new Astro.cookies object is a map-like object that allows you to get, set, delete, and check for a cookie's existence (has):

    ---
    type Prefs = {
      darkMode: boolean;
    };
    
    Astro.cookies.set<Prefs>(
      'prefs',
      { darkMode: true },
      {
        expires: '1 month',
      }
    );
    
    const prefs = Astro.cookies.get<Prefs>('prefs').json();
    ---
    
    <body data-theme={prefs.darkMode ? 'dark' : 'light'}></body>
    

    Once you've set a cookie with Astro.cookies it will automatically be included in the outgoing response.

    This API is also available with the same functionality in API routes:

    export function post({ cookies }) {
      cookies.set('loggedIn', false);
    
      return new Response(null, {
        status: 302,
        headers: {
          Location: '/login',
        },
      });
    }
    

    See the RFC to learn more.