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

Extends virtual module astro:transitions/client to export swapFunctions #11708

Merged
merged 11 commits into from
Aug 28, 2024

Conversation

martrapp
Copy link
Member

@martrapp martrapp commented Aug 14, 2024

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 own swap() 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.

Copy link

changeset-bot bot commented Aug 14, 2024

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Aug 14, 2024
@martrapp martrapp changed the title Extends virtual module astro:transitions/client to exports swapFunctions Extends virtual module astro:transitions/client to export swapFunctions Aug 14, 2024
@delucis
Copy link
Member

delucis commented Aug 14, 2024

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.

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?

@martrapp
Copy link
Member Author

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

@martrapp
Copy link
Member Author

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?

Opened withastro/docs#9084 for discussion.

.changeset/new-monkeys-sit.md Outdated Show resolved Hide resolved
@ematipico
Copy link
Member

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 :)

@github-actions github-actions bot added the semver: minor Change triggers a `minor` release label Aug 15, 2024
Copy link
Contributor

@github-actions github-actions bot left a 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.

@ematipico ematipico dismissed their stale review August 15, 2024 08:45

github action triggered

@ematipico ematipico added this to the 4.15 milestone Aug 15, 2024
@martrapp
Copy link
Member Author

martrapp commented Aug 15, 2024

Hi Ema, no problem, I really should have figured that out myself!
At least this makes it easier to guess the right version for <Since> in docs 😄 (4.15.0?)

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.

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!

.changeset/new-monkeys-sit.md Outdated Show resolved Hide resolved
martrapp and others added 2 commits August 20, 2024 18:59
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@martrapp
Copy link
Member Author

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?

martrapp and others added 2 commits August 22, 2024 19:13
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>
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.

One tiny super nit edit, and approving for docs! 🥳

martrapp and others added 2 commits August 22, 2024 19:37
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@ematipico ematipico merged commit 62b0d20 into main Aug 28, 2024
13 checks passed
@ematipico ematipico deleted the mt/virtual branch August 28, 2024 11:09
@astrobot-houston astrobot-houston mentioned this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants