News for hackers. Stuff that matters.
Re:React.js in Real Life at Codecademy by sillysauce on Friday February 13, 2015 @10:43PM (#9048669)
This article kind of comes at a perfect time for me. I just recently started working on a project with a code editor and I've been battling for a while how to communicate changes through react.

I plan to use ace, and require the ability to get and apply patches as the user types into the ace editor, get code when they need to compile, as well as be able to modify other properties of the editor.

At the most complex level, I need to keep two ace editors in-sync, doing this with cure javascript and ace is simple, as you just need to apply a patch from one editor to the other.

Building large and complex applications has always been the big problem for me with React, and the author states it right up front

    we ran into issues finding examples of how React could
    apply to an application as complex as ours, given that
    most tutorials focus on the specifics of toy-sized demo
    apps as opposed to more general discussions of the
    problems specific to larger applications.
This is just something that is going to take time though.
Re:React.js in Real Life at Codecademy by natmaster on Saturday February 14, 2015 @01:23AM (#9048920)
This is why they gave the presentation on Flux, which is architecturally how Facebook solves this problem.

Basically the first principal you must learn is to find the lowest common ancestor to store state. (http://facebook.github.io/react/blog/2013/11/05/thinking-in-...) After realizing this the immediate thing people do is pass call backs through children so grandchildren's actions can communicate with where the state is. This leaks through all the components however, which is why Flux separates actions out into something that all the components have access to.

Re:React.js in Real Life at Codecademy by insin on Saturday February 14, 2015 @05:00AM (#9049249)
Worth pointing out that you don't need a full Flux implementation to get the benefits of going sideways to an action module:

https://github.com/ryanflorence/react-training/blob/gh-pages...

Re:React.js in Real Life at Codecademy by adamnemecek on Saturday February 14, 2015 @04:56AM (#9049241)
this is something i really like about ember. there's a good number of large scale open source projects that you can steal ideas from.
Re:React.js in Real Life at Codecademy by bronson on Saturday February 14, 2015 @11:23AM (#9049992)
Examples? Hopefully ones that are using idomatic Ember of today?
Re:React.js in Real Life at Codecademy by adamnemecek on Saturday February 14, 2015 @12:52PM (#9050201)
Re:React.js in Real Life at Codecademy by filearts on Friday February 13, 2015 @04:43PM (#9047411)
Bit of a shameless plug, but you can now get your flux on straight in Plunker http://plnkr.co/edit/tpl:a3vkhunC1Na5BG6GY2Gf in a familiar UX.

I've included minimal starter template for React.js and React.js (with addons) as well as transparent jsx transformation. I'm open to more complete starter examples if anyone better at React.js wants to contribute them!

Re:React.js in Real Life at Codecademy by luisrudge on Friday February 13, 2015 @08:59PM (#9048409)
As a matter of fact, I created a really simple react yeoman generator[0]. All other generators are pretty bloated with lots of stuff. Maybe that's ok for new applications, but I was just trying to learn react and they all were heavily bloated.

[0] https://github.com/luisrudge/generator-simple-react-browseri...

Re:React.js in Real Life at Codecademy by bcjordan on Friday February 13, 2015 @07:16PM (#9048061)
I'd love to see a JSPM version of that to easily bring in dependencies

* http://jspm.io/

* https://www.youtube.com/watch?v=iukBMY4apvI

Re:React.js in Real Life at Codecademy by uptown on Saturday February 14, 2015 @10:40AM (#9049900)
Just started looking into React yesterday. What I've read thus far doesn't discuss your server-side at all. Is it agnostic to what's running on your server ... any JSON-based RESTful back-end will do, or are there benefits to using a specific stack for your back-end?
Re:React.js in Real Life at Codecademy by cbee17 on Saturday February 14, 2015 @11:39AM (#9050026)
React is indeed agnostic to your server-side stack. Only thing is you'll need a node.js server if you want server-side rendering. (Codecademy runs ours separately from the rails app so we can do server side rendering.)