News for hackers. Stuff that matters.
Re:React as a UI Runtime by meandmycode on Sunday February 03, 2019 @04:35AM (#19068632)
I'm not sure I agree at all, 3d engines render loop foregoes any attempt to skip unnecessary rendering to focus on fast, continuous rendering.

React on the other hand tries as hard as possible to avoid rendering, in fact it's whole design of immutability isn't because functional style is better, it's just convenient for it's requirements to avoid rendering.

For me react is more of an antichrist of UI tech, as much as I use it and rely on it, the day I can just mutate some state and that renders (i.e. .. just straight up dom), the better.. if I want to then layer on some immutability patterns then that's entirely in my apps domain.

Re:React as a UI Runtime by wongarsu on Sunday February 03, 2019 @04:54AM (#19068691)
> 3d engines render loop foregoes any attempt to skip unnecessary rendering to focus on fast, continuous rendering.

3d engines often go to great lengths to avoid sending unnessesary data to the GPU. Frustum culling or more sophisticated occlusion culling are standard practices.

Re:React as a UI Runtime by dsego on Sunday February 03, 2019 @06:36AM (#19069059)
Have you looked at Mithril? Looks a lot like React, but there is no need for immutability, because it redraws after events or xhr calls. You can just mutate a model/store object in event handlers and the UI reflects the changes. Imho, this is a much simpler model and it's what you need 99% of the time.
Re:React as a UI Runtime by faitswulff on Sunday February 03, 2019 @08:53AM (#19069548)
OP is correct, the React render loop is very much inspired by 3D game engines: https://www.youtube.com/watch?v=x7cQ3mrcKaY#t=1196
Re:React as a UI Runtime by Aeolun on Sunday February 03, 2019 @04:50AM (#19068675)
3D engines have the part where they try to reduce rendering in the engine part, so you don’t deal with it when writing your application, but it’s definitely there.
Re:React as a UI Runtime by rpedela on Sunday February 03, 2019 @09:58PM (#19073649)
When I say minimize rendering, I don't mean skipping frames although it could mean that. During a single frame, 3d engines try to minimize the number of triangles, textures, etc that need to be rendered in that frame. Also some non-realtime 3d applications, like CAD, will skip frames. If React has to do animation, then it can't skip frames either.