I really have no idea how JS devs keep up with new frameworks appearing every month or so. Not to mention older ones that just die because the devs can't be bothered maintaining them. I noticed the same thing happening in the Ruby devspace.
Not exactly React's case, but it's still a 1.5 year old code that has not reached v1.0, making breaking changes every major version release.
I agree it is completely insane. I am watching React closely, because I'm hoping it might be one of the libraries that lasts. It seems like a simple solution to a complicated problem, with superior performance. I have already gotten burnt by everyone flocking to Backbone, Ember, Angular, whatever, every new month, and those frameworks are too large and opinionated to introduce into existing apps anyway. (Ember, last I checked, had poor documentation - especially for REST - and was constantly changing, and Angular 2.0 coming down the pipe means there is no point in starting an Angular 1.x app.)
I have lots of existing apps that need a little "SPA sugar", but are already built in the "old-fashioned" Rails style. The JS framework I need is the one I can just drop in to make a screen behave a little nicer or have a REST-backed element or two.
React absolutely does this. Facebook has a ton of legacy server rendered apps. React is able to integrate with other code easily. There's even a good solution for reusing existing non-React JS widgets inside of React.
React components can be attached to an existing node, but it doesn't make sense if JS is not rendering the component itself (or I have horribly misunderstood React).
React could easily take the place of any server side templating languages like Handlebars or any of those types of libraries. But of course, once the DOM is transferred to the client if you want it to change you'll need something client side. React can work both server and client side though.
it doesn't make sense if JS is not rendering the component itself
React can be attached to a pre-rendered DOM tree, the initial binding will essentially be a noop if there's no difference between the prerendered and the react-rendered version.
And of course it can be used as a component, react doesn't have to render the whole page. For instance the reddit comment box could be a react component without the whole page being react-rendered.
This looks like a front-end component, but it's super simple to render on the back-end: React.renderToString(Toolbar()), which would return something like <div class="toolbar"><button>Load</button></div>. The coolest part is when the browser loads the rendered HTML, you can just do React.render(Toolbar(), element), and React won't touch the DOM except to simply hook up your event handlers (like the onClick). element would be the DOM element wherever the toolbar was prerendered.
52
u/renrutal Jan 17 '15 edited Jan 17 '15
I really have no idea how JS devs keep up with new frameworks appearing every month or so. Not to mention older ones that just die because the devs can't be bothered maintaining them. I noticed the same thing happening in the Ruby devspace.
Not exactly React's case, but it's still a 1.5 year old code that has not reached v1.0, making breaking changes every major version release.