Skip to content

Conversation

@ematipico
Copy link
Member

@ematipico ematipico commented Dec 11, 2025

Description (required)

In v6 Astro has three environments during the build, one more compared to the classic ssr and client Vite environments.

This PR adds a new section to the integration APIs to cover these environments.

The relevant PR 14998 was merged in main next

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit fa7faec
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/693aeeb2b238c60007051a2d
😎 Deploy Preview https://deploy-preview-12872--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ematipico ematipico added 6.0 add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. labels Dec 11, 2025
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Dec 11, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/reference/integrations-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@ematipico ematipico changed the title create v6 upgrade guide page astro environments Dec 11, 2025
@ematipico ematipico changed the title astro environments astro build environments Dec 11, 2025
Since v6, Astro is based on `vite` v7 and it heavily uses its [environment APIs](https://vite.dev/guide/api-environment).

Astro build environments:
- `ssr`: the classic and default `ssr` environment of `vite`. Astro uses this environment to build dynamic routes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also used for non-dynamic routes in dev.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth having a small paragraph for dev? At line 1197 I mention build

Copy link
Contributor

@matthewp matthewp Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the goal is to explain that Astro uses environments now I would probably explain it all together. If the goal is to explain how there's prerender as a special environment in the build, I would explain the reasoning for this documentation more. Like for example something like:

Astro inherits the environments Vite provides by default, `ssr` and `client`. Additionally there is the the `prerender` environment provided by Astro. Here's what each of these environments are used for:


Astro build environments:
- `ssr`: the classic and default `ssr` environment of `vite`. Astro uses this environment to build dynamic routes.
- `client`: the classic and default `client` environment of `vite`. Astro uses this environment to generate client assets, such as scripts, styles, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Calling this and ssr "classic" is a little confusing to me. I think maybe instead you are wanting to say that they are vite-defined or built-in or something to that effect.

- `prerender`: an environment that is created to build static pages.


If your integrations rely on `vite` environments and the Astro build, you might want to optimise based on these environments provided.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would link to Vite's docs on environment (which imo aren't great but its what we have).

I might also mention that the primary thing you do with environment is apply config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.0 add new content Document something that is not in docs. May require testing, confirmation, or affect other pages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants