-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: stable sessions #13527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: stable sessions #13527
Conversation
There was a problem hiding this 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 Performance ReportMerging #13527 will not alter performanceComparing Summary
|
🦋 Changeset detectedLatest 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 |
There was a problem hiding this 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!
Co-authored-by: Sarah Rainsberger <[email protected]>
There was a problem hiding this 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.)
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]>
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.