Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): treeshake client-only components with placeholders#8789

Merged
danielroe merged 1 commit intonuxt:mainfrom
huang-julien:fix/tree-shake.client
Feb 4, 2023
Merged

fix(nuxt): treeshake client-only components with placeholders#8789
danielroe merged 1 commit intonuxt:mainfrom
huang-julien:fix/tree-shake.client

Conversation

@huang-julien
Copy link
Member

@huang-julien huang-julien commented Nov 7, 2022

🔗 Linked issue

resolve nuxt/nuxt#15396

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Hi 👋 currently the tree-shake module does not treeshake .client components due to #7412 that adds ServerPlaceholder as .client components server side component.
This PR fix the RegexpMap of the treeshake module by adding a condition to verify that other.filePath is not the path to ServerPlaceholder.
btw this can be closed if #8713 pass

📝 Checklist

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

@codesandbox
Copy link

codesandbox bot commented Nov 7, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 9fda582
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/636993e0566c89000801c2cd

@danielroe danielroe added bug Something isn't working 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Nov 15, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe changed the title fix(nuxt): fix treeshake client-only module RegexpMap fix(nuxt): treeshake client-only components with placeholders Feb 4, 2023
@danielroe danielroe merged commit bf617c7 into nuxt:main Feb 4, 2023
@danielroe
Copy link
Member

danielroe commented Feb 4, 2023

I do plan to merge the other PR but we shouldn't hold this one up. Thank you again! ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.x bug Something isn't working 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

treeshake module does not treeshake .client components

2 participants