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

fix: resolve type reference in props annotation

Open Ray-D-Song opened this issue 1 month 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

πŸ’‘ Background or solution

When the resolveType option is enabled in vue-jsx, props types cannot be inferred. Reproduction link:https://stackblitz.com/edit/vitejs-vite-hjex3faa?file=src%2FApp.tsx

image

πŸ“ Changelog

Language Changelog
πŸ‡ΊπŸ‡Έ English resolve type reference in props annotation
πŸ‡¨πŸ‡³ Chinese δΈΊ props ε’žεŠ εΌ•η”¨η±»εž‹ε£°ζ˜Žθ§£ζž

β˜‘οΈ Self Check before Merge

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

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

Ray-D-Song avatar Nov 12 '25 06:11 Ray-D-Song

Deploy Preview for vue-jsx-explorer failed. Why did it fail? β†’

Name Link
Latest commit 1c0863f4609476ea82b3e509f68a074ee1c50d57
Latest deploy log https://app.netlify.com/projects/vue-jsx-explorer/deploys/6914254e18eed90008a5fd46

netlify[bot] avatar Nov 12 '25 06:11 netlify[bot]

The strange thing is that the playground cannot reproduce the error in the StackBlitz link. I apologize that I don't have time to investigate this further.

If you later discover differences between them, please let me know.

https://vue-jsx-explorer.netlify.app/#import%20%7B%20defineComponent%20%7D%20from%20'vue'%0A%0Ainterface%20MyProps%20%7B%0A%20%20age%3A%20number%0A%7D%0A%0Aconst%20App%20%3D%20defineComponent((props%3A%20MyProps)%20%3D%3E%20%3Cdiv%3EHello%20World%3C%2Fdiv%3E)

Ray-D-Song avatar Nov 12 '25 06:11 Ray-D-Song