4,836 karma · joined February 6, 2010
Do you think Flow was built in 3 months as a reaction to Typescript? Not that it was a big enough problem that two different groups of people independently decided to try to solve it? EDIT: disregard this, Flow was introduced much longer than 3 months after TypeScript. The blog post introducing Flow mentions TypeScript, and is probably worth reading for background [1]
> Nuclide instead of Atom/Sublime/VSCode
Nuclide is an Atom plugin.
> Jest instead of Jasmine/Mocha
Jest provides a superset of Jasmine functionality, and uses Jasmine as its test runner.
[1] https://code.facebook.com/posts/1505962329687926/flow-a-new-...
1. In the browser we have less control over the environment the code runs in, requiring tooling to achieve a stable, normalised environment which we can improve at our own pace, rather than the rate at which browsers are updated.
2. JS has become very widely used very quickly, which means that there have been lots of hastily built things, which have been replaced by better things (and for every 'better thing' there are many alternatives which fell by the wayside), and a larger pool of people to build them.
3. It's easier than ever to build new tools (or any kind of app, for that matter), because the npm ecosystem makes it trivial to combine existing smaller pieces of code into new combinations.
When? Can you cite an example? Keep in mind that for most breaking changes React typically goes to a deprecation warning for the duration of a major release instead of hard-breaking changes, so in reality you have roughly double the time between truly breaking releases, generally speaking.
If you're using a JS typechecker like Flow (and IMO if you're building a large app, you should) you can even make use of disjoint unions to type your Flux action objects: https://flowtype.org/blog/2015/07/03/Disjoint-Unions.html
Off the top of my mind:
- Server or Universal rendering - Hot Module Reloading (refreshing is fine!) - (early stage) proposed JS syntax
The main thing that is missing from this package is testing, but that's a very opinionated kettle of fish.
Another, somewhat spooky example of a tagged shark demonstrates the chasms GPS technology will reveal to us in time. Off the coast of Australia, a ten-foot-long, tagged female great white shark that went by the name “Shark Alpha,” disappeared from the radar. According to the tracking device, at four o’clock in the morning, the shark was suddenly torn five hundred yards into the depths, with astonishing power and speed. Within seconds, the chip also recorded a spike in ambient temperature, from 8 degrees Celsius to 25. That is the temperature of an animal’s insides; the shark must have been eaten by an aquatic predator. The chip could be followed for the next eight days, at which point it vanished from the control monitor. It was most likely voided. Four months later, it was found on shore, bleached by gastric acid. Researchers suspect Shark Alpha fell prey to a much larger creature. It will have to have been at least five meters long and weighed two tons or more. But what was it? An orca? Orcas usually hunt close to the surface. The deepest killer whale dive on record is 260 yards. Another great white? This species has a body temperature of 18 degrees—not 25. Could it actually have been a monstrous octopod or a megalodon, a gargantuan prehistoric predator that some say may has survived, hidden in the darkest depths of the ocean?
I wrote a blog post about the rationale behind this project: https://jamesfriend.com.au/why-port-emulators-browser
Also as a bonus, here's The Oregon Trail: https://jamesfriend.com.au/pce-js/mecc/oregon-trail.html
The section on JSX & the React.createElement API is a weird diversion, because these aspects are so unrelated to the high level code structure complaints that they belong in a different article. Putting that aside, this section seems unfair at best. Firstly the JSX syntax is disregarded due to verbosity[0]. Okay, not to everyone's taste. However the author then goes on to making a comparison between React's createElement/createFactory APIs and the hyperscript-helpers npm package, which is incredibly uncharitable as the former is a performant, low level API intended for building ergonomic APIs on top of, and the latter is a high level, ergonomics-centric API.
Redux is a small library, which needs to be used underneath application-specific abstractions to avoid boilerplate. Not everyone will want to come up with such abstractions themselves. I can certainly see the value for an ergonomic, high-level, Rails-like project on top of React + Redux. Maybe that's the article the author should have written.
[0] I would argue many developers actually find the verbosity of JSX helpful when dealing with large trees of components, as compared to nested function calls. The fact that JSX closing tags repeat the tag name is key to this.
This is the year of the framework fatigue meme.
Next year is the year everyone realises why we had frameworks and tries to salvage the mess they made last year, when they wrote an app 'without a framework' and ended up with an under-specified, incomplete, undocumented, informal framework.
You don't need to make the entirety of your state tree an Immutable.js structure, just the parts which are managed by the reducers you write.
See the docs page called Thinking in React [1] and grep through all the mentions of 'data flow' and you'll see how one way (circular) data flow is how React is intended to be used.
[1] https://facebook.github.io/react/docs/thinking-in-react.html
For example, you can use d3-scale to map from data to drawing coordinates, or straight to SVG path data (using d3-path/d3-shape). You can then easily render this to an inline SVG using React (or to some other backend using React libs like react-canvas and gl-react). Building the svg elements directly this way makes it easier to attach React event handlers to them, and gives you more fine grained control, rather than using off-the-shelf components.
Here's an example combining d3-shape and d3-scale with React and react-motion: https://jsbin.com/mehata/9/edit?js,output
Around that time, I noticed the new modular repos on the d3 Github org[1] coming together, and have since been watching with great anticipation. I'm glad to see d3 evolving for a new world where its excellent, fine-tuned collection of math and drawing functions work in concert with your rendering framework of choice.
- React 0.14 is 55kb
- jQuery 1.11 is 38kb
- Backbone + Underscore (dependency) are 15kb
Until you try to build a large app and get murdered by maintainability problems (eg. treating the DOM as a store of mutable state, managing event listener binding lifecycles, etc) and performance issues (eg. DOM reads and writes to occurring in an interleaved fashion inside inner loops)
As it stands, the CSS Modules approach doesn't yet provide the same level of expressiveness which can be achieved with the styles-in-JS approach, but perhaps there is still value in evolving CSS-the-language to provide enough expressiveness while still providing an optimal syntax for style definition and facilitating static analysis and transformation specific to the domain of styling.
https://github.com/gaearon/react-dnd/blob/master/scripts/bui...