-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Extends virtual module astro:transitions/client to export swapFunctions #11708
Conversation
🦋 Changeset detectedLatest commit: 1a8cddc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Even if it’s an advanced API, we should still document it! Would you be able to kick things off with a draft docs PR and we discuss it there @martrapp? |
... examining AD^2 to make the docs PR ... |
Opened withastro/docs#9084 for discussion. |
Sorry for the block, but since we are exposing a new API to userland, this counts as a minor because, for the users, it's a new functionality. In fact, it requires docs :) |
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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Hi Ema, no problem, I really should have figured that out myself! |
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.
Hey @martrapp ! For a minor, you always get a beefier changeset to introduce and hype a new feature! Often, we'll pull closely from the docs for people who prefer to "get their news" from the changelog.
See what you think about something like below!
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Thanks for the suggestion, @sarah11918! I've made a few small changes to demonstrate something more interesting than just showing how to rebuild what's already there. Should we also include a link to the “Docs” section with this example? |
restoreFocus() bindings are now returned by saveFocus() and do not make sense anymore as a member of the swapFunctions object
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
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.
One tiny super nit edit, and approving for docs! 🥳
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Changes
This is a follow up to #10908.
The creation of the blocks for user-defined swap functions has proven to be very useful, e.g. for https://github.com/stackblitz/tutorialkit.
This PR makes it possible to import the^se functions via
astro:transitions/client
.Testing
Adapted the existing e2e tests to use the virtual module
Docs
/cc @withastro/maintainers-docs for feedback!
The
swapFunctions
object exported here provides access to functions that you can use to define your ownswap()
function as a replacement in View Transitions. These functions have not yet been documented in the docs. This is a very specific functionality that is probably only relevant for very few users.If we decide to explicitly document them in the docs, I could certainly use some help.