-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
deprecate Astro.canonicalURL & add Astro.url #1033
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Although I don't know how much longer we'll maintain the migration guide, I think it would be good to also make a note of it in the [beta 1.0 section[(https://docs.astro.build/en/migrate/#astro-10-beta), too. |
7057355
to
55ded1e
Compare
Done! Added a new section to the migration guide for Astro v1 RC |
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 @FredKSchott — made some suggestions!
@@ -91,13 +91,13 @@ const data = await Astro.glob<CustomDataFile>('../data/**/*.js'); | |||
|
|||
### `Astro.request` | |||
|
|||
`Astro.request` is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object. It can be used to get the `url`, `headers`, `method`, and even body of the request. Use `new URL(Astro.request.url)` to get a URL object. | |||
`Astro.request` is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object. It can be used to get the `url`, `headers`, `method`, and even body of the request. |
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.
Do we want to call out that this of most use with SSR? Push folks towards Astro.url
for most common uses?
`Astro.request` is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object. It can be used to get the `url`, `headers`, `method`, and even body of the request. | |
`Astro.request` is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object. It can be used to get the `url`, `headers`, `method`, and even body of the request. This is most useful for sites using [SSR](/en/guides/server-side-rendering/) that want to handle custom requests. |
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.
I don't think this is true! It should be equally useful for both SSR and SSG.
One more comment arising out of our docs triage: it’s quite possible we want to start throwing stuff in the RC migration guide before |
@delucis sure thing! Feel free to pull the migration guide out of my PR into a separate PR, and then I'll rebase mine off of main once it's merged. |
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.
OK, merged the stub migration guide and updated this PR so it’s synced with main, should be good to handle these suggestions however you see fit and merge once Astro.url
ships.
2e6866d
to
3115fc8
Compare
Responded to all comments! Thank you @sarah11918 and @delucis for the great feedback. Merging this without approvals only because feedback was generally positive and I won't be online much tomorrow to merge this then. Happy to respond to any comments still remaining in a follow-up PR! |
What kind of changes does this PR include?
Description
Astro.canonicalURL
as deprecatedAstro.url