From 775b0425b3556ee8697680a4a558eb8f50fe1585 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 8 Oct 2024 16:55:17 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sarah Rainsberger --- .changeset/ten-emus-heal.md | 13 ++++++++----- packages/astro/src/@types/astro.ts | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.changeset/ten-emus-heal.md b/.changeset/ten-emus-heal.md index 9a7617b06109..8ff9e1931470 100644 --- a/.changeset/ten-emus-heal.md +++ b/.changeset/ten-emus-heal.md @@ -2,13 +2,16 @@ 'astro': minor --- -Adds the `build.concurreny` to specify the number of pages to build in parallel. In most cases, you should stick with the default value of `1`, -and batch or cache long running tasks like fetch calls or data access to improve the overall rendering time. +Adds a new `build.concurreny` configuration option to specify the number of pages to build in parallel -Use this option only if the refactors are not possible. If the number is set too high, the page rendering -may slow down due to insufficient memory resources and because JS is single-threaded. +**In most cases, you should not change the default value of `1`.** -In the future, Astro may reuse this option to render pages concurrently with multiple threads. +Use this option only when other attempts to reduce the overall rendering time (e.g. batch or cache long running tasks like fetch calls or data access) are not possible or are insufficient. + +Use this option only if the refactors are not possible. If the number is set too high, the page rendering may slow down due to insufficient memory resources and because JS is single-threaded. + +> [!WARNING] +> This feature is stable and is not considered experimental. However, this feature is only intended to address difficult performance issues, and breaking changes may occur in a [minor release](https://docs.astro.build/en/upgrade-astro/#semantic-versioning) to keep this option as performant as possible. ```js // astro.config.mjs diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index d19679c06526..d660c7f3f12e 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1115,6 +1115,10 @@ export interface AstroUserConfig { * } * } * ``` + * + * :::caution[Breaking changes possible] + * This feature is stable and is not considered experimental. However, this feature is only intended to address difficult performance issues, and breaking changes may occur in a [minor release](https://docs.astro.build/en/upgrade-astro/#semantic-versioning) to keep this option as performant as possible. Please check the [Astro CHANGELOG](https://github.com/withastro/astro/blob/refs/heads/next/packages/astro/CHANGELOG.md) for every minor release if you are using this feature. + * ::: */ concurrency?: number; };