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(nuxt): transform client fallbacks directly on SFCs #20835

Merged

Conversation

huang-julien
Copy link
Member

πŸ”— Linked issue

fix #20833

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Hi πŸ‘‹ this PR fix an issue on NuxtClientFallback with webpack only.
The fallback dom node are not removed client-side. However i have no clue on why does { type: ['template'] } cause this issue

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@@ -25,7 +25,7 @@ export const clientFallbackAutoIdPlugin = createUnplugin((options: LoaderOptions
if (include.some(pattern => id.match(pattern))) {
return true
}
return isVue(id, { type: ['template'] })
return isVue(id)
Copy link
Member

Choose a reason for hiding this comment

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

it seems likely we need to update the isVue helper util to correctly identify template Vue imports within webpack, so we can preserve the performance improvement of restricting this transform to just vue templates.

Copy link
Member

Choose a reason for hiding this comment

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

actually, I think your solution is right here, as we're directly replacing text in the SFC...

Copy link
Member Author

Choose a reason for hiding this comment

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

i just begin to understand how it work,
image
here's a console.log(id, isVue(id), isVue(id, { type: ['template'] }) πŸ™‚

@danielroe danielroe changed the title fix(nuxt): remove transformInclude type for NuxtClientFallback plugin fix(nuxt): transform client fallbacks directly on SFCs May 13, 2023
@danielroe danielroe merged commit 900ee6d into nuxt:main May 13, 2023
18 checks passed
This was referenced May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NuxtClientFallback hydration broken in webpack build
2 participants