-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Support a 'vue' option for JSX in .tsx files #13260
Comments
It would be nice. vuejs/vue#478 |
@aluanhaddad That is about using typescript with vue.js. However, we want something that can compile tsx to js for vue.js. It would look like this in tsconfig.json. "jsx": "react", When use it with vue.js, we should use by changing react to vue. "jsx": "vue" |
+1 |
@yeluoqiuzhi I understand. The linked issue was also about using TypeScript with vue.js. I linked it to illustrate that there has been interest in this for a several years, and because it is an interesting discussion. |
Right now the emit is pretty different between React and Vue's JSX emit. See the documentation here that shows what Vue JSX is transformed to. |
Thanks. We would wait for typescript to support it, rather than use babel. |
IMHO, the most significant difference is type checking. We can already use Babel + TS to transform code, so that would not be the hard part for users. Yet type checking is much more convoluted. There are many libraries in wild to support Vue's type checking before official solution. Adopting which model needs proposal. @yeluoqiuzhi should know. Even if we do only accept official library, type checking For custom event, Vue's JSX requires Finally, I would like to see Vue support can be done by #10159. I would expect Vue will be hot in 2017, but what about 2018? 2019? As a language,supporting only some specified libraries feels partisan. Edit: thank Daniel for referring related issue in TS. Actually I have considered the same question before and gave up due to cyclic dependency. |
@HerringtonDarkholme see #12846 for general support of typing the Vue instance based on its input properties. |
Would a PR be accepted that implements this? |
I have move to react stack for a year... |
I've created a PoC and it seems to work pretty well. Successfully used it for compiling a medium sized application (~2000 lines of Vue.js templates). Can someone from the core team decide if a PR will be considered for this feature, i.e. In case anyone wants to peek at the code (work in progress): |
Although this issue is closed by author, I think there is still a good benefit to TypeScript and Vue. How about re-open this issue? @aluanhaddad @DanielRosenwasser |
Maybe we should open a new issue? |
I rebased and updated @andrei-markeev's PoC: wartmanm@vue-jsx. |
[feature] Will typescript support compile tsx for vue.js?
The text was updated successfully, but these errors were encountered: