News for hackers. Stuff that matters.
Re:Flipboard releases React Canvas by danabramov on Tuesday February 10, 2015 @02:22PM (#9029281)
Oh my, it is beautiful on the inside. Check out the source.

They're totally showing off the power of React component model even when it doesn't render directly to DOM tree: https://github.com/Flipboard/react-canvas/blob/master/lib/Su...

It's about describing nested side effects in time, really.

Re:Flipboard releases React Canvas by karanbhangui on Tuesday February 10, 2015 @03:30PM (#9029684)
Looking at the author, not surprising. I was an intern in Yahoo! Mobile's web team in 2009, and sat beside Michael Johnston. He was incredibly productive and talented, and was the backbone of the whole mobile team. Everyone came to him for advice. I remember he wrote a sophisticated color picker in an afternoon, and the code was a work of art.
Re:Flipboard releases React Canvas by mjjohnston on Tuesday February 10, 2015 @06:10PM (#9030537)
It's worth mentioning that much of the code that integrates with React internals is based on the work in react-art: https://github.com/reactjs/react-art

This is the same technique used by Netflix for their React-based television UI.

https://www.youtube.com/watch?v=eNC0mRYGWgc

Re:Flipboard releases React Canvas by 2bit on Tuesday February 10, 2015 @08:32PM (#9031107)
Is this faster than the react-art canvas renderer? Why use one vs the other?
Re:Flipboard releases React Canvas by miguelrochefort on Tuesday February 10, 2015 @06:36PM (#9030645)
Can you point out to what exactly is notable about this code? I don't see anything special.
Re:Flipboard releases React Canvas by danabramov on Wednesday February 11, 2015 @08:04AM (#9032576)
React is traditionally used for outputting DOM, but in this case components are overriding its hooks to perform another side effect—updating the canvas. This just shows the power of the component paradigm. Just like React Native does it with iOS views. Other view frameworks (Ember, Angular, Riot, whatever) don't even come close to being able to express this, because they're so tied to DOM itself.
Re:Flipboard releases React Canvas by cnp on Tuesday February 10, 2015 @02:26PM (#9029305)
Is it possible -- literally -- to write more clear code? Stunning implementation
Re:Flipboard releases React Canvas by vowelless on Tuesday February 10, 2015 @03:12PM (#9029584)
I have generally done systems and backend work, so usually C/C++/Go/Python. React is making me extremely excited to do some frontend work!

Is React a good introduction to the land of frontend programming? Or do I first need to familiarize myself with vanilla JS and go bottom up to React?

Re:Flipboard releases React Canvas by grayrest on Tuesday February 10, 2015 @04:20PM (#9029981)
You need to know Javascript's quirks. I generally recommend [1] for experienced developers. Everything on that page is important to know (edit: except the perf stuff, which changes as the js engines get better). I'll second the Eloquent Javascript recommendation in another comment if you're looking for a more involved book.

[1] http://bonsaiden.github.com/JavaScript-Garden/

With the JS quirks out of the way, I would recommend building something in React and muddle through things with SO/google.

The hardest part of frontend dev for an experienced backend dev is the CSS. CSS is conceptually simple but there's a LOT of random domain knowledge you need to get layouts you want. You can bypass a lot of it by using a sass framework (e.g. foundation or bourbon) at the cost of adding a build step and another abstraction layer on top of CSS.

Re:Flipboard releases React Canvas by adamnemecek on Tuesday February 10, 2015 @03:20PM (#9029623)
You should def know JS prior to learning React.

This is a pretty great book

http://eloquentjavascript.net/

Re:Flipboard releases React Canvas by hnmcs on Tuesday February 10, 2015 @03:22PM (#9029630)
Both.

Alternate your time spent learning.

Sometimes study high-level, sometimes low-level. (Low-level, tongue-in-cheek, as in "JS is the bytecode of web applications.")

Re:Flipboard releases React Canvas by ecesena on Tuesday February 10, 2015 @03:34PM (#9029713)
I have a similar path, and honestly found the FE dev tools being the slowest thing to learn about (too many, too frequently updated/breaking things).

I think you can build a lot on top of React with minimal knowledge of js (so, yes, start), but you definitely want to go deep and understand how it works inside (so, yes, also study js).

Re:Flipboard releases React Canvas by supercoder on Tuesday February 10, 2015 @04:08PM (#9029905)
There's no need to go deep diving on learning JavaScript.

As you're using a high level framework, you're interacting with that more than the details of JavaScript. So in essence you're learning 'React' not 'JavaScript'.

So just start building in React and the JS will come along naturally.

Re:Flipboard releases React Canvas by driverdan on Tuesday February 10, 2015 @07:25PM (#9030833)
That's not really true. You really need to understand JS to work with React, especially since you need to combine it with other libs since it's only the view layer.
Re:Flipboard releases React Canvas by vladev on Tuesday February 10, 2015 @02:54PM (#9029468)
I actually wonder if it can be done even more elegant with RxJS?
Re:Flipboard releases React Canvas by ZenoArrow on Tuesday February 10, 2015 @03:31PM (#9029696)
Thanks for the heads up about RxJS, didn't know that existed.

Seeing as one of the benefits of React is in server-side rendering, and now with the new OSS nature of .NET, it's worth considering standard Rx as well ( https://msdn.microsoft.com/en-gb/data/gg577609.aspx ).

Rx is very new to me, so I may have this description wrong, but it essentially seems to be well-supported event-driven programming library. Worth a look if you're interested in FRP.

Re:Flipboard releases React Canvas by seanmcdirmid on Tuesday February 10, 2015 @04:13PM (#9029940)
Rx isn't FRP, and doesn't really solve the same problem that react does (view management). Its grew for pushing discrete events around, but doesn't provide for any signals and continuous binding.
Re:Flipboard releases React Canvas by mhomde on Tuesday February 10, 2015 @04:47PM (#9030149)
Rx programming is so great. It's one of those things that you seldom find a use case for but when you do it leads to 50x easier and more readable code. It truly is for events what Linq was for collections Mostly only useful with more advanced ui and network programming though
Re:Flipboard releases React Canvas by masklinn on Tuesday February 10, 2015 @03:16PM (#9029605)
You may want to take a look at elm-html.
Re:Flipboard releases React Canvas by danabramov on Tuesday February 10, 2015 @03:25PM (#9029651)
Also Cycle (virtual-dom + Rx)