Skip to content

Document ViewTransitions API reference#9174

Merged
Fryuni merged 18 commits intomainfrom
fryuni/view-transition-events
Aug 29, 2024
Merged

Document ViewTransitions API reference#9174
Fryuni merged 18 commits intomainfrom
fryuni/view-transition-events

Conversation

@Fryuni
Copy link
Copy Markdown
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)

@netlify
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Member

@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! 😄

@sarah11918 sarah11918 mentioned this pull request Aug 27, 2024
@sarah11918
Copy link
Copy Markdown
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
Copy Markdown
Member

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

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@sarah11918
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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.

**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
Copy Markdown
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
Copy Markdown
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.

@sarah11918
Copy link
Copy Markdown
Member

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

Fryuni and others added 2 commits August 29, 2024 12:22
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
@sarah11918
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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
Copy Markdown
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!

sarah11918 and others added 2 commits August 29, 2024 13:19
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Copy link
Copy Markdown
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

@Fryuni Fryuni merged commit dd35681 into main Aug 29, 2024
@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 <thomasbnt@protonmail.com>

---------

Co-authored-by: Thomas Bonnet <thomasbnt@protonmail.com>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
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