Live data from Hacker News

Flipboard releases React Canvas

github.com

121–130 of 136 posts

Re: Flipboard releases React Canvas

#122

If rendering UI to a canvas fits your needs then by all means do it. Just be aware that when it comes time to localize to other languages it starts getting hard to support things like CJK where in order to properly work there's an Input Method Editor ( http://i.imgur.com/JmmYwyi.gif ) that needs to be able to read the text. There's also cut/copy/paste which users can't do from text on a canvas. There's also "define"…

Anything that needs text input is right out too. The DOM text input field hooks into a lot of native functions.

Unfortunately, that affects most games, which would otherwise be an obvious niche for something like this.

Re: Flipboard releases React Canvas

#123
post #84

Earlier quoted context omitted.

React Canvas author here. I outlined some of the reasons why it is not always the right answer: http://engineering.flipboard.com/2015/02/mobile-web/#Practic... On Flipboard we use DOM where appropriate for text input and areas of the application where performance is less critical. And to your point about accessibility: https://github.com/flipboard/react-canvas#accessibility You are correct that the DOM just works. Bu…

For accessibility you can look into what pdf.js does. They put a transparent text on-top of the pdf text (canvas). So you can select it. Pretty clever :)

That's what I was thinking too.

Worth some extra html and style code for those benefits.

Re: Flipboard releases React Canvas

#124

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.

Can you point out to what exactly is notable about this code? I don't see anything special.

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

#125
Out of the box browser features that have been removed/destroyed by the quest for 60fps:

* Copy/paste (holding on an article gives the options to email or report)

* Pinch to zoom

* Double tap to zoom (opens links instead)

* iOS swipe forwards and backwards (renders the page swipe animation twice, at 60fps I guess)

* iOS Reader View (go on, try it, I laughed)

And most importantly

* Any sort of accessibility

60fps doesn't matter to someone who can't see the screen.

60fps doesn't matter to someone who relies on assistive technologies to surf the web.

60fps doesn't really matter.

Re: Flipboard releases React Canvas

#126
post #101

Earlier quoted context omitted.

I absolutely disagree with you. Do you know what app was a huge hit in 1999? Yahoo Mail. I probably don't need to tell you what the "user experience" was like on Yahoo Mail in 1999 vs. Eudora and other popular desktop mail clients. The web's benefits are that powerful.

No, I'm talking about now, not 15 years ago. The difference was that then there was a meaningful functional difference between a cloud app and a local desktop app. Cloud apps were better, and people appreciated that. I'm not convinced that web apps, which have worse UI, not access to native apis (camera, notifications, contacts, etc) offer a meaningful benefit over native apps. You use mail.google.com on your phone?…

Do you think there is any chance we go back to the web in a few years, and native apps are replaced by links on the phone's home screen?

Re: Flipboard releases React Canvas

#127

Out of the box browser features that have been removed/destroyed by the quest for 60fps: * Copy/paste (holding on an article gives the options to email or report) * Pinch to zoom * Double tap to zoom (opens links instead) * iOS swipe forwards and backwards (renders the page swipe animation twice, at 60fps I guess) * iOS Reader View (go on, try it, I laughed) And most importantly * Any sort of accessibility 60fps does…

Exactly. This is a horrible misuse of the canvas element, alas, the moronic "war against native" destroyed all the good we had achieved ten years ago. I think then we had the golden age of web standards, progressive enhancement, graceful degradation, accessibility, and what not. Now we just have a race who can rape poor HTML/CSS/JS further.

Re: Flipboard releases React Canvas

#128

If rendering UI to a canvas fits your needs then by all means do it. Just be aware that when it comes time to localize to other languages it starts getting hard to support things like CJK where in order to properly work there's an Input Method Editor ( http://i.imgur.com/JmmYwyi.gif ) that needs to be able to read the text. There's also cut/copy/paste which users can't do from text on a canvas. There's also "define"…

React Canvas author here. I outlined some of the reasons why it is not always the right answer: http://engineering.flipboard.com/2015/02/mobile-web/#Practic... On Flipboard we use DOM where appropriate for text input and areas of the application where performance is less critical. And to your point about accessibility: https://github.com/flipboard/react-canvas#accessibility You are correct that the DOM just works. Bu…

No, if you want native applications experience, make native applications. Now you are just breaking the web.

Re: Flipboard releases React Canvas

#129

Out of the box browser features that have been removed/destroyed by the quest for 60fps: * Copy/paste (holding on an article gives the options to email or report) * Pinch to zoom * Double tap to zoom (opens links instead) * iOS swipe forwards and backwards (renders the page swipe animation twice, at 60fps I guess) * iOS Reader View (go on, try it, I laughed) And most importantly * Any sort of accessibility 60fps does…

Exactly. This is a horrible misuse of the canvas element, alas, the moronic "war against native" destroyed all the good we had achieved ten years ago. I think then we had the golden age of web standards, progressive enhancement, graceful degradation, accessibility, and what not. Now we just have a race who can rape poor HTML/CSS/JS further.

And yet that's what people pay money for/perceive value in.

Disillusioned web zealot here.

Re: Flipboard releases React Canvas

#130

I'm building a complicated canvas app[1] for visualizing Bitcoin markets. I resorted to building my own framework on top of canvas, exactly for performance reasons. It's fast, but as a framework I was never too happy with it because it's a little half-baked. More recently I found and fell in love with React for other frontend work, and use it exclusively now for any view-related work. I might have to go back and rewr…

Looks awesome! Can you share any architecture info? The frontend is built on d3+reactjs+jquery, how about the backend?
Post reply on HN