Skip to content

Conversation

@ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Mar 31, 2025

Changes

This PR unflags the session API. Aside from removing the flag, this changes some of the details of how session configuration is validated, because of them no longer being opt-in. Previously, if a user had enabled the flag and not configured a driver we would throw when validating the config We can no longer do this because we don't know if the sessions will be used. Instead, we use a getter for the session object in context and the Astro global. Previously this would just be undefined. Now it also logs a warning if accessed, explaining why it is undefined. As well as doing this when there is no driver, it will catch attempts to access it in prerendered pages. This would previously fail with a headers error when it tried to set a cookie. It now fails earlier, with a more helpful error message.

Testing

The configuration tests have mostly been removed, as they no longer apply. Other tests have been updated to remove flags.

Docs

This will have a lot of docs changes, to come later.

@github-actions github-actions bot added pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) docs pr semver: minor Change triggers a `minor` release labels Mar 31, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 31, 2025

CodSpeed Performance Report

Merging #13527 will not alter performance

Comparing stable-session (47fb9cf) with main (7d251c1)

Summary

✅ 6 untouched benchmarks

@changeset-bot
Copy link

changeset-bot bot commented Apr 1, 2025

🦋 Changeset detected

Latest commit: 47fb9cf

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ascorbic ascorbic self-assigned this Apr 2, 2025
@ascorbic ascorbic marked this pull request as ready for review April 2, 2025 14:28
@ascorbic ascorbic added this to the v5.7.0 milestone Apr 3, 2025
@ascorbic ascorbic mentioned this pull request Apr 3, 2025
6 tasks
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Just a few tiny suggestions here, changeset and config reference! Looking pretty sweet!

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Approving for docs! 🥳

(Noting I did review the configuration-reference JSDoc and it looks fine to the eye here. We'll see for sure when it's pulled into docs proper.)

@ematipico ematipico merged commit 2fd6a6b into main Apr 14, 2025
17 checks passed
@ematipico ematipico deleted the stable-session branch April 14, 2025 09:01
@astrobot-houston astrobot-houston mentioned this pull request Apr 14, 2025
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
Co-authored-by: Sarah Rainsberger <[email protected]>


Co-authored-by: florian-lefebvre <[email protected]>
Co-authored-by: sarah11918 <[email protected]>
Co-authored-by: ematipico <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) semver: minor Change triggers a `minor` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants