News for hackers. Stuff that matters.
Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @01:12PM (#16000529)
Do Vue templates play nicely with Typescript? That's something I love about JSX -- "it's just JavaScript" is an incredibly sublime feature. I know you can use JSX with Vue but I'm skeptical since it's a first-order feature with React.
Re:Vue.js vs. React: what happened in 2017 by petilon on Sunday December 24, 2017 @01:22PM (#16000585)
I agree JSX is the best part of React. The second best part is dom diffing and incremental screen update. Obviously this second part is only useful if your application needs to update screens it previously rendered. In fact I'd argue that React is only useful if you need to incrementally update complex screens, because simple screens can be re-rendered completely and no one will know the difference. Very few applications need to incrementally update complex screens. If your application doesn't have this need you can use simpler technologies that don't have the same "Care and feed" requirements of React, such as UIBuilder: https://github.com/wisercoder/uibuilder
Re:Vue.js vs. React: what happened in 2017 by KitDuncan on Sunday December 24, 2017 @01:19PM (#16000564)
Since October (I think) vue single file components work flawlessly with typescript. Can't speak for jsx though.
Re:Vue.js vs. React: what happened in 2017 by tomonl on Sunday December 24, 2017 @02:21PM (#16000888)
It works in the <script lang="ts"> part of your .vue file, but not the <template> part.
Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @03:05PM (#16001077)
Ah, that's a bummer. Vue Templates seem wildly regressive to me -- I can't fathom going back to stringly-typed Handlebars wrangling after using JSX/TSX.

After looking into this further it seems like Vue Templates also differentiate between values and components. In React I often write components which can take in either: a good example is text which the consumer might want to format. You can easily write the component so that they pass in a string or a <span /> element.

Vue has a lot of good ideas but the templates are almost a non-starter for me.

Re:Vue.js vs. React: what happened in 2017 by CaveTech on Sunday December 24, 2017 @03:23PM (#16001163)
You can use slots to pass HTML or Components into child components.

You can have vue render jsx or templates, but in practice you can make interactive components very simply using templates which are foundationally simpler and easier to grasp than JSX.

Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @04:13PM (#16001316)
How so? In my mind templates and JSX are equally complex from a user standpoint. In fact I'd argue that JSX is simpler because you don't have to invent slots -- it's an obvious side effect of using JavaScript to generate your structure.

Just reading about slot and slot-scope makes me think Vue's reputation for simplicity is overblown.

Re:Vue.js vs. React: what happened in 2017 by ricardobeat on Sunday December 24, 2017 @05:10PM (#16001562)
It may seem "obvious" to you after being in the water with JSX for a while, but the free-style abstractions afforded by being 'just' JavaScript, like the one you mention, look incredibly complex for someone approaching an unknown codebase.
Re:Vue.js vs. React: what happened in 2017 by faitswulff on Sunday December 24, 2017 @03:19PM (#16001148)
You don't have to use the templates, though. Define a render function and you can even use JSX in it: https://vuejs.org/v2/guide/render-function.html#JSX
Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @04:05PM (#16001294)
Why wouldn't I just use React at that point? Same behavior, less complexity.
Re:Vue.js vs. React: what happened in 2017 by Mary-Jane on Sunday December 24, 2017 @04:43PM (#16001436)
I agree; using JSX outside React feels kinda silly. But Vue is much simpler to grok than React.
Re:Vue.js vs. React: what happened in 2017 by cc81 on Sunday December 24, 2017 @06:42PM (#16001863)
I believe React is very simple and easy to understand.

Redux is not as easy but you can go with MobX instead for easier state management.