-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(astro:middleware): add docs for astro/middleware imports
#12792
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
base: main
Are you sure you want to change the base?
fix(astro:middleware): add docs for astro/middleware imports
#12792
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
After some discussion:
Yes, let's do this every time there's a regular module associated with the virtual model. Maybe we can have a sentence like "The following are imported from the virtual content module" / "The following are imported from the regular content module" to introduce each code block of imports. We checked, and there should be a corresponding virtual model for every one of these modules that isn't already covered by its own special API page (e.g.
"Should" is something to take up with the framework team! If we're responsible for documenting what is currently, and if both entries would be identical, then it's OK I think to:
|
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Description (required)
Updates the
astro:middlewaredocs to:astro/middlewareuserDefinedLocalesadded in feat: experimental i18n routing astro#8974defaultLocaleadded in fix(routing): default locale when there's a list astro#12151localsadded in fix(routing): don't attach locals to request astro#12647 but there is no changeset ... the last v4 version was released in November, so I think it's safe to say v5 here.createContextandtrySerializeLocalsfromastro:middlewaretoastro/middleware(not available in the colon version)defineMiddleware()type and update the descriptionsequence()code snippet to make it valid and replace_withcontextto improve clarity.Things to consider:
astro/middlewarein the same place given the page is namedastro:middleware? If so, maybe we should add a sentence to explain when to use one over the other.defineMiddleware()andsequence()inastro:middlewareimports but the same functions are available fromastro/middleware: should they be available from only one version? how to document both without repeating the same thing.See also withastro/astro#8101 (review) for extra context.
Related issues & labels (optional)
add new content,improve or update documentation