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

supporting top of await #6671

Merged
merged 10 commits into from
Mar 31, 2023
Merged

supporting top of await #6671

merged 10 commits into from
Mar 31, 2023

Conversation

JerryWu1234
Copy link
Contributor

@JerryWu1234 JerryWu1234 commented Mar 27, 2023

Changes

fix #6549
I detected the Vue that is loading, And I will wrap a Suspense component if the Vue included the setup of async.
And I use a detection function to make sure it is or is not an async function

function isAsync (fn) {
	const constructor = fn?.constructor
	return constructor && constructor.name === 'AsyncFunction';
}

I recorded a video for this test.

https://cdn.discordapp.com/attachments/984757097726107661/1090142054748786778/VID20230328131309.mp4

Testing

Docs

@changeset-bot
Copy link

changeset-bot bot commented Mar 27, 2023

⚠️ No Changeset found

Latest commit: ccbfe35

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added pkg: vue Related to Vue (scope) pkg: integration Related to any renderer integration (scope) labels Mar 27, 2023
@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 28, 2023
@JerryWu1234 JerryWu1234 marked this pull request as ready for review March 28, 2023 09:03
@JerryWu1234 JerryWu1234 changed the title add fix #6549 supporting top of await Mar 28, 2023
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

Awesome test!

@matthewp matthewp merged commit d59e511 into withastro:main Mar 31, 2023
@astrobot-houston astrobot-houston mentioned this pull request Mar 31, 2023
@MoustaphaDev
Copy link
Member

MoustaphaDev commented Apr 1, 2023

Awesome work on this @wulinsheng123 🚀!

@JerryWu1234 JerryWu1234 deleted the fix-#6549 branch June 1, 2023 06:03
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) pkg: integration Related to any renderer integration (scope) pkg: vue Related to Vue (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top-level await in Vue component causes event handling to break
3 participants