-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adapters v0 #2855
Adapters v0 #2855
Conversation
🦋 Changeset detectedLatest commit: 34f64f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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.
Looking good overall! Had a few comments.
Also I'm still considering how I feel about adapter being inside integrations
. IMO a top-level adapter: nodejs()
option would make it clear that you can only have one adapter. Internally, we can just merge it into the integrations
array.
I don't have a strong opinion here, other than we kind of need {
name: string;
serverEntrypoint: string;
integration: AstroIntegration;
} Which is ok and something I played around with, but some other feedback elsewhere made it sound like aligning with the renderer way would be good. Happy to discuss, but these are the tradeoffs in my head. |
Copying a comment from Discord that I made before realizing this convo was happening: Yup, I'll just +1 the idea of an adapter being a special |
@natemoo-re @FredKSchott I updated the PR to accept the adapter through an adapter property like so: import nodejs from '@astrojs/node';
export default {
adapter: nodejs()
} It's still an |
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.
Looks great!
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.
LGTM! Left two small comments
* Adapter v0 * Finalizing adapters * Update the lockfile * Add the default adapter after config setup is called * Create the default adapter in config:done * Fix lint error * Remove unused callConfigSetup * remove unused export * Use a test adapter to test SSR * Adds a changeset * Updated based on feedback * Updated the lockfile * Only throw if set to a different adapter * Clean up outdated comments * Move the adapter to an config option * Make adapter optional * Update the docs/changeset to reflect config API change * Clarify regular Node usage
Changes
astro.config.mjs
server.mjs
Testing
Tests updated, also the
examples/ssr
example uses this new adapter.Docs
These are coming in a separate PR.