Re:Data fetching on the web still sucks
by richeyryan on Thursday January 28, 2021 @11:43AM
(#25944592)
Would the stuff you have on Github be a fair representation of your ideal way of writing a web UI?
Re:Data fetching on the web still sucks
by austincheney on Thursday January 28, 2021 @11:56AM
(#25944792)
Try this: https://github.com/prettydiff/share-file-systems/tree/tests
It is a complete GUI with full state management and the browser part of the application is very tiny.
Re:Data fetching on the web still sucks
by richeyryan on Thursday January 28, 2021 @12:04PM
(#25944924)
I had a look through that alright. Do you code in that style in work?
Re:Data fetching on the web still sucks
by austincheney on Thursday January 28, 2021 @12:29PM
(#25945276)
I have been away from my primary employer for about a year and they are HUGE with many different teams that do many different things in many different ways. I just try to gel to the team and not be disruptive.
The state object is just a regular JavaScript object. I prefer to avoid classes as they increase complexity for almost no substantive benefit.
Changes to the UI are handled as events whether those events are from user interactions, HTTP responses, or web socket data events.
I update the DOM using old school DOM methods and some custom DOM methods I have written to do things the standards do not provide.
This stuff that people cry tears of blood over is easy and very basic. I really think the bane of evil is addEventListener allowing multiple handlers for the same events which allows laziness and super increased complexity.
What’s more challenging is writing test automation that executes in the browser and coordinates between browsers of different computers.