-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docs: document Environment API breaking changes #12809
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: v6
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for astro-docs-2 ready!
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
|
ArmandPhilippot
left a comment
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.
Thanks Matthew, this looks great. I left a few suggestions, mostly about headings/code snippet consistency.
My main concern is the "RouteData.generate() Removed" section. I don't think we document RouteData directly, but I can see it used in the Integrations page to transmit properties. Looking at the implementation PR, it seems generate() still exist under another format. So, maybe this is the change we want to document here? (but maybe I'm wrong, the implementation PR contains a lot of changes, I haven't checked all the details yet 😅 )
Also, while I was quickly looking at the implementation PR, I noticed we have two new properties for setAdapter(): we'll need to document them in the Adapter API guide under Building an adapter. We now have a subheading for each available prop, so we'll need to add devEntrypoint and entryType there.
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
| ## Environment API Changes | ||
|
|
||
| Astro v6.0 introduces significant changes to how Astro manages different runtime environments (client, server, and prerender) using Vite's new Environments API. Integration and adapter maintainers should pay special attention to these changes. |
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.
Thanks for this @matthewp ! Letting you know that I'm working on this, because it's a lot of content especially at the beginning of the guide that probably only affects integration/adapter authors. I'm thinking we could handle it similar to our removing experimental flags: mention the changes and link to the item entry that shows up in its regular place below:
So my suggestion would be to address the Vite Environment API briefly, like a dependency (it kind of is, as a thing we're using) maybe something like:
| ## Environment API Changes | |
| Astro v6.0 introduces significant changes to how Astro manages different runtime environments (client, server, and prerender) using Vite's new Environments API. Integration and adapter maintainers should pay special attention to these changes. | |
| ### Vite Environment API | |
| <SourcePR number="14306" title="feat: integrate vite environments"/> | |
| Astro v6.0 introduces significant changes to how Astro manages different runtime environments (client, server, and prerender) after an internal refactor to use [Vite's new Environments API](https://vite.dev/guide/api-environment). | |
| Integration and adapter maintainers should pay special attention to changes affecting these parts of the Integration API and Adapter API: | |
| - [integration hooks and HMR access patterns](#changed-integration-hooks-and-hmr-access-patterns-integration-api) | |
| - [`SSRManifest` structure](#changed-ssrmanifest-interface-structure-adapter-api) | |
| - [generating routes with `RouteData`](#removed-routedatagenerate-integration-api) | |
| - [routes with percent-encoded percent signs (e.g. `%25`)](#removed-percent-encoding-in-routes) | |
| - [astro:ssr-manifest` virtual module](#removed-astrossrmanifest-virtual-module-integration-api) |
And then that's it, short and sweet, and those 5 entries of things that were changed/removed etc. we would add to the lists below. Part of my thinking is yes, these changes were all made when implementing Vite's API, but as breaking changes, they aren't otherwise in their own "category", and people still need to see ALL the breaking adapter/integration API changes. So, this makes people aware that there was a big refactor and lots of changes to those APIs as a result, but doesn't make e.g. someone who just needs to know how to update their content collections navigate through/past all this.
So, I'm working on a version that then moves the content below into place, and traces each of those changes back to the rest of docs to the thing that they relate to to make sure that e.g. removed things are in fact removed from existing docs.
That means that @ArmandPhilippot and I might have some questions to verify regular docs content too as we go through this! (I already suspect that RouteData.generate needs some attention, because I already came across something in an earlier PR with @florian-lefebvre that our docs currentlysay RouteData was deprecated and to use the IntegrationsRouteData (which is a subset of the internal RouteData I believe?)
So be prepared for some questions as we work through this, but I think something like my suggestion above might be a good way to handle this!
|
I just added a commit to reorganize and start to put these in our format.
|
Description (required)
Updates the v6 guide with breaking changes from the Environment API refactor
Related issues & labels (optional)
For Astro version:
6.x. See astro PR #14306.