-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix(v5): format adapter-reference.mdx
#9423
fix(v5): format adapter-reference.mdx
#9423
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -8,7 +8,7 @@ import { FileTree } from '@astrojs/starlight/components'; | |||
|
|||
Astro is designed to make it easy to deploy to any cloud provider for SSR (server-side rendering). This ability is provided by __adapters__, which are [integrations](/en/reference/integrations-reference/). See the [SSR guide](/en/guides/on-demand-rendering/) to learn how to use an existing adapter. | |||
|
|||
## What is an adapter | |||
## What is an Adapter |
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.
The next heading uses a capitalized adapter
so... either both are capitalized or neither.
@@ -50,26 +50,30 @@ interface AstroAdapter { | |||
exports?: string[]; | |||
args?: any; | |||
adapterFeatures?: AstroAdapterFeatures; | |||
supportedAstroFeatures?: AstroFeatureMap; | |||
supportedAstroFeatures: AstroAdapterFeatureMap; |
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 was renamed.
} | ||
|
||
export type SupportsKind = 'unsupported' | 'stable' | 'experimental' | 'deprecated'; | ||
export type AdapterSupportsKind = 'unsupported' | 'stable' | 'experimental' | 'deprecated' | 'limited'; |
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 was renamed.
/** | ||
* Determine the type of build output the adapter is intended for. Defaults to `server`; | ||
*/ | ||
buildOutput?: 'static' | 'server'; |
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.
buildOuput
was missing.
|
||
export type AstroFeatureMap = { | ||
export type AstroAdapterFeatureMap = { |
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 was renamed.
/** | ||
* The adapter is able to support i18n domains | ||
*/ | ||
i18nDomains?: AdapterSupport; | ||
/** | ||
* The adapter is able to support `getSecret` exported from `astro:env/server` | ||
*/ | ||
envGetSecret?: AdapterSupport; |
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.
i18nDomains
was missing and I moved envGetSecret
(while fixing the comment).
@@ -197,10 +211,21 @@ const response = await app.render(request); | |||
|
|||
##### `RenderOptions` | |||
|
|||
<p> | |||
|
|||
**Type:** `{addCookieHeader?: boolean; clientAddress?: string; locals?: object; routeData?: RouteData;}` |
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.
You can check the type here.
<p> | ||
|
||
**Type:** `string`<br /> | ||
**Default:** `request[Symbol.for("astro.clientAddress")]` |
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.
Not sure if this default is really useful...
<p> | ||
|
||
**Type:** `RouteData`<br /> | ||
**Default:** `app.match(request)` |
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.
It seems the default is the return type of app.match(request)
and not app.match(request)
. But I wasn't sure about the value, maybe RouteData | undefined
but it does not make sense as Default
....
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.
Should this now be IntegrationRouteData
?
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.
I hadn't paid attention to the sentence below, so I understand your question... I checked again:
- By switching back to the
next
branch: the type is stillRouteData
. - So I checked
IntegrationRouteData
to make sure it's not an alias: this is a smaller version ofRouteData
.
So I don't think so, RouteData
type still exists and it seems to be the one expected. And I guess the sentence below remains valid: we provide a full RouteData
object which is passed to integrationRouteData
in its smaller form.
But a check from someone more informed on how it works may be useful, this is marked as **Advanced API**: you probably do not need to use this.
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.
ok, then sounds good! Thank you!
|
||
<p> | ||
|
||
**Type:** `(request: Request) => RouteData | undefined` |
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.
You can check the type here.
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, and thank you for jumping in to this! I just left a few comments!
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, and thank you for jumping in to this! I just left a few comments!
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
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! Lots of small changes.
While I was reading a PR related to
adapter-reference.mdx
, I thought we could update the format to be consistent withconfiguration-reference.mdx
andapi-reference.mdx
. Since v5 is set to replace the current version, I thought it might be more useful to update directly to that branch.Description (required)
Type:
,Default:
andSince
where appropriateType:
A few hesitations:
undefined
as an accepted type. So inType:
I only put the accepted types (the property should not be added if it isundefined
)envGetSecret
is in theAdapter features
section but the type in thenext
branch ofwithastro/astro
does not document it... So I obviously left it in, but I'm not sure of the type (I picked up the one in the sentence below) and I'm not sure if I should add Since (v5 I guess).Defaults:
that may not be explicit enough... I'll leave comments.Related issues & labels (optional)
For Astro version:
5.0.0-beta
.This PR targets the
5.0.0-beta
branch.