-
-
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(next): TODOs #11987
feat(next): TODOs #11987
Changes from 10 commits
102a65d
b1c041f
2f5c1c5
a46c3ae
4affd1a
a1048dd
b81fe46
50bc4f8
8d76987
5b011e4
f79a6a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||
--- | ||||||
'astro': patch | ||||||
--- | ||||||
|
||||||
App class now accepts renderOptions | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not sure about the syntax for App class, but it likely needs something! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. App is a class, this is for the
matthewp marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
The signature for `app.render()` has changed, and the second argument is now an options object called `renderOptions` with more options for customizing rendering. | ||||||
|
||||||
The `renderOptions` are: | ||||||
|
||||||
- `addCookieHeader`: Determines whether Astro will set the `Set-Cookie` header, otherwise the adapter is expected to do so itself. | ||||||
- `clientAddress`: The client IP address used to set `Astro.clientAddress`. | ||||||
- `locals`: An object of locals that's set to `Astro.locals`. | ||||||
- `routeData`: An object specifying the route to use. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
'astro': major | ||
--- | ||
|
||
The `locals` object can no longer be overridden | ||
|
||
Middleware, API endpoints, and pages can no longer override the `locals` object in its entirety. You can still append values onto the object, but you can not replace the entire object and delete its existing values. | ||
|
||
If you were previously overwriting like so: | ||
|
||
```js | ||
ctx.locals = { | ||
one: 1, | ||
two: 2 | ||
} | ||
``` | ||
|
||
This can be changed to an assignment on the existing object instead: | ||
|
||
```js | ||
Object.assign(ctx.locals, { | ||
one: 1, | ||
two: 2 | ||
}) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ export async function emitESMImage( | |
id: string | undefined, | ||
/** @deprecated */ | ||
_watchMode: boolean, | ||
// FIX: in Astro 5, this function should not be passed in dev mode at all. | ||
// FIX: in Astro 6, this function should not be passed in dev mode at all. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we won't get to this right now, it's.. tough |
||
// Or rethink the API so that a function that throws isn't passed through. | ||
fileEmitter?: FileEmitter, | ||
): Promise<ImageMetadata | undefined> { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,7 +228,6 @@ export function createGetDataEntryById({ | |
|
||
const lazyImport = await getEntryImport(collection, id); | ||
|
||
// TODO: AstroError | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be removed in Astro 6.0, not worth doing it now |
||
if (!lazyImport) throw new Error(`Entry ${collection} → ${id} was not found.`); | ||
const entry = await lazyImport(); | ||
|
||
|
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 checking, does this need updating in the docs here: https://docs.astro.build/en/reference/adapter-reference/#apprenderrequest-request-options-renderoptions and we should mention it in the upgrade guide as a Breaking Change