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

Document ViewTransitions API reference #9174

Merged
merged 18 commits into from
Aug 29, 2024
Merged

Conversation

Fryuni
Copy link
Member

@Fryuni Fryuni commented Aug 23, 2024

Description

Add a reference to the APIs and events available when using View Transitions.

Related issues & labels (optional)

Copy link

netlify bot commented Aug 23, 2024

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 1fd61d0
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/66d0b5fe2b653f00081d48eb
😎 Deploy Preview https://deploy-preview-9174--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 configuration.

@Fryuni Fryuni self-assigned this Aug 23, 2024
@Fryuni Fryuni added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label Aug 23, 2024
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Aug 23, 2024

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en reference/api-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@Fryuni Fryuni marked this pull request as ready for review August 24, 2024 00:51
Copy link
Contributor

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed a few links, feel free to double check that this was the correct resource. I think there are still some broken links.

Other than that (and a typo), my comments are mostly related to the formatting of Type: and <Since />. We have updated the api-reference.mdx file to make the formatting of this information more consistent (see #8943, the format reference is the one used in configuration-reference.mdx):

  • <Since /> and Type: should be inside the same paragraph
  • If a default value exists, a Default: line should be added.

So I added some suggestions on this. I didn't double check each function. If you think of a missing Default: don't hesitate to add it in the same block! 😄

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
@sarah11918 sarah11918 mentioned this pull request Aug 27, 2024
@sarah11918
Copy link
Member

Thank you @ArmandPhilippot for that great consistency work! So appreciated! 💪

I think it's time for @martrapp to have a look at what we've all been up to.... 👀

Copy link
Contributor

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems I missed two incorrectly formatted Type: in the previous review. 👀

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
@sarah11918
Copy link
Member

Noting that the link should work after the new View Transitions docs have merged tomorrow!

Copy link
Member

@martrapp martrapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! My wholehearted thanks to the Arcane Tower 🧙🏼‍♂️ and everyone who helped. I've just added a few small suggestions that you may or may not want to consider.

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
**Type:** `() => Promise<void>`
</p>

Implementation of the following phase in the navigation (loading the next page). This implementation can be overriden to add extra behavior or to prevent the execution of the next phase.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... or to prevent the execution of the next phase

That is a mystery to me. Do we have any examples of this anywhere? Why would you do that? And why does it cancel the next phase? Calling preventDefault() for the astro:before-preparation event, on the other hand, is fine.

If we do not persuade users of this, we do not need to warn them in the following

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 haven't seen an example, nor can I think of any particular use case where you'd want to override this and not call the original at some point in the new function, but technically, you can.

I'm fine with not mentioning it on the docs tho.

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
@sarah11918
Copy link
Member

Just resolved conflicts/updated branch! With any luck, that means the link check now passes!

@sarah11918
Copy link
Member

Needed to resolve conflicts again because this page just updated! 😂

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @Fryuni for taking the initiative here! Would not be possible without the outstanding contributions of @ArmandPhilippot and the wise oversight of @martrapp .

Best Docs Team Ever! 🥳

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! I have mostly nit and typo suggestions here, after applying them I believe it's good to go!

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some quick tidying

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
@Fryuni Fryuni merged commit dd35681 into main Aug 29, 2024
10 checks passed
@Fryuni Fryuni deleted the fryuni/view-transition-events branch August 29, 2024 18:25
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Aug 29, 2024
yanthomasdev added a commit that referenced this pull request Aug 30, 2024
#9260)

* i18n(fr): add Actions in `api-reference.mdx`

See #9224 and #9254

* i18n(fr): add View Transitions section in api-reference.mdx

See #9174

* i18n(fr): improve Actions handler documentation

See #9261

* i18n(fr): update `view-transitions.mdx`

See #9224

* i18n(fr): reword sentences around handler to make reading easier

* i18n(fr): fix View Transitions capitalization where legit

Co-authored-by: Thomas Bonnet <[email protected]>

---------

Co-authored-by: Thomas Bonnet <[email protected]>
Co-authored-by: Yan <[email protected]>
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.

Document View Transition events fields
6 participants