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 <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
sarah11918
left a comment
There was a problem hiding this comment.
Looks great, @ArmandPhilippot ! Just two little comments from me!
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
sarah11918
left a comment
There was a problem hiding this comment.
I think this looks great! Two tiny questions from me, but this is ready when you are, I think!
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
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: (already answered by Sarah below and on Discord)
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