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

Fix asynchronous appEntrypoint support #9558

Merged
merged 5 commits into from
Jan 1, 2024
Merged

Conversation

michaelhthomas
Copy link
Contributor

Changes

Fixes #9557, a regression which has broken the (admittedly niche) use case of an asynchronous appEntrypoint function. The changes introduced in #9362 led the potentially asynchronous setup method to be wrapped in a synchronous function, making the await setup() in [server,client].js more-or-less useless. This PR makes the virtual module's wrapper method async as well, bringing back support for asynchronous appEntrypoints.

Testing

A simple test for this scenario was added, which leverages two components registered globally in the appEntrypoint script separated by a simulated asynchronous call to ensure that registration works correctly following an async call within an async entrypoint script.

Docs

Not sure if docs will be needed as this is a pretty niche use case, but it is certainly nice to have. I'll be happy to add to the docs if it would be appropriate.
/cc @withastro/maintainers-docs

Copy link

changeset-bot bot commented Jan 1, 2024

🦋 Changeset detected

Latest commit: 516ce6e

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 pkg: vue Related to Vue (scope) pkg: integration Related to any renderer integration (scope) pr: docs A PR that includes documentation for review labels Jan 1, 2024
@michaelhthomas michaelhthomas changed the title Patch 1 Fix asynchronous appEntrypoint support Jan 1, 2024
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! The PR that regresses this certainly looked unintended, so I made this a patch fix instead. I don't think we need a specific documentation for this too. Sync/Async should work ootb without documenting.

@bluwy bluwy merged commit e496b2e into withastro:main Jan 1, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: vue Related to Vue (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vue appEntrypoint cannot be asynchronous
2 participants