-
-
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
astro:
namespace for middleware and components
#8101
Conversation
🦋 Changeset detectedLatest commit: fdbf0c4 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.
It's a side quest not really related to this, but someone (me, probably) should make it so imports starting with |
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.
About astro:middleware
VS astro/middleware
, here's some concerns we should take into account (even in the language tools cc @Princesseuh )
At the moment, astro/middleware
exposes the following APIs: createContext
, trySerializeLocals
, defineMiddleware
and sequence
.
defineMiddleware
and sequence
can be part of astro:middleware
, but createContext
, trySerializeLocals
can't be part of astro:middleware
, because are runtime APIs that expose code that will be used by integrations for advanced features (e.g. edge middleware).
I wonder:
- is it possible to exclude
createContext
,trySerializeLocals
fromastro:middleware
? - is it possible to exclude
defineMiddleware
andsequence
fromastro/middleware
? - is it possible to suggest the correct import based on the context? Probably yes, because the middleware is a known file with fixed location and name.
--- | ||
|
||
|
||
`astro:`namespace aliases for middleware and components |
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.
`astro:`namespace aliases for middleware and components | |
`astro:` namespace aliases for middleware and components |
Couldn't |
It's easy enough to create another module to use as the alias so I'll do that. |
As long as the functions are correctly bundled by |
Changes
astro:middleware
andastro:components
Testing
Docs