Skip to content
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

Merged
merged 3 commits into from
Jul 22, 2022
Merged

Conversation

FredKSchott
Copy link
Member

What kind of changes does this PR include?

  • New or updated content

Description

@FredKSchott FredKSchott changed the title deprecate Astro.canonicalURL, add Astro.url deprecate Astro.canonicalURL & add Astro.url Jul 18, 2022
@FredKSchott FredKSchott marked this pull request as draft July 18, 2022 19:37
@netlify
Copy link

netlify bot commented Jul 18, 2022

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit a5b0e9e
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/62da2f5d506374000847f3f4
😎 Deploy Preview https://deploy-preview-1033--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sarah11918
Copy link
Member

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.

@sarah11918 sarah11918 added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label Jul 19, 2022
@FredKSchott FredKSchott marked this pull request as ready for review July 20, 2022 03:57
@FredKSchott FredKSchott force-pushed the canonical-url-replace branch from 7057355 to 55ded1e Compare July 20, 2022 04:06
@FredKSchott
Copy link
Member Author

Done! Added a new section to the migration guide for Astro v1 RC

Copy link
Member

@delucis delucis left a 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!

src/pages/en/migrate.md Outdated Show resolved Hide resolved
@@ -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.
Copy link
Member

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?

Suggested change
`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.

Copy link
Member Author

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.

src/pages/en/reference/api-reference.md Outdated Show resolved Hide resolved
src/pages/en/migrate.md Outdated Show resolved Hide resolved
@delucis
Copy link
Member

delucis commented Jul 20, 2022

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 Astro.url ships. Do you want to pull the migration guide stuff into a separate PR so we can get it merged? Then we can start adding content like for the <Markdown /> component (#1045) without waiting for Astro.url.

@delucis delucis mentioned this pull request Jul 20, 2022
8 tasks
@FredKSchott
Copy link
Member Author

@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.

Copy link
Member

@delucis delucis left a 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.

src/pages/en/migrate.md Outdated Show resolved Hide resolved
src/pages/en/reference/api-reference.md Show resolved Hide resolved
@FredKSchott FredKSchott force-pushed the canonical-url-replace branch from 2e6866d to 3115fc8 Compare July 22, 2022 04:53
@FredKSchott
Copy link
Member Author

FredKSchott commented Jul 22, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants