Live data from Hacker News

Flipboard releases React Canvas

github.com

111–120 of 136 posts

Re: Flipboard releases React Canvas

#111
post #109

Big fan of React. For others using it, why use JSX instead of just doing everything in js? In other words, why is HTML like this: Lorem ipsum... Preferable to something like this (which can easily be done with some helper methods wrapping the verbose React DOM methods): $group({styles: style.group}, $image({styles: image, src: 'http://...'}), $text({styles: style.text}, 'Lorem ipsum...')); No pre processing step requ…

For me, I find it much easier to get an understanding of the structure of the components by looking at hierarchical markup vs. plain old JS. Everyone has a different idea of how they want to lay out their JS, but most people know/agree on what XML should look like.

Having a preference for reading HTML seems fair, though I prefer closing parens to closing tags for short bits, and the JS formatting problem is one you've already got in the rest of your code base. Also, you'll be formatting HTML + JS bits and not just static HTML like in the example. JSX seems like a good deal of machinery to support this preference.

Re: Flipboard releases React Canvas

#112
post #67

holy flipboard, did you see they re-implemented a subset of CSS into JS? https://github.com/facebook/css-layout I was literally thinking about doing something similar the other day for an experimental/learning project. React is taking over the web, and I'm excited for it - coming from a person who is incredibly cynical about frameworks. React is proving itself as a powerful library, not an assumption driven framework…

This was specifically referenced in the React Native announcement video. [0] [0] http://youtu.be/7rDsRXj9-cU?t=16m35s

That's an impressive segment, thanks for linking.

Re: Flipboard releases React Canvas

#113

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…

Please don't take this wrong. I think what you're doing is great. I like perf too. I'm just kind of thinking outloud. For example copy/paste and "define" require you to support selecting text on your canvas and then telling the OS about it when the user picks "copy" or "define". Otherwise you get the bad behavior that 99.99% of all native apps have which is that they don't support selecting anything except in editabl…

Understood. We just happened to have unconventional constraints that suggested an unconventional solution. There are many ways to lobby for improvements for things (especially Web standards) and perhaps with us showing the limitations of the DOM, we can influence change for the better.

Re: Flipboard releases React Canvas

#114
This is a great project indeed. However, as many here have already pointed out, there are many limitations to this approach, SEO and lack of ctrl+f for example.

Which reminds me of flash. Most flash controls had similar drawbacks. I think web development shouldn't repeat that mistake (again).

It also reminds me that Google Docs took similar approach. As far as I remember they use a lot of canvas with a bit of DOM intertwined where necessary.

Re: Flipboard releases React Canvas

#115

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…

Please don't take this wrong. I think what you're doing is great. I like perf too. I'm just kind of thinking outloud. For example copy/paste and "define" require you to support selecting text on your canvas and then telling the OS about it when the user picks "copy" or "define". Otherwise you get the bad behavior that 99.99% of all native apps have which is that they don't support selecting anything except in editabl…

By the way, you’re re-defining Flash but with a canvas and JS :)

Re: Flipboard releases React Canvas

#117

So one of my friends says that a potential issue is accessibility compliancy. And that due to lack of compliancy Flipboard may find themselves in a lawsuit. I know next to nothing about this type of thing. Anyone have thoughts on the issue?

Lawsuit seems unlikely, but it is certainly hostile to screen readers (though, it's quite possible to create a set of hidden DOM nodes that expose the structure of the page to screen readers. See google docs)

Re: Flipboard releases React Canvas

#118
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?…

apps are the dominant paradigm on phones and tablets because the web experience on touch only devices with tiny screens was terrible when phones and tablets took off. the web experience has improved but still lags behind because the investment in native apps far outstrips the investment in making webapps better on mobile

trying to emulate native apps in the browser is the same losing battle, but the inverse. good luck with canvas

Re: Flipboard releases React Canvas

#119

Big fan of React. For others using it, why use JSX instead of just doing everything in js? In other words, why is HTML like this: Lorem ipsum... Preferable to something like this (which can easily be done with some helper methods wrapping the verbose React DOM methods): $group({styles: style.group}, $image({styles: image, src: 'http://...'}), $text({styles: style.text}, 'Lorem ipsum...')); No pre processing step requ…

The XML-like syntax is just less work, mentally and physically: no need for commas between props, the props object and children, no need to carefully manage all those commas when editing, adding, deleting, moving and removing stuff later on, plus the closing tag syntax makes nesting nicer by providing context via the tag name; all of which adds up to make it more pleasant to work with.

The second approach is what I was doing in various flavours for years prior to JSX. I ended up having to adopt comma-first to stay sane in larger/deeper templates, ( e.g. https://gist.github.com/insin/8e72bed793772d82ca8d ). The first thing I did when I saw JSX was start to write a React.DOM emitting version of my then-usual JSON-ML type stuff, but then I tried it and... never going back.

Re: Flipboard releases React Canvas

#120
post #5

Is there a live demo I can run?

Just go to https://flipboard.com on your mobile phone!

When I went to the example links given at the end of the post with my phone, I jut got a "spinner" for several minutes before I gave up waiting...

On https://flipboard.com/explore I get some exciting but very distracting rendering artefacts (blocks on the images changing intensity at a high speed until I start scrolling fast - if I scroll through slowly, the flickering continues)..

If I click through on one of the example pages, scrolling seemingly randomly stops working smetimes (after a few tries, it started snapping back to where it was, even when there clearly is more content below).

This is with the Android browser on 4.2.2, admittedly on a rather obscure phone (a Kingzone K1 Turbo) .

If you're interested in more details, my e-mail is on my profile.

Post reply on HN