-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: add support for automatic session driver config #13145
Conversation
🦋 Changeset detectedLatest commit: f673dee 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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
CodSpeed Performance ReportMerging #13145 will not alter performanceComparing Summary
|
!preview adapter-sessions |
!preview adapter-sessions |
❌ Snapshot release failed. |
!preview adapter-sessions |
Snapshots have been released for the following packages:
Build Log
Publish Log
|
8a63aac
to
db142f0
Compare
|
@ematipico I will actually bump it to 5.3.0, because this PR changes the API |
return driver; | ||
} | ||
|
||
export function validateSessionConfig(settings: AstroSettings): void { |
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.
Why don't we validate the configuration inside the zod schema using refine
or superRefine
?
EDIT: I understand why we need a function, I think it's worth adding a comment that explains that
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 couple of thoughts on the breaking change changeset!
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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Changes
Automatically configures session storage with the Node and Netlify adapters. If the
experimental.session
flag is enabled, the Node adapter will configurefs
session storage and Netlify will configurenetlify-blobs
session storage.This also changes the
experimental.session
option to a boolean flag and moves session config to a top-level value. This change is to allow the new automatic session driver support. You now need to separately enable theexperimental.session
flag, and then configure the session driver using the top-levelsession
key if providing manual configuration.You no longer need to configure a session driver if you are using an adapter that supports automatic session driver configuration and wish to use its default settings.
However, you can still manually configure additional driver options or choose a non-default driver to use with your adapter with the new top-level
session
config option. For more information, see the experimental session docs.Testing
Added test cases for the Node and Netlify adapters. The Netlify tests use the local mock blobs server.
Docs
Updated the docs for the config options. This adds several new error types, so I have moved session errors into their own section. I will do a separate PR to the docs repo to update the experimental feature page.