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: hmr plugin with async component (with ssr, dev only) #411

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

dai-shi
Copy link
Owner

@dai-shi dai-shi commented Jan 22, 2024

No description provided.

Copy link

vercel bot commented Jan 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Jan 22, 2024 4:56am

};

const ServerMessage = async () => {
await new Promise((resolve) => setTimeout(resolve, 2000));
Copy link
Owner Author

Choose a reason for hiding this comment

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

We need this to reproduce the bug.

Copy link

codesandbox-ci bot commented Jan 22, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 649b49b:

Sandbox Source
Vanilla Typescript Configuration
React Configuration
React TypeScript Configuration

@@ -33,7 +33,7 @@ export function rscHmrPlugin(): Plugin {
return [
{
tag: 'script',
attrs: { type: 'module' },
attrs: { type: 'module', async: true },
Copy link
Owner Author

Choose a reason for hiding this comment

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

By default it's "defer" and the script isn't evaluated during HTML streaming.
cc @Aslemammad

Copy link
Contributor

Choose a reason for hiding this comment

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

niceeee, i love that solution.

@dai-shi dai-shi mentioned this pull request Jan 22, 2024
77 tasks
@dai-shi dai-shi merged commit af6cfe7 into main Jan 22, 2024
28 checks passed
@dai-shi dai-shi deleted the simple-style-file branch January 22, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants