News for hackers. Stuff that matters.
Re:A div that looks different in every browser by pjmlp on Monday July 09, 2018 @01:09AM (#17488097)
Yeah and then they all jump around React as some amazing achievement, having rediscovereed how 90's native UI do event handling.
Re:A div that looks different in every browser by jhomedall on Monday July 09, 2018 @10:18AM (#17490320)
React isn't really anything like 90s UI libraries. It is, however, very much like the fairly recent native immediate-mode GUIs that have come out (https://github.com/ocornut/imgui, https://github.com/PistonDevelopers/conrod, etc).

The core feature of React is that your UI is a pure function of your application state. In (e.g.) the Win32 UI, you would receive events, and then need to manually transition your current UI state to the new UI state (hide this button, disable this input, etc).

Re:A div that looks different in every browser by pjmlp on Monday July 09, 2018 @02:01PM (#17492147)
Smalltalk UIs used a pattern called dependency propagation to make objects update themselves based on system wide notifications.

Similar idea was used on Oberon System 3 Gadgets toolkit.

Also java.util.Observable based on the same Smalltalk ideas was already part of Java 1.0.

Re:A div that looks different in every browser by jhomedall on Monday July 09, 2018 @04:33PM (#17493208)
That's still event handling. You can do basic binding between outputs and values, but more macroscopic changes (closing a dialog, changing tabs, etc) requires tracking the state your UI is in, and manually transitioning.

This is markedly different than React, where the framework diffs the desired UI state (which is a pure function of your application state), and the actual UI state. The minimal number of UI operations necessary is then applied to make the latter match the former.

ImGui above works the same way, which makes it very popular for devtools in game development.

Re:A div that looks different in every browser by pjmlp on Tuesday July 10, 2018 @01:54AM (#17495762)
ImGui is quite similar to MS-DOS game UIs, before we migrated to Windows.

The source code of quite a few ones is available around the Net.

Re:A div that looks different in every browser by akx on Monday July 09, 2018 @06:06AM (#17489143)
Event handling isn't special in React. One-way data flow and UI-as-a-function-of-state are. Which 90s native UI toolkits do that?
Re:A div that looks different in every browser by pjmlp on Monday July 09, 2018 @06:43AM (#17489278)
Re:A div that looks different in every browser by chadcmulligan on Monday July 09, 2018 @04:44AM (#17488791)
and think vi is great