Christopher Chedeau (vjeux), a Facebook engineer known for React and Prettier, writes about JavaScript tooling, performance and front-end design.
HN commenters list it among blogs they follow, and one credits technical blogging on it with bringing job offers. Another links his Excalidraw reflections.
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…
I’m a huge fan of CoffeeScript and use it wherever I can... It works for the most part but I had to straddle the syntactical line between brittle and overwrought, with all of the extra brackets.
I don't know what extra brackets are referred to here without code samples, but based on the link to Vjeux's post [0], they are completely unnecessary, given the behavior of React vis-a-vis multiple parameters and CoffeeScript with syntactic whitespace and object literals, at least as of CoffeeScript 1.7... For instance, the example:
{div, h3, textarea} = React.DOM
(div {className: 'MarkdownEditor'}, [
(h3 {}, 'Input'),
(textarea {onKeyUp: @handleKeyUp, ref: 'textarea'},
@state.value
)
])
Could be written with far less punctuation as:
{div, h3, textarea} = React.DOM
div
className: 'MarkdownEditor'
h3 {}, 'Input'
textarea
onKeyUp: @handleKeyUp
ref: 'textarea'
@state.value
(Though I usually pass null as the empty param to make it feel worse...)
[0]: http://blog.vjeux.com/2013/javascript/react-coffeescript.html
Cropping images is a massive problem for social media. Here is a talk from 2013 by Christopher Chedeau a front end engineer at Facebook describing some of the problems with their image layout algorithms.[1]
Initially, they tried to solve the problem by getting users to tag people inside the image and then use location of the tags as parameters to crop. If someone is tagged in a photo, Facebook makes sure that person is always inside of the cropped version.
Here is the write up from Christopher's blog.[2]
Was Instagram only using square images at one time? That would have been a brilliant way to have solved this problem.
1. http://blog.vjeux.com/2014/image/image-layout-algorithms-html5devconf.html
2. http://blog.vjeux.com/2012/image/best-cropping-position.html
I wrote a simple formatter for outputting json values. It respects maximum line length.
https://gist.github.com/nojvek/875d8cad1005da0b95da2840bbc894e6
It implements some of the ideas from https://blog.vjeux.com/2017/javascript/anatomy-of-a-javascript-pretty-printer.html
Could be re-used for other languages very easily. The core is you have nested group chunks with (indent breakpoint, dedent breakpoint, separator breakpoint, more text chunks and child group chunks).
when formatting a single line, indent and dedunt breakpoints do nothing, but in multi line format, they specify how text will be laid out.
The algorithm is simple, try to format in single line if it fits within maxLineLength, if not break into multiple lines, and do that recursively.
From the comments
> I believe it's Google Closure compiler putting commas in there.
Someone else linked to an explanation of why
> http://blog.vjeux.com/2011/javascript/javascript-comma-trick.html
</fact><opinion>
So from the looks of it, the problem is in Opera's javascript implementation.
I'm not sure how much Google uses Closure Compiler internally but I wouldn't have thought they would use code they knew to cause issues in some browsers. I guess that ether means the Opera implementation is wrong and the code should work fine, or Google didn't test this as fully as they should have done
If you don't insist on JSX, which you don't need, then just use react itself directly in coffeescript, and you won't be able to tell the difference without looking really close. The "canonical" description of this is at [0], but that page is kind of "old". I haven't found value in wrapping everything in parentheses like he recommends. Also that code is using renderComponent() which nowadays should be replaced by some combination of createClass(), createFactory(), and render().
[0] http://blog.vjeux.com/2013/javascript/react-coffeescript.html