babel-plugin-jsx
babel-plugin-jsx copied to clipboard
fix: deoptimize slots when a directive is used
π€ 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
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Don't merge yet, I need to make some more changes after #637