News for hackers. Stuff that matters.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by mihaela on Saturday November 18, 2017 @11:37AM (#15729642)
React is great but this:

"I’m waiting for the day when the only way that you build UI, the only way you can build UI is with the React paradigm."

is scary.

Re:How Facebook's Instagram Acquisition Led to the Open Sour... by peterhunt on Saturday November 18, 2017 @05:27PM (#15731014)
To be clear, I didn't mean that I want React-the-library baked into every platform. I do think that React-the-mental-model is superior to, say, Cocoa-the-mental-model, and by baking this model into the underlying layers of the stack we'd stand to see a lot of performance gains.

Just my 2 cents though.

Re:How Facebook's Instagram Acquisition Led to the Open Sour... by dbbk on Sunday November 19, 2017 @07:11AM (#15733567)
Surely you're really just talking about component-oriented design, which basically every framework has now converged on - React, Angular, Ember, Vue, Riot, Polymer, etc.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by rakoo on Sunday November 19, 2017 @01:38PM (#15735164)
I'm pretty sure it's this + 1-way data binding + data as the driver of everything + javascript as the _only_ language to describe the ui. Because those elements make for a simpler way to build UIs and I totally agree with this point of view
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by sjmulder on Sunday November 19, 2017 @09:13AM (#15733956)
These are all DOM-based UI frameworks. Perhaps it's because that's where all the action is at but I wouldn't be surprised if it were driven, for a large part, by the underlying platform.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by hesarenu on Sunday November 19, 2017 @10:52AM (#15734353)
Most of those keep the html separate even many are tightly coupled.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by sanatgersappa on Saturday November 18, 2017 @09:19PM (#15731871)
True. fwiw, Google's new mobile UI framework Flutter uses the React paradigm.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by dustingetz on Saturday November 18, 2017 @01:06PM (#15729981)
That's super interesting. I dont think React is the end state; it has a couple warts that are solved in research communities.

TLDR React is not efficient enough, the performance requirements of next-gen apps of 2020s is going to break React because rendering is not incremental. These warts are basically places where React departs from pure functional programming to achieve ease of use.

1) Fundamental performance problem in render-tree-pruning (it is not truly reactive, it does more work than necessary). This is not an issue today except in the most sophisticated apps, but in apps of the 2020s it's going to be a huge problem. My startup http://hyperfiddle.net/ spends a great deal of energy trying to make React faster, it all boils down to forceUpdate which breaks the "functional programming" philosophy and makes the programming model significantly worse.

2) The solution to (1) is a reactive, spreadsheet-like programming model that generalizes to more than just the View-as-a-function, but also to the rest of the functions. React's solution injects fat "Component" instances everywhere in the view; its not actually just functions, so it breaks for the other expensive computations in the app, which will also need to be optimized in the 2020s.

https://github.com/slamdata/purescript-halogen is the best shot i know of at solving all this; it may be 5 more years yet until this is simplified enough to become mainstream, but all-in-all the ever increasing complexity of apps means truly efficient rendering is inevitable, and React is not that.

Re:How Facebook's Instagram Acquisition Led to the Open Sour... by Vinnl on Saturday November 18, 2017 @02:22PM (#15730238)
What makes you think 2020 apps are going to be significantly different from 2018 apps? Main difference I can think of is VR and WebAssembly, but the former is not likely to completely change the majority of websites in two years, and the latter is not restrained by React anyway.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by dustingetz on Monday November 20, 2017 @10:23AM (#15740486)
"2020s" e.g. 2028

Apps are like moores law; every 1.5 years the sophistication doubles.

Re:How Facebook's Instagram Acquisition Led to the Open Sour... by dwaltrip on Saturday November 18, 2017 @02:43PM (#15730317)
Does React with Mobx count as incremental? It only re-renders components when the data accessed by that component has changed.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by dustingetz on Friday November 24, 2017 @02:46PM (#15772649)
That's "reactive"
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by hellofunk on Saturday November 18, 2017 @12:13PM (#15729790)
Why is that scary? React's paradigm has changed how UIs are built in many different platforms. And you don't have to use React directly to enjoy its paradigm since other libraries and technologies have appeared that follow the same approach.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by platz on Saturday November 18, 2017 @01:51PM (#15730131)
You haven't seen how paradigms change yet, have you
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by hellofunk on Sunday November 19, 2017 @03:15AM (#15732861)
Your comment is unclear.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by hesarenu on Saturday November 18, 2017 @12:58PM (#15729956)
I would actually like to see React paradigm used more in native development.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by polskibus on Saturday November 18, 2017 @03:47PM (#15730591)
Winapi and windows forms in .net. message loop for UI programming is a very very old pattern. It was just reinvented for web and JS. I don't know if people that created react actually ever used Windows message loop.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by hesarenu on Sunday November 19, 2017 @10:42AM (#15734310)
Not the loop. JSX way of declaring UI structure.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by polskibus on Sunday November 19, 2017 @01:51PM (#15735237)
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by mlsarecmg on Monday November 20, 2017 @02:57AM (#15738474)
XAML is a template, it hooks into a controller via bindings. You could compare it to Angular maybe.

In React a view is a function of state:

    const Header = ({ color, children }) => <h1 style={{ color }}>{children}</h1>
    
    // Gets transpiled into:
    const Header = ({ color, children }) => createElement('h1', { style: { color } }, children)
    
    <Header color="red">hello</Header>
A large part of my career was about XAML/WPF/SL. I know it took me a year or more to really understand it deeply, being able to extend and do everything i wanted. I came to the same state 60 minutes into React. The pattern behind it does make many things easier. And that is an understatement. I believe that's also the main reason Microsoft itself is betting on React for cross platform and native apps as well as extension eco systems:

https://github.com/Microsoft/react-native-windows

https://github.com/Microsoft/reactxp

https://developer.microsoft.com/en-us/fabric

Re:How Facebook's Instagram Acquisition Led to the Open Sour... by hesarenu on Monday November 20, 2017 @02:34AM (#15738404)
I suppose so. But i do like reactjs declarative style rather code behind. Something which Flutter does as well.
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by swyx on Sunday November 19, 2017 @03:20AM (#15732873)
are you referring to his comment about Electron? because React Native is a thing
Re:How Facebook's Instagram Acquisition Led to the Open Sour... by yongelee on Saturday November 18, 2017 @02:16PM (#15730219)
More naive to assume that React is the end game for UI design.