8 ms·
While this is a good overview of why _they_ chose Vue over React, I wouldn't risk deriving that you should do the same too. To balance the scale a bit, this is
by jondot 10y ago
While this is a good overview of why _they_ chose Vue over React, I wouldn't risk deriving that you should do the same too.
To balance the scale a bit, this is what they gave up, in favor of "shit that just works" (because this is the tone I'm getting from the article):
1. They decided they want off the enormous driving force for developer experience that is Facebook, and more importantly the Facebook codebase that shapes decisions in React, see [1] and [2].
2. They opted out of major innovation that directly stem from (1), see [3].
3. Parting with Redux, they also decided to part with a community that thinks functionally. This is a big deal not because of writing "pure functional code", but because these group of people can reason about the implications of bad citizenship on the browser - which really, is something the Javascript community really needs.
4. Moving away from functional-esque (for lack of a better term), they also move away from predictable testing. Forget purity and sideeffects. A good litmus test - think about how easy it is to test any given framework at scale, and if a framework is "built with testing in mind" (read: angular) how many hacks would be involved. When you have good foundations for testing, you can do this [6] and be sure everything can be covered [7] .
The only thing I see as a down side with React is the bundle size. The physical size. However I'm not worried one bit because of (1) and (2).
For Redux, I take the liberty to use MobX for small-medium projects (which probably is the overwhelming majority of projects), and Redux for large projects, or projects that I want great testing story in (in many ways these correlate, but some times they don't).
Redux is "boilerplatey" because it is highly granular. This is why the ecosystem around it exploded. But because of (3) the ecosystem around it has a sharp focus around the patterns and practices it applies, which makes choosing the "wrong" library not such a big deal; in a sense its ecosystem is predictable, because it is simple.
JSX or templates, I don't think this deserve a major part of the discussion. Both ideas exists for a long while, and even their predecessors exist for more than a few decades [4] and [5]. I don't think anyone is tilting the scales any where in a major way. I personally am convinced JSX is a new thing because you have first-class IDE support across the board (which you don't have for a given data-properties backed templating language unless it becomes ginormous like Angular). JSX is also simple to hack and you can opt-out or implement your own dumb-templating solution-to-JSX.
Having said that, I see Vue coupled with PHP quite a bit, like, it's an informal standard stack, so it may make sense if you're coming from PHP (but then again so did Facebook, right?). Maybe someone can explain that (is it the Laravel backing?).
[1] https://facebook.github.io/react/contributing/design-principles.html https://facebook.github.io/react/contributing/design-princip...
[2] https://facebook.github.io/react/contributing/implementation-notes.html https://facebook.github.io/react/contributing/implementation...
[3] http://isfiberreadyyet.com/ http://isfiberreadyyet.com/
[4] http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts.html http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts...
[5] https://en.wikipedia.org/wiki/XSLT https://en.wikipedia.org/wiki/XSLT
[6] https://facebook.github.io/jest/ https://facebook.github.io/jest/
[7] https://medium.com/@jondot/how-to-snapshot-test-everything-in-your-redux-app-with-jest-fde305ebedea https://medium.com/@jondot/how-to-snapshot-test-everything-i...