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): mark island specific components with @__PURE__ #25842

Conversation

huang-julien
Copy link
Member

@huang-julien huang-julien commented Feb 17, 2024

πŸ”— Linked issue

Couldn't reproduce it on stackblitz

reproducable by setting experimental.componentIslands to true in the basic fixtures and going to localhost:3000/islands

❓ 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

Hello πŸ‘‹

Seems like Vite don't treeshake the import. NuxtTeleportIslandComponent is importing #build/components-chunk which don't exist if the feature is not enabled.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Copy link

stackblitz bot commented Feb 17, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@huang-julien huang-julien marked this pull request as draft February 17, 2024 13:34
@huang-julien huang-julien marked this pull request as ready for review February 17, 2024 22:22
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

We might also try annotating these components with:

/*@__PURE__*/

@huang-julien huang-julien marked this pull request as draft February 17, 2024 22:49
@huang-julien
Copy link
Member Author

Great, I can't reproduce it anymore πŸ˜’... Anyway, let's annotate them first

@huang-julien huang-julien changed the title fix(nuxt): don't import nuxt-client specific components if feature is not enabled fix(nuxt): mark island specific components with @__PURE__ Feb 20, 2024
@huang-julien huang-julien marked this pull request as ready for review February 20, 2024 19:13
@danielroe danielroe merged commit b272991 into main Feb 21, 2024
35 checks passed
@danielroe danielroe deleted the fix(nuxt)--don't-add-NuxtTeleportIslandComponent-import-if-feature-is-not-enabled branch February 21, 2024 21:20
@github-actions github-actions bot mentioned this pull request Feb 21, 2024
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.

None yet

2 participants