babel-plugin-jsx icon indicating copy to clipboard operation
babel-plugin-jsx copied to clipboard

fix: deoptimize slots when a directive is used

Open KaelWD opened this issue 2 years ago β€’ 2 comments

πŸ€” What is the nature of this change?

  • [ ] New feature
  • [x] Fix bug
  • [ ] Style optimization
  • [ ] Code style optimization
  • [ ] Performance optimization
  • [ ] Build optimization
  • [ ] Refactor code or style
  • [ ] Test related
  • [ ] Other

πŸ”— Related Issue

fixes #541

πŸ’‘ Background or solution

resolveDirective in an optimized slot uses the child component's scope, so directives registered locally in the parent fail to resolve. To fix this we either need to hoist resolveDirective to setup like vue/compiler-sfc does (not really possible in JSX), or disable slot optimization for all parents.

~~This should be merged after #637 as that added another instance of optimize that needs updating.~~

πŸ“ Changelog

Language Changelog
πŸ‡ΊπŸ‡Έ English
πŸ‡¨πŸ‡³ Chinese

β˜‘οΈ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • [ ] Doc is updated/provided or not needed
  • [ ] Demo is updated/provided or not needed
  • [ ] TypeScript definition is updated/provided or not needed
  • [ ] Changelog is provided or not needed

KaelWD avatar Mar 29 '23 17:03 KaelWD

Deploy Preview for vue-jsx-explorer ready!

Name Link
Latest commit ea5e51bb3ad900abe4d54c4515b6c57086295098
Latest deploy log https://app.netlify.com/sites/vue-jsx-explorer/deploys/6424712b90cd0400086f78b0
Deploy Preview https://deploy-preview-638--vue-jsx-explorer.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Mar 29 '23 17:03 netlify[bot]

Don't merge yet, I need to make some more changes after #637

KaelWD avatar Mar 29 '23 17:03 KaelWD