Our great sponsors
-
reactive-gtk-vala
Example of form using properties and bindings to achieve similar experiences to JS frontend programming.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
We can also achieve this in Vala using properties and bindings from GLib. In this article we will produce a login screen that validates the username and password fields. All code is available at Github.
I've been doing some web programming using preact these last weeks and one of the things that impressed the most was the way logic and UI are split in code. When doing functional components this is specially explicit. Your function returns whatever should be displayed by the component and receives a props object containing all the information the components need to render. A component rerenders when some of its props are changed, either because an external component made changes or in response to an event.