Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
ematipico and sarah11918 authored Oct 8, 2024
1 parent 92c5953 commit 775b042
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .changeset/ten-emus-heal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 775b042

Please sign in to comment.