In the context of React, it allows you to implement a `shouldComponentUpdate` method which simply compares the references of two objects, which is extremely fast. If the references remain the same, then there is no need to invoke `render` again.
Prototype-type based systems are cool in theory, but aren't much fun to use in practice. They are incredibly powerful and easy to abuse. Basically single inheritance in disguise.
Classes aren't great either, but at least using class inheritance makes you feel icky, you're not likely to have shared state on the prototype being randomly mutated, and it's pretty readable.
Separation of concerns and separation of technologies are a different thing. It would appear you haven't done your research. See Pete Hunt's famous talk:
Hm.. I didn't say a word about separation of technologies. If you have one non-broken piece of HTML and related piece of JS to make it "live" - it's one thing. If you use JS/php/python/ruby/lua/whatever to generate HTML, composing it by small pieces into one (inside one component) - it's another thing and it's exactly what I'm talking about.
The question I have is rather whether Relay is an alternative to Flux or that the two are meant to be used in conjunction. Also, which usecases would make Flux better and which Relay (if they are not to be used together).
Relay is one specific implementation of the Flux pattern.
Flux is a generalized pattern and there are a number of libraries out there which implement their own flavor of Flux. Relay is one of those libraries implementing the Flux pattern which focuses on describing data dependencies in the same place the data is used.
No, if you don't have a defined height you will need to either use "display: table", the table-cell technique, or flexbox. When I told the site that I had a defined height, however, it still suggested the table-cell trick, which was not the optimal solution because of the extra markup required.
In my experience, most of the time when I do want to center something vertically, I have a defined height (which can be a percentage!), so absolute centering is the solution of choice.
With no defined height you can still use the `translate(-50%, -50%)` hack, right? I'm kinda surprised it hasn't been mentioned in this thread at all; I use it all the time. http://codepen.io/padolsey/pen/NqKzVG
An image can be vertically aligned with vertical-align: middle; and centered with text-align: center;
Firefox uses pcwaltons method for images (resource://gre/res/TopLevelImageDocument.css). Do you want the image to be in the center/vertical of the div (with the div having a specified height)? If so, then pcwaltons method should work, as long as you have position:relative; on the div.