diff options
Diffstat (limited to 'packages/integrations/netlify/CHANGELOG.md')
-rw-r--r-- | packages/integrations/netlify/CHANGELOG.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/packages/integrations/netlify/CHANGELOG.md b/packages/integrations/netlify/CHANGELOG.md index e2ac69e4f..adc4116cb 100644 --- a/packages/integrations/netlify/CHANGELOG.md +++ b/packages/integrations/netlify/CHANGELOG.md @@ -1,5 +1,58 @@ # @astrojs/netlify +## 1.1.0 + +### Minor Changes + +- [#4876](https://github.com/withastro/astro/pull/4876) [`d3091f89e`](https://github.com/withastro/astro/commit/d3091f89e92fcfe1ad48daca74055d54b1c853a3) Thanks [@matthewp](https://github.com/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`): + + ```astro + --- + 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: + + ```js + export function post({ cookies }) { + cookies.set('loggedIn', false); + + return new Response(null, { + status: 302, + headers: { + Location: '/login', + }, + }); + } + ``` + + See [the RFC](https://github.com/withastro/rfcs/blob/main/proposals/0025-cookie-management.md) to learn more. + +### Patch Changes + +- [#4842](https://github.com/withastro/astro/pull/4842) [`812658ad2`](https://github.com/withastro/astro/commit/812658ad2ab3732a99e35c4fd903e302e723db46) Thanks [@bluwy](https://github.com/bluwy)! - Add missing dependencies, support strict dependency installation (e.g. pnpm) + ## 1.0.4 ### Patch Changes |