maxence-charriere / go-app

A package to build progressive web apps with Go programming language and WebAssembly.

Home Page:https://go-app.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signal based change detection

JulienLecoq opened this issue · comments

Are there any plans to support signal-based change detection, given the current trend? Modern front-end frameworks are increasingly adopting signal-based change detection. This mechanism automatically updates the UI when certain variables change, eliminating the need to manually update the UI by calling an 'update()' function.

I kind of wonder about your inquiry as there are no manual updates in Go-App (for the most part) for the developer.

The term "signals" seems a bit ambiguous as my first idea when it comes to "signals" is about state changes and component interactions like https://go-app.dev/states, which is part of Go-App already.

I saw "signals" mentioned for AngularJS where the signaling idea tries to avoid patching the browser engine for all the places where updates could appear (and check for all possible effects). But Go-App is not a JS Framework and works not like that at all.

In Go-App there is no browser patching at all and all changes to the DOM are controlled by the UI routine and happen on the Go language level. I do think that there could be optimizations there, but in a totally different way. As I understand it, Go-App is basically a loop-driven (Immediate Mode) model, that has optimizations to not re-render everything and even if it renders it, it is often not updating the DOM or does it quite efficient.

I may be ignorant about the JS world (and for a reason). May I ask what your idea is on what level can Go-App utilize the "thing" you are talking about?

@oderwat said it all.