News for hackers. Stuff that matters.
Re:New Features in Vue 3 by zamalek on Tuesday October 29, 2019 @05:46PM (#21392428)
TSX is supported by Vue and, unlike templates, that is not opaque to the compiler. I recently switched the code in a side project of mine to TSX and it was worth the change.
Re:New Features in Vue 3 by Rapzid on Tuesday October 29, 2019 @06:51PM (#21392956)
Do you have any pointers on setting up TypeScript properly for the jsx render function while preserving intellisense? "Supported" is a bit tenuous based on the manual setup and shim creation required to get it all working nicely..
Re:New Features in Vue 3 by zamalek on Tuesday October 29, 2019 @07:13PM (#21393086)
This is my setup:

- vue, @vue/composition-api

- Rollup

- Babel: @babel/preset-typescript, @babel/preset-env, @vue/babel-preset-app, babel-preset-vca-jsx

- Just pass `extensions: ['.js', '.jsx', '.ts', '.tsx']` to the Rollup babel plugin.

Make sure you are using createComponent inside a TSX file, and you'll get every feature that TS has to offer (as it is all native TS). Intellisense and static types are the only reason I dropped SFCs.

I'm not sure how this would work with Webpack, I've been enjoying Rollup more as things have just worked with no thought involved so far. I'm sure it can be done, though.

Re:New Features in Vue 3 by aitchnyu on Thursday October 31, 2019 @07:08AM (#21407483)
What's your Vue+Rollup configuration?
Re:New Features in Vue 3 by Vinnl on Wednesday October 30, 2019 @03:40AM (#21395365)
But that feels a bit like saying you can use React without JSX. Sure, you can, but it appears that the templates are a major selling point for Vue to many people. That's the part that's most baffling. (Well, not really baffling, as it's a pretty subjective matter. But not for me, at least :)