Extends virtual module astro:transitions/client to export swapFunctions#11708
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 :) |
|
Hi Ema, no problem, I really should have figured that out myself! |
sarah11918
left a comment
There was a problem hiding this comment.
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>
sarah11918
left a comment
There was a problem hiding this comment.
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
swapFunctionsobject 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.