- Updated dependencies [
745e632]:- @astrojs/internal-helpers@0.8.0-beta.2
- @astrojs/underscore-redirects@1.0.0
-
#15495
5b99e90Thanks @leekeh! - Adds newmiddlewareModeadapter feature and deprecatesedgeMiddlewareoptionThe
edgeMiddlewareoption is now deprecated and will be removed in a future major release, so users should transition to using the newmiddlewareModefeature as soon as possible.export default defineConfig({ adapter: netlify({ - edgeMiddleware: true + middlewareMode: 'edge' }) })
-
#15679
19ba822Thanks @matthewp! - Fixes server-rendered routes returning 404 errorsA configuration error in the build output prevented Netlify from correctly routing requests to server-rendered pages, causing them to return 404 errors. This fix ensures that all server routes are properly handled by the Netlify SSR function.
-
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#15665
52a7efdThanks @matthewp! - Fixes builds that were failing with "Entry module cannot be external" error when using the Netlify adapterThis error was preventing sites from building after recent internal changes. Your builds should now work as expected without any changes to your code.
-
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#15461
9f21b24Thanks @florian-lefebvre! - Updates to new Adapter API introduced in v6 -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#15460
ee7e53fThanks @florian-lefebvre! - Updates to use the new Adapter API -
#15450
50c9129Thanks @florian-lefebvre! - Fixes a case wherebuild.serverEntrywould not be respected when using the new Adapter API -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- #15413
736216bThanks @florian-lefebvre! - Updates the implementation to use the new Adapter API
- Updated dependencies [
a164c77,a18d727]:- @astrojs/internal-helpers@0.8.0-beta.1
- @astrojs/underscore-redirects@1.0.0
-
#15258
d339a18Thanks @ematipico! - Stabilizes the adapter featureexperimentalStatiHeaders. If you were using this feature in any of the supported adapters, you'll need to change the name of the flag:export default defineConfig({ adapter: netlify({ - experimentalStaticHeaders: true + staticHeaders: true }) })
- Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- Updated dependencies [
240c317]:- @astrojs/internal-helpers@0.8.0-beta.0
- @astrojs/underscore-redirects@1.0.0
-
#15006
f361730Thanks @florian-lefebvre! - Adds new session driver object shapeFor greater flexibility and improved consistency with other Astro code, session drivers are now specified as an object:
-import { defineConfig } from 'astro/config' +import { defineConfig, sessionDrivers } from 'astro/config' export default defineConfig({ session: { - driver: 'redis', - options: { - url: process.env.REDIS_URL - }, + driver: sessionDrivers.redis({ + url: process.env.REDIS_URL + }), } })
Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver.
- Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- #14946
95c40f7Thanks @ematipico! - Removes theexperimental.cspflag and replaces it with a new configuration optionsecurity.csp- (v6 upgrade guidance)
- Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- #14445
ecb0b98Thanks @florian-lefebvre! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)
- Updated dependencies [
ece667a,861b9cc,ece667a,9fdfd4c,91780cf,9fdfd4c,b1d87ec,049da87,727b0a2,55a1a91,669ca5b,df6d2d7,9fdfd4c,e131261,c69c7de,666d5a7,4f11510,25fe093,9c282b5,ecb0b98,6f67c6e,36a461b,3bda3ce]:- astro@6.0.0-alpha.0
-
#15199
d8e64efThanks @ArmandPhilippot! - Fixes the links to Astro Docs so that they match the current docs structure. -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14807
c17767aThanks @jmgala! - Fixes a case where disabling the local image CDN wasn't possible -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14716
0419985Thanks @serhalp! - Upgrades the@netlify/functionsdependency to v5. This removes 82 MB and 310 dependencies from the dependency tree -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- Updated dependencies [
9e9c528,0f75f6b]:- @astrojs/internal-helpers@0.7.5
- @astrojs/underscore-redirects@1.0.0
-
#14543
9b3241dThanks @matthewp! - Enables Netlify's skew protection feature for Astro sites deployed on Netlify. Skew protection ensures that your site's client and server versions stay synchronized during deployments, preventing issues where users might load assets from a newer deployment while the server is still running the older version.When you deploy to Netlify, the deployment ID is now automatically included in both asset requests and API calls, allowing Netlify to serve the correct version to every user. These are set for built-in features (Actions, View Transitions, Server Islands, Prefetch). If you are making your own fetch requests to your site, you can include the header manually using the
DEPLOY_IDenvironment variable:const response = await fetch('/api/endpoint', { headers: { 'X-Netlify-Deploy-ID': import.meta.env.DEPLOY_ID, }, });
- Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14536
9261996Thanks @florian-lefebvre! - Fixes a bug that caused too many files to be bundled in SSR -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14473
d9634d3Thanks @florian-lefebvre! - Fixes a bug that caused too many files to be bundled in SSR -
Updated dependencies [
b8ca69b]:- @astrojs/internal-helpers@0.7.4
- @astrojs/underscore-redirects@1.0.0
- Updated dependencies [
1e2499e]:- @astrojs/internal-helpers@0.7.3
- @astrojs/underscore-redirects@1.0.0
-
#14326
c24a8f4Thanks @jsparkdev! - Updatesviteversion to fix CVE -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14269
4823c42Thanks @florian-lefebvre! - Updatescontext.netlifyto implement all its properties -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14240
77b18fbThanks @delucis! - Increases the minimum supported version of Astro to 5.7.0 -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- Updated dependencies [
4d16de7]:- @astrojs/internal-helpers@0.7.2
- @astrojs/underscore-redirects@1.0.0
- #14175
1e1cef0Thanks @ematipico! - Fixes a bug where the adapter would cause a runtime error when callingastro buildin CI environments.
- Updated dependencies [
0567fb7]:- @astrojs/internal-helpers@0.7.1
- @astrojs/underscore-redirects@1.0.0
- Updated dependencies [
f4e8889]:- @astrojs/internal-helpers@0.7.0
- @astrojs/underscore-redirects@1.0.0
-
#14120
798b5faThanks @ascorbic! - Adds mock feature flags in dev -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14103
69d6871Thanks @ascorbic! - Upgrades Netlify Vite plugin to fix error in edge functions. -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#14078
38c2255Thanks @ascorbic! - Fixes a bug that caused remote images to sometimes not display correctly when using the Netlify Image CDN in local dev -
#14078
38c2255Thanks @ascorbic! - Adds a newdevFeaturesconfiguration option to control some of the behaviors introduced in@astrojs/netlify@6.5.0, which introduced Netlify production features into the dev environment.You can now individually configure whether or not to populate your environment with the variables from your linked Netlify site (now disabled by default), and use a local version of the Netlify Image CDN for images (still enabled by default) when running
astro dev.Additionally, the adapter no longer injects environment variables from Netlify by default when running
astro dev.@astrojs/netlify@6.5.0introduced a potentially breaking change that enabled injecting Netlify environment variables inastro devby default. This could lead to unexpected behavior in Astro projects that do not expect these variables to be present. This now defaults to disabled, and users can enable it by setting thedevFeatures.environmentVariablesoption in their Astro config. Similarly, you can usedevFeatures.imagesto disable using the Netlify Image CDN locally if needed:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify'; export default defineConfig({ adapter: netlify({ devFeatures: { environmentVariables: true, images: false, }, }), });
You can also set
devFeaturestotrueorfalseto enable or disable all configurable dev features:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify'; export default defineConfig({ adapter: netlify({ devFeatures: true, }), });
-
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- #13768
faa0effThanks @eduardoboucas! - Updates the adapter to use Netlify's Vite plugin in development.
This is an implementation update that does not require any change to your project code, but means that astro dev will run with an environment closer to a production deploy on Netlify. This brings several benefits you'll now notice working in dev mode!
For example, your project running in development mode will now use local versions of the Netlify Image CDN for images, and a local Blobs server for sessions. It will also populate your environment with the variables from your linked Netlify site.
While not required for fully static, prerendered web sites, you may still wish to add this for the additional benefits of now working in a dev environment closer to your Netlify production deploy, as well as to take advantage of Netlify-exclusive features such as the Netlify Image CDN.
- Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
- #13972
db8f8beThanks @ematipico! - Fixes the internal implementation of the new featureexperimentalStaticHeaders, where dynamic routes were mapped to use always the same header. - Updated dependencies []:
- @astrojs/underscore-redirects@1.0.0
-
#13952
de82ef2Thanks @ematipico! - Adds support for the experimental static headers Astro feature.When the feature is enabled via option
experimentalStaticHeaders, and experimental Content Security Policy is enabled, the adapter will generateResponseheaders for static pages, which allows support for CSP directives that are not supported inside a<meta>tag (e.g.frame-ancestors).import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify'; export default defineConfig({ adapter: netlify({ experimentalStaticHeaders: true, }), experimental: { cps: true, }, });
-
#13799
7036b05Thanks @Lofty-Brambles! - Fixes an issue where the adapter didn't take into consideration theoutDirconfiguration. -
#13830
9371a67Thanks @Lofty-Brambles! - Fixes an issue with SVGs not rendering with image-cdn enabled, due to invalid source path parsing. -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.1
-
#13792
7910feaThanks @alexeyzimarev! - Unify imported images detection across adapters -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.1
-
#13731
c3e80c2Thanks @jsparkdev! - update vite to latest version for fixing CVE -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.1
-
#13591
5dd2d3fThanks @florian-lefebvre! - Removes unused code -
Updated dependencies [
5dd2d3f]:- @astrojs/underscore-redirects@0.6.1
-
#13527
2fd6a6bThanks @ascorbic! - The experimental session API introduced in Astro 5.1 is now stable and ready for production use.Sessions are used to store user state between requests for on-demand rendered pages. You can use them to store user data, such as authentication tokens, shopping cart contents, or any other data that needs to persist across requests:
--- export const prerender = false; // Not needed with 'server' output const cart = await Astro.session.get('cart'); --- <a href="/checkout">🛒 {cart?.length ?? 0} items</a>
Sessions require a storage driver to store the data. The Node, Cloudflare and Netlify adapters automatically configure a default driver for you, but other adapters currently require you to specify a custom storage driver in your configuration.
If you are using an adapter that doesn't have a default driver, or if you want to choose a different driver, you can configure it using the
sessionconfiguration option:import { defineConfig } from 'astro/config'; import vercel from '@astrojs/vercel'; export default defineConfig({ adapter: vercel(), session: { driver: 'upstash', }, });
Sessions are available in on-demand rendered pages, API endpoints, actions and middleware.
In pages and components, you can access the session using
Astro.session:--- const cart = await Astro.session.get('cart'); --- <a href="/checkout">🛒 {cart?.length ?? 0} items</a>
In endpoints, actions, and middleware, you can access the session using
context.session:export async function GET(context) { const cart = await context.session.get('cart'); return Response.json({ cart }); }
If you attempt to access the session when there is no storage driver configured, or in a prerendered page, the session object will be
undefinedand an error will be logged in the console:--- export const prerender = true; const cart = await Astro.session?.get('cart'); // Logs an error. Astro.session is undefined ---
If you were previously using the experimental API, please remove the
experimental.sessionflag from your configuration:import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; export default defineConfig({ adapter: node({ mode: "standalone", }), - experimental: { - session: true, - }, });See the sessions guide for more information.
- Updated dependencies []:
- @astrojs/underscore-redirects@0.6.0
-
#13596
3752519Thanks @jsparkdev! - update vite to latest version to fix CVE -
#13547
360cb91Thanks @jsparkdev! - Updates vite to the latest version -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.0
-
#13526
ff9d69eThanks @jsparkdev! - updateviteto the latest version -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.0
-
#13505
a98ae5bThanks @ematipico! - Updates the dependencyviteto the latest. -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.0
- Updated dependencies [
042d1de]:- @astrojs/internal-helpers@0.6.1
- @astrojs/underscore-redirects@0.6.0
-
#13323
80926faThanks @ematipico! - Updatesesbuildandviteto the latest to avoid false positives audits warnings caused byesbuild. -
Updated dependencies [
1e11f5e]:- @astrojs/internal-helpers@0.6.0
- @astrojs/underscore-redirects@0.6.0
-
#13299
2e1321eThanks @bluwy! - Usestinyglobbyfor globbing files -
Updated dependencies []:
- @astrojs/underscore-redirects@0.6.0
-
#13194
1b5037bThanks @dfdez! - AddsincludedFilesandexcludedFilesconfiguration options to customize SSR function bundle contents.The
includeFilesproperty allows you to explicitly specify additional files that should be bundled with your function. This is useful for files that aren't automatically detected as dependencies, such as:- Data files loaded using
fsoperations - Configuration files
- Template files
Similarly, you can use the
excludeFilesproperty to prevent specific files from being bundled that would otherwise be included. This is helpful for:- Reducing bundle size
- Excluding large binaries
- Preventing unwanted files from being deployed
import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify'; export default defineConfig({ // ... output: 'server', adapter: netlify({ includeFiles: ['./my-data.json'], excludeFiles: ['./node_modules/package/**/*', './src/**/*.test.js'], }), });
See the Netlify adapter documentation for detailed usage instructions and examples.
- Data files loaded using
-
#13145
8d4e566Thanks @ascorbic! - Automatically configures Netlify Blobs storage when experimental session enabledIf the
experimental.sessionflag is enabled when using the Netlify adapter, Astro will automatically configure the session storage using the Netlify Blobs driver. You can still manually configure the session storage if you need to use a different driver or want to customize the session storage configuration.See the experimental session docs for more information on configuring session storage.
- Updated dependencies []:
- @astrojs/underscore-redirects@0.6.0
- #496
4b5cd22Thanks @florian-lefebvre! - Stabilizesastro:envsecrets support
-
#454
83cedadThanks @alexanderniebuhr! - Improves Astro 5 support -
#501
012b31dThanks @florian-lefebvre! - Refactor of the redirects logic
-
#481
9d98b8aThanks @ascorbic! - Fixes an error where edge middleware would incorrectly assign locals -
#488
f3739beThanks @ascorbic! - Correctly pass Netlify context in edge middleware
-
#367
e02b54aThanks @alexanderniebuhr! - Removed support for the Squoosh image service. As the underlying librarylibsquooshis no longer maintained, and the image service sees very little usage we have decided to remove it from Astro.Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained.
- import { squooshImageService } from "astro/config"; import { defineConfig } from "astro/config"; export default defineConfig({ - image: { - service: squooshImageService() - } });
If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh
-
#367
e02b54aThanks @alexanderniebuhr! - Deprecates thefunctionPerRouteoptionThis option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to:
import { defineConfig } from 'astro/config'; import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ // ... output: 'server', adapter: vercel({ - functionPerRoute: true, }), }); -
#375
e7881f7Thanks @Princesseuh! - Updates internal code to works with Astro 5 changes to hybrid rendering. No changes are necessary to your project, apart from using Astro 5 -
#397
776a266Thanks @Princesseuh! - Welcome to the Astro 5 beta! This release has no changes from the latest alpha of this package, but it does bring us one step closer to the final, stable release.Starting from this release, no breaking changes will be introduced unless absolutely necessary.
To learn how to upgrade, check out the Astro v5.0 upgrade guide in our beta docs site.
-
#451
f248546Thanks @ematipico! - Updates esbuild dependency to v0.24.0 -
#392
3a49eb7Thanks @Princesseuh! - Updates internal code for Astro 5 changes. No changes is required to your project, apart from using Astro 5
- #385
bb725b7Thanks @florian-lefebvre! - Cleans upastro:envsupport
-
#367
e02b54aThanks @alexanderniebuhr! - Removed support for the Squoosh image service. As the underlying librarylibsquooshis no longer maintained, and the image service sees very little usage we have decided to remove it from Astro.Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained.
- import { squooshImageService } from "astro/config"; import { defineConfig } from "astro/config"; export default defineConfig({ - image: { - service: squooshImageService() - } });
If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh
-
#367
e02b54aThanks @alexanderniebuhr! - Deprecates thefunctionPerRouteoptionThis option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to:
import { defineConfig } from 'astro/config'; import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ // ... output: 'server', adapter: vercel({ - functionPerRoute: true, }), }); -
#375
e7881f7Thanks @Princesseuh! - Updates internal code to works with Astro 5 changes to hybrid rendering. No changes are necessary to your project, apart from using Astro 5 -
#397
776a266Thanks @Princesseuh! - Welcome to the Astro 5 beta! This release has no changes from the latest alpha of this package, but it does bring us one step closer to the final, stable release.Starting from this release, no breaking changes will be introduced unless absolutely necessary.
To learn how to upgrade, check out the Astro v5.0 upgrade guide in our beta docs site.
-
#392
3a49eb7Thanks @Princesseuh! - Updates internal code for Astro 5 changes. No changes is required to your project, apart from using Astro 5
- #385
bb725b7Thanks @florian-lefebvre! - Cleans upastro:envsupport
- #388
3f280f1Thanks @hrishikesh-k! - Allows-in hostnames for Netlify Image CDN RegEx
-
#350
2248bc7Thanks @matthewp! - Apply polyfills immediately on function executionThis moves up when the polyfills are applied so that they are present before Astro runs, preventing a race condition that can cause
cryptoto not be defined early enough in Node 18.
- #315
a45eb36Thanks @eduardoboucas! - Refactors the adapter to use the Netlify Frameworks API
- #286
e2ecf64Thanks @theoephraim! - Allows support fornode:prefixed imports if using the Adapter withedgeMiddleware: true
- #316
d81806aThanks @ascorbic! - Fixes a regression where edge middleware tried to bundle node builtins
- #313
55a3e1aThanks @ascorbic! - Fixes an issue where files were not included in the SSR function when built in a monorepo
- #296
8a00cadThanks @ascorbic! - Improves performance for serverless function builds by not bundling dependencies
- #293
ee840faThanks @florian-lefebvre! - Fixesastro:envgetSecret compatibility
- #282
65337f3Thanks @alexanderniebuhr! - Fixes backwards compatibility with Astro <= 4.9
- #275
4a28bf6Thanks @florian-lefebvre! - Adds support for experimentalastro:envreleased in Astro 4.10
- #255
3fa962dThanks @ascorbic! - Fixes an issue with edge middleware whereprocess.envwas not defined, by using a polyfill to shim it
- #187
79ebfa4c9e2f84309edb35481ad9cd1f3c7e5eb4Thanks @ascorbic! - Adds support forimage.remotePatternsandimages.domainswith Netlify Image CDN
- #163
bc9ee99c7333ae29e4d4184059c09650330fd0d9Thanks @OiYouYeahYou! - Fixes an issue where some astro CLI commands failed withcrypto is not definedon Astro 4.4.0 and earlier.
- #160
994985547c2d2bc8c66b76f996257e68f8187a14Thanks @lilnasy! - Fixes an issue where enablingedgeMiddlewarefailed to bundle a dependency (cssesc) introduced in Astro 4.2.5.
- #162
07217c07e89d4596b464d05c4873e7039aa616f4Thanks @Skn0tt! - Fixes bug where prerendered 404 pages were served astext/plaininstead oftext/htmlfor hybrid/server apps, leading to browsers displaying source code instead of rendering it
-
#152
816bdc42e0665904e418dd0137bd6a7c8c74307fThanks @lilnasy! - Implements verification for edge middleware. This is a security measure to ensure that your serverless functions are only ever called by your edge middleware and not by a third party.When
edgeMiddlewareis enabled, the serverless function will now respond with403 Forbiddenfor requests that are not verified to have come from the generated edge middleware. No user action is necessary.
- #143
06bae52f26d1df1368581aa859f332141db00c1bThanks @Skn0tt! - Fixes a bug in the Netlify Adapter where prerendered 404.astro pages weren't shown on hybrid/server deployments.
- #130
2b5aaa4cfeda4bc7f1bf8db6210162c495866a95Thanks @asdfjkalsdfla! - Updates the internals of the integration to support Astro 4.0. See this upstream pull request for additional details. Warning: Make sure to upgrade your Astro version to>4.2as previous versions are no longer supported.
- #127
36434f0c631cb963c748a11679cf7a96cd605d8eThanks @Skn0tt! - Updates the behavior of thecacheOnDemandPagessetting to only cache GET/HEAD requests by default
- #117
89f7c01Thanks @alexanderniebuhr! - Updates Netlify README.md
-
#84
ca64544Thanks @Skn0tt! - # Netlify Adapter v4 simplifies static + SSR deploymentsThis update is a complete overhaul of the Netlify adapter. It simplifies the user-facing config, and resolves a number of bugs along the way.
Here's what changes:
In v3, you could use
netlify-edge-middleware.tsto inject data from the Netlify context into your Astro locals. In v4, this file is no longer needed because the Netlify context is automatically made available viaAstro.locals.netlify.context. You can use this context to access information about the user (like geolocation or IP address), your Netlify site (like deploy ID) or the request (like its request ID or the CDN region it's served from).Action Required: Remove the
netlify-edge-middleware.tsornetlify-edge-middleware.jsfile. In your codebase, change all usage of locals injected through that file to useAstro.locals.netlify.contextinstead.v4 of this adapter integrates your Astro site with Netlify Image CDN. This allows transforming images on-the-fly without impacting build times. It's implemented using an Astro Image Service, and enabled by default.
On-Demand Builders (ODB) allows SSR-Rendered pages to be cached using a Time to Live (TTL) strategy. While the Netlify platform continues to support existing pages with ODBs, we now recommend using the much more powerful Fine-Grained Cache Control going forward.
In v3, you could deploy your SSR-Rendered Astro pages to ODBs by enabling the
buildersconfig option, and then specifying the TTL on a per-page basis. In v4, a newcacheOnDemandPagesoption replaces this config option. Take a look at the README to learn more about this.Action Required: Replace the
buildersconfig option withcacheOnDemandPages.// astro.config.mjs export default defineConfig({ // ... adapter: netlify({ - builders: true + cacheOnDemandPages: true }), });In v3, the
functionPerRouteoption allowed the SSR routes to be split up into multiple Netlify Functions. This reduced the bundle sizes of each individual function, with the intention of speeding up code parsing, and therefore the time of cold starts. In practice, this benefit is often nullified by the increase in number of cold starts - more handlers means fewer requests per handler, means more cold starts.In v4, support for this deployment mode was removed.
Action Required: Remove the
functionPerRoutefield from your config.binaryMediaTypeswas a workaround required for some Astro endpoints, because v3 deployed those as "old" Netlify Functions (now referred to as "Lambda Compatibility Mode"). v4 uses the new Netlify Functions 2.0, which simply doesn't need this workaround anymore - so we're removing it 🎉Action Required: Remove the
binaryMediaTypesfield from your config.
- #100
1195955Thanks @Jinksi! - Fixes a typo for the peerDependency range in package.json, which prevents upgrade to Astro 4.0.
- #96
f1df277Thanks @alexanderniebuhr! - Fixes an issue where this package could not be installed alongside Astro 4.0.
- #51
acf4c82Thanks @alexanderniebuhr! - Updates dependencies
- #21
09d2504Thanks @alexanderniebuhr! - Updates repository information
-
#8661
008f7647cThanks @Skn0tt! - fix build failures because of CJS builds and top-level await -
Updated dependencies [
69fbf95b2]:- astro@3.1.4
- @astrojs/underscore-redirects@0.3.0
-
Updated dependencies [
c5633434f,405ad9501,6b1e79814]:- astro@3.0.7
- @astrojs/underscore-redirects@0.3.0
-
#8188
d0679a666Thanks @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. -
#8179
6011d52d3Thanks @matthewp! - Astro 3.0 Release Candidate -
#8188
7511a4980Thanks @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 ofastro:assetssuch as enforcingalt, no CLS etc to users -
#8188
148e61d24Thanks @ematipico! - Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm. -
#8029
2ee418e06Thanks @matthewp! - Remove the Netlify Edge adapter@astrojs/netlify/functionsnow supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change:// astro.config.mjs import { defineConfig } from 'astro/config'; - import netlify from '@astrojs/netlify/edge'; + import netlify from '@astrojs/netlify/functions'; export default defineConfig({ output: 'server', adapter: netlify({ + edgeMiddleware: true }), });This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serverless + Edge Middleware, we are removing the Edge adapter.
-
#8188
cd2d7e769Thanks @ematipico! - Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter can tell Astro if it can support it.import { AstroIntegration } from './astro'; function myIntegration(): AstroIntegration { return { name: 'astro-awesome-list', // new feature map supportedAstroFeatures: { hybridOutput: 'experimental', staticOutput: 'stable', serverOutput: 'stable', assets: { supportKind: 'stable', isSharpCompatible: false, isSquooshCompatible: false, }, }, }; }
-
#8188
80f1494cdThanks @ematipico! - Thebuild.splitandbuild.excludeMiddlewareconfiguration options are deprecated and have been replaced by options in the adapter config.If your config includes the
build.excludeMiddlewareoption, replace it withedgeMiddlewarein 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.splitoption, replace it withfunctionPerRoutein your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - split: true }, adapter: netlify({ + functionPerRoute: true }), });
- Updated dependencies [
d0679a666,db39206cb,adf9fccfd,0c7b42dc6,46c4c0e05,364d861bd,2484dc408,81545197a,6011d52d3,c2c71d90c,cd2d7e769,80f1494cd,e45f30293,c0de7a7b0,65c354969,3c3100851,34cb20021,a824863ab,44f7a2872,1048aca55,be6bbd2c8,9e021a91c,7511a4980,c37632a20,acf652fc1,42785c7b7,8450379db,dbc97b121,7d2f311d4,2540feedb,ea7ff5177,68efd4a8b,7bd1b86f8,036388f66,519a1c4e8,1f58a7a1b,2ae9d37f0,a8f35777e,70f34f5a3,5208a3c8f,84af8ed9d,f003e7364,ffc9e2d3d,732111cdc,0f637c71e,33b8910cf,8a5b0c1f3,148e61d24,e79e3779d,632579dc2,3674584e0,1db4e92c1,e7f872e91,16f09dfff,4477bb41c,55c10d1d5,3e834293d,96beb883a,997a0db8a,80f1494cd,0f0625504,e1ae56e72,f32d093a2,f01eb585e,b76c166bd,a87cbe400,866ed4098,767eb6866,32669cd47]:- astro@3.0.0
- @astrojs/underscore-redirects@0.3.0
- Updated dependencies [
adf9fccfd,582132328,81545197a,6011d52d3,be6bbd2c8,42785c7b7,95120efbe,2ae9d37f0,f003e7364,732111cdc,33b8910cf,e79e3779d,179796405,a87cbe400,767eb6866]:- astro@3.0.0-rc.5
- @astrojs/underscore-redirects@0.3.0-rc.1
-
#8029
2ee418e06Thanks @matthewp! - Remove the Netlify Edge adapter@astrojs/netlify/functionsnow supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change:// astro.config.mjs import { defineConfig } from 'astro/config'; - import netlify from '@astrojs/netlify/edge'; + import netlify from '@astrojs/netlify/functions'; export default defineConfig({ output: 'server', adapter: netlify({ + edgeMiddleware: true }), });This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serverless + Edge Middleware, we are removing the Edge adapter.
- Updated dependencies [
65c354969,3c3100851,34cb20021,7bd1b86f8,519a1c4e8,70f34f5a3,0f637c71e,866ed4098,5b1e39ef6]:- astro@3.0.0-beta.1
- @astrojs/underscore-redirects@0.3.0-beta.0
-
1eae2e3f7Thanks @Princesseuh! - 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. -
c022a4217Thanks @Princesseuh! - 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 ofastro:assetssuch as enforcingalt, no CLS etc to users -
3dc1ca2faThanks @Princesseuh! - Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm.
-
9b4f70a62Thanks @ematipico! - Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter can tell Astro if it can support it.import { AstroIntegration } from './astro'; function myIntegration(): AstroIntegration { return { name: 'astro-awesome-list', // new feature map supportedAstroFeatures: { hybridOutput: 'experimental', staticOutput: 'stable', serverOutput: 'stable', assets: { supportKind: 'stable', isSharpCompatible: false, isSquooshCompatible: false, }, }, }; }
-
3fdf509b2Thanks @ematipico! - Thebuild.splitandbuild.excludeMiddlewareconfiguration options are deprecated and have been replaced by options in the adapter config.If your config includes the
build.excludeMiddlewareoption, replace it withedgeMiddlewarein 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.splitoption, replace it withfunctionPerRoutein your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - split: true }, adapter: netlify({ + functionPerRoute: true }), });
- Updated dependencies [
1eae2e3f7,76ddef19c,9b4f70a62,3fdf509b2,2f951cd40,c022a4217,67becaa58,bc37331d8,dfc2d93e3,3dc1ca2fa,1be84dfee,35f01df79,3fdf509b2,78de801f2,59d6e569f,7723c4cc9,fb5cd6b56,631b9c410]:- astro@3.0.0-beta.0
- @astrojs/underscore-redirects@0.3.0-beta.0
-
#7975
f974c95a2Thanks @lilnasy! - If you are using Netlify's On-demand Builders, you can now specify how long your pages should remain cached. By default, all pages will be rendered on first visit and reused on every subsequent visit until a redeploy. To set a custom revalidation time, call theruntime.setBuildersTtl()local in either your frontmatter or middleware.--- import Layout from '../components/Layout.astro'; if (import.meta.env.PROD) { // revalidates every 45 seconds Astro.locals.runtime.setBuildersTtl(45); } --- <Layout title="Astro on Netlify"> {new Date(Date.now())} </Layout>
-
#7862
1859960d0Thanks @Yan-Thomas! - Fix README GitHub search link -
#7754
298dbb89fThanks @natemoo-re! - Improve404behavior forserverlessandedge -
Updated dependencies [
298dbb89f,9e2203847,5c5da8d2f,0b8375fe8,89d015db6,ebf7ebbf7]:- astro@2.9.7
-
#7805
42a21b5daThanks @matthewp! - Prevent building .html file redirects in hybrid mode -
Updated dependencies [
31c4031ba,5161cf919,59b556232,267487e63,b063a2d8a,d5f526b33,7dbcbc86b]:- astro@2.9.4
-
#7700
a77741d25Thanks @delucis! - When a project uses the newbuild.excludeMiddlewareAstro config option, the@astrojs/netlify/functionsadapter will bundle your middleware to run in a Netlify Edge Function.See the Netlify adapter documentation for more details.
-
#7615
f21357b69Thanks @ematipico! - The Netlify adapter builds to a single function by default. Astro 2.7 added support for splitting your build into separate entry points per page. If you use this configuration, the Netlify adapter will generate a separate function for each page. This can help reduce the size of each function so they are only bundling code used on that page.// astro.config.mjs import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify/functions'; export default defineConfig({ output: 'server', adapter: netlify(), build: { split: true, }, });
-
#7067
57f8d14c0Thanks @matthewp! - Support for experimental redirectsThis adds support for the redirects RFC in the Netlify adapter, including a new
@astrojs/netlify/staticadapter for static sites.No changes are necessary when using SSR. Simply use configured redirects and the adapter will update your
_redirectsfile.
-
#7260
39403c32fThanks @natemoo-re! - Unflags support foroutput: 'hybrid'mode, which enables pre-rendering by default. The additionalexperimental.hybridOutputflag can be safely removed from your configuration. -
Updated dependencies [
57f8d14c0,414eb19d2,a7e2b37ff,dd1a6b6c9,d72cfa7ca,144813f73,b5213654b,e3b8c6296,890a2bc98,39403c32f,101f03209]:- astro@2.6.0
-
#6991
719002ca5Thanks @MoustaphaDev! - Enable experimental support for hybrid SSR with pre-rendering enabled by defaultastro.config.mjs
import { defineConfig } from 'astro/config'; export defaultdefineConfig({ output: 'hybrid', experimental: { hybridOutput: true, }, })
Then add
export const prerender = falseto any page or endpoint you want to opt-out of pre-rendering.src/pages/contact.astro
--- export const prerender = false; if (Astro.request.method === 'POST') { // handle form submission } --- <form method="POST"> <input type="text" name="name" /> <input type="email" name="email" /> <button type="submit">Submit</button> </form>
-
#7104
826e02890Thanks @bluwy! - Specify"files"field to only publish necessary files -
Updated dependencies [
4516d7b22,e186ecc5e,c6d7ebefd,914c439bc,e9fc2c221,075eee08f,719002ca5,fc52681ba,fb84622af,cada10a46,cd410c5eb,73ec6f6c1,410428672,763ff2d1e,c1669c001,3d525efc9]:- astro@2.5.0
- #6793
1e3873c04Thanks @andremralves! - fix: no edge functions deployed to netlify
-
#6651
416ceb973Thanks @matthewp! - Use Deno API to set Astro.clientAddress in Netlify Edge -
Updated dependencies [
72fed684a,45bff6fcc,52d7a4a01,9e88e0f23,fa84f1a7d,a98f6f418,7f74326b7]:- astro@2.2.1
- #6213
afbbc4d5bThanks @Princesseuh! - Updated compilation settings to disable downlevelling for Node 14
- Updated dependencies [
fec583909,b087b83fe,694918a56,a20610609,a4a74ab70,75921b3cd,afbbc4d5b]:- astro@2.1.0
- @astrojs/webapi@2.1.0
-
#6323
5e26bc891Thanks @Princesseuh! - Updated Undici to 5.20.0. This fixes a security issue and handling of cookies in certain cases in dev -
#6317
2eb73cb9dThanks @bluwy! - Use .mjs extension when building to support CJS environments -
Updated dependencies [
5e26bc891,a156ecbb7,ccd72e6bb,504c7bacb,63dda6ded,f91a7f376]:- astro@2.0.15
-
#6117
32abe49bdThanks @Princesseuh! - Fix polyfills not being available in certain cases -
Updated dependencies [
f6fc662c3,592386b75,1b591a143,bf8d7366a,ec38a8921,f20a85b64,9f22ac3d0,cee70f5c6,ac7fb04d6,d1f5611fe,2189170be,32abe49bd]:- astro@2.0.7
- #5874
1c230f103Thanks @juanmiguelguerrero! - Addbuildersconfig option for Netlify On-demand Builders.
- Updated dependencies [
b4432cd6b,98a4a914b,071e1dee7,322e059d0,b994f6f35,12c68343c]:- astro@2.0.3
-
#5584
9963c6e4d& #5842c4b0cb8bfThanks @wulinsheng123 and @natemoo-re! - Breaking Change: client assets are built to an_astrodirectory in the build output directory. Previously these were built to various locations, includingassets/,chunks/and the root of build output.You can control this location with the new
buildconfiguration option namedassets. -
#5707
5eba34fccThanks @bluwy! - Removeastro:build:startbackwards compatibility code -
#5806
7572f7402Thanks @matthewp! - Make astro a peerDependency of integrationsThis marks
astroas a peerDependency of several packages that are already gettingmajorversion bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.
-
#5768
2f6745019Thanks @Princesseuh! - Fix set-cookies not working in certain cases when using Node 18+ -
#5904
f5adbd6b5Thanks @matthewp! - Support prerender in _redirects -
#5885
8f1ae06e5Thanks @natemoo-re! - Fix issue with prerendered pages when usingedge-functionsadapter -
Updated dependencies [
93e633922,16dc36a87,01f3f463b,e2019be6f,05caf445d,49ab4f231,a342a486c,8fb28648f,1f92d64ea,c2180746b,ae8a012a7,cf2de5422,ce5c5dbd4,ec09bb664,665a2c222,259a539d7,f7aa1ec25,4987d6f44,304823811,302e0ef8f,55cea0a9d,dd56c1941,9963c6e4d,46ecd5de3,be901dc98,f6cf92b48,e818cc046,8c100a6fe,116d8835c,840412128,1f49cddf9,7325df412,16c7d0bfd,c55fbcb8e,a9c292026,2a5786419,4a1cabfe6,a8d3e7924,fa8c131f8,64b8082e7,c4b0cb8bf,1f92d64ea,23dc9ea96,63a6ceb38,a3a7fc929,52209ca2a,5fd9208d4,5eba34fcc,899214298,3a00ecb3e,5eba34fcc,2303f9514,1ca81c16b,b66d7195c]:- astro@2.0.0
- @astrojs/webapi@2.0.0
-
#5904
f5adbd6b5Thanks @matthewp! - Support prerender in _redirects -
Updated dependencies [
4987d6f44,304823811,46ecd5de3,7325df412,a8d3e7924,5fd9208d4]:- astro@2.0.0-beta.4
- @astrojs/webapi@2.0.0-beta.1
-
#5885
8f1ae06e5Thanks @natemoo-re! - Fix issue with prerendered pages when usingedge-functionsadapter -
Updated dependencies [
16dc36a87,05caf445d,a342a486c,ce5c5dbd4,be901dc98,e818cc046,8c100a6fe,64b8082e7,899214298,3a00ecb3e,1ca81c16b,b66d7195c]:- astro@2.0.0-beta.3
-
#5842
c4b0cb8bfThanks @natemoo-re! - Breaking Change: client assets are built to an_astrodirectory in the build output directory. Previously these were built to various locations, includingassets/,chunks/and the root of build output.You can control this location with the new
buildconfiguration option namedassets. -
#5806
7572f7402Thanks @matthewp! - Make astro a peerDependency of integrationsThis marks
astroas a peerDependency of several packages that are already gettingmajorversion bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.
- Updated dependencies [
01f3f463b,1f92d64ea,c2180746b,ae8a012a7,cf2de5422,ec09bb664,665a2c222,f7aa1ec25,302e0ef8f,840412128,1f49cddf9,c55fbcb8e,4a1cabfe6,c4b0cb8bf,1f92d64ea,23dc9ea96,63a6ceb38,52209ca2a,2303f9514]:- astro@2.0.0-beta.2
- @astrojs/webapi@2.0.0-beta.0
- #5768
2f6745019Thanks @Princesseuh! - Fix set-cookies not working in certain cases when using Node 18+
-
#5297
d2960984cThanks @natemoo-re! - Introduces the experimental Prerender API.Note This API is not yet stable and is subject to possible breaking changes!
- Deploy an Astro server without sacrificing the speed or cacheability of static HTML.
- The Prerender API allows you to statically prerender specific
pages/at build time.
Usage
- First, run
astro build --experimental-prerenderor enableexperimental: { prerender: true }in yourastro.config.mjsfile. - Then, include
export const prerender = truein any file in thepages/directory that you wish to prerender.
-
#5056
e55af8a23Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server(the server code for SSR),client(your client-side JavaScript and assets), andserverEntry(the name of the entrypoint server module). Here are the defaults:import { defineConfig } from 'astro/config'; export default defineConfig({ output: 'server', build: { server: './dist/server/', client: './dist/client/', serverEntry: 'entry.mjs', }, });
These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
The integration hook
astro:build:startincludes a parambuildConfigwhich includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.configoptions. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:export default function myIntegration() { return { name: 'my-integration', hooks: { 'astro:config:setup': ({ updateConfig }) => { updateConfig({ build: { server: '...', }, }); }, }, }; }
-
#4876
d3091f89eThanks @matthewp! - Adds the Astro.cookies APIAstro.cookiesis a new API for manipulating cookies in Astro components and API routes.In Astro components, the new
Astro.cookiesobject 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.
- #4842
812658ad2Thanks @bluwy! - Add missing dependencies, support strict dependency installation (e.g. pnpm)
- #4722
4bc70f354Thanks @bholmesdev! - Fix route validation failures on Netlify Edge
- #4558
742966456Thanks @tony-sull! - Adding thewithastrokeyword to include the adapters on the Integrations Catalog
-
04ad44563- > Astro v1.0 is out! Read the official announcement post.No breaking changes. This package is now officially stable and compatible with
astro@1.0.0!
- Updated dependencies [
04ad44563]:- @astrojs/webapi@1.0.0
-
#4015
6fd161d76Thanks @matthewp! - Newoutputconfiguration optionThis change introduces a new "output target" configuration option (
output). Setting the output target lets you decide the format of your final build, either:"static"(default): A static site. Your final build will be a collection of static assets (HTML, CSS, JS) that you can deploy to any static site host."server": A dynamic server application. Your final build will be an application that will run in a hosted server environment, generating HTML dynamically for different requests.
If
outputis omitted from your config, the default value"static"will be used.When using the
"server"output target, you must also include a runtime adapter via theadapterconfiguration. An adapter will adapt your final build to run on the deployed platform of your choice (Netlify, Vercel, Node.js, Deno, etc).To migrate: No action is required for most users. If you currently define an
adapter, you will also need to addoutput: 'server'to your config file to make it explicit that you are building a server. Here is an example of what that change would look like for someone deploying to Netlify:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify/functions'; export default defineConfig({ adapter: netlify(), + output: 'server', });
-
#3973
5a23483efThanks @matthewp! - Adds support for Astro.clientAddressThe new
Astro.clientAddressproperty allows you to get the IP address of the requested user.This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error.
- #3854
b012ee55Thanks @bholmesdev! - [astro add] Support adapters and third party packages
- #3734
4acd245dThanks @bholmesdev! - Fix: append shim to top of built file to avoid "can't read process of undefined" issues
- #3673
ba5ad785Thanks @hippotastic! - Fix react dependencies to improve test reliability
- #3612
fca58cfdThanks @bholmesdev! - Fix: "vpath" import error when building for netlify edge
- #3592
0ddcef20Thanks @tony-sull! - Adds support for base64 encoded responses in Netlify Functions
- #3503
207f58d1Thanks @williamtetlow! - Aliasfrom 'astro'imports to'@astro/types'Update Deno and Netlify integrations to handle vite.resolves.alias as an array
- Updated dependencies [
4de53ecc]:- @astrojs/webapi@0.12.0
- #3381
43d92227Thanks @sarahetter! - Updating out directories for Netlify Functions
- #3377
e1294c42Thanks @sarahetter! - Change out directories on dist and serverEntry
- #3342
352fc316Thanks @thepassle! - create redirects file for netlify edge adapter
- #3150
05cf1a50Thanks @matthewp! - Outputs manifest.json in correct folder for Netlify Edge Functions
- #3079
9f248b05Thanks @hippotastic! - Make Netlify adapter actually append redirects
815d62f1Thanks @FredKSchott! - no changes.
732ea388Thanks @FredKSchott! - Improve the Netlify adapter:- Remove
siteconfig requirement - Fix an issue where query params were being stripped
- Pass the event body to the request object
- Remove
- #2996
77aa3a5cThanks @bholmesdev! - Add human-readable error when a site is not provided in your astro.config
- #2996
77aa3a5cThanks @bholmesdev! - Add human-readable error when a site is not provided in your astro.config
e425f896Thanks @FredKSchott! - Update config options to respect RFC0019