Offline First – A Better HTML5 User Experience
31–40 of 150 posts
Re: Offline First – A Better HTML5 User Experience
#32The most useful pattern I know of for offline web apps is the command queue. Basically, the rendered state of the client is the acknowledged server state plus the client-side command queue. User actions don't make a server request and then update the UI. Instead they directly append to the local command queue, which updates the UI state, and right away the client begins communicating with the server to make the local…
Any suggestions on front end frameworks?
Re: Offline First – A Better HTML5 User Experience
#33Earlier quoted context omitted.
If you need to build cross-platform apps - and that is mostly the case nowadays - the web is actually not such a bad solution. I mean, what is the alternative?
There is plenty of software that works across Windows/Mac/Linux/Unix-like platforms. They run faster, don't always need an internet connection, are easily portable, and are typically better designed and less bloated than any web-limited cross-platform application. They also don't rely on browser cache or localStorage for settings and I don't need to login daily to access my stuff. Disable your web cache and try to us…
That's like saying "disable a native applications persistent storage and use it daily." It is a meaningless comment.
Re: Offline First – A Better HTML5 User Experience
#34tldr: Someone wrote a bunch of paragraphs and LOC around JSON.parse(window.localStorage.getItem(key)). If you're really interested in learning about creating a workable offline web app, Google has some great documentation. https://developers.google.com/web/fundamentals/instant-and-o... Last, the Safari team needs to seriously get to work on Service Workers. We will see web apps grow by leaps and bounds once the servi…
Sounds exactly like what Apple doesn't want; no 30% revenue cut, no walled garden of control, ...
Re: Offline First – A Better HTML5 User Experience
#35Earlier quoted context omitted.
There is plenty of software that works across Windows/Mac/Linux/Unix-like platforms. They run faster, don't always need an internet connection, are easily portable, and are typically better designed and less bloated than any web-limited cross-platform application. They also don't rely on browser cache or localStorage for settings and I don't need to login daily to access my stuff. Disable your web cache and try to us…
Aren't there lots of caveats for each platform when using so called "cross-platform" code?
Oh and as Nadya said, sometimes this generalization causes issues. Engineering is a game of trade-offs I think :P.
Re: Offline First – A Better HTML5 User Experience
#36The most useful pattern I know of for offline web apps is the command queue. Basically, the rendered state of the client is the acknowledged server state plus the client-side command queue. User actions don't make a server request and then update the UI. Instead they directly append to the local command queue, which updates the UI state, and right away the client begins communicating with the server to make the local…
Yes, This. I struggled with understanding how I'd deal with a complex offline multi user collaborative web app until I starting looking at in terms of a Kafka queue. Gives you everything, including undo/history. Any suggestions on front end frameworks?
I don't know of any open source libraries for the command queue itself. If your state changing commands go through some kind of layer that you control then this stuff is easier. When I implemented it, I first refactored all the commands to go through the same code path, which I could then modify to implement the queue.
Re: Offline First – A Better HTML5 User Experience
#37I sense a trend of trying to cram everything good about native apps onto the web. Do people who do this stop to think whether the web is actually the correct platform for their app?
It seems like a no-brainer to me, building a cross-platform application use web technologies makes the most sense from a business pov.
Re: Offline First – A Better HTML5 User Experience
#38Earlier quoted context omitted.
I suspect that using Promise.all() helps greatly with this.
The way I've done it is to just have an array of commands and a simple queue thing that keeps retrying its head element until success, triggered by connectivity change or manual user retry. (This was also useful when our backend had random issues causing 500s sometimes.) A command has both an AJAX request and a state updating function. It's really easy with a React-like framework because you can just apply the comman…
Re: Offline First – A Better HTML5 User Experience
#39Earlier quoted context omitted.
If you need to build cross-platform apps - and that is mostly the case nowadays - the web is actually not such a bad solution. I mean, what is the alternative?
Gtk Qt The list is actually quite extensive: https://en.wikipedia.org/wiki/List_of_platform-independent_G... -- For mobile, clean separations also helps. It is definitely possible - and less complex than you'd expect - to have core functionality in a shared library, wired up to platform-specific native GUI toolkits. But your question illustrates the problem. The pervasive presence of toolkits that add layer upon laye…
The web comes with its warts, but I've yet to see an app platform as ergonomic and comfortable for the developer as the web. For 99% of my use cases, anything else is overkill and too much of a hassle. It's not the web's fault that it's a better app platform than actual app platforms.
Re: Offline First – A Better HTML5 User Experience
#40I sense a trend of trying to cram everything good about native apps onto the web. Do people who do this stop to think whether the web is actually the correct platform for their app?
Compared to making a cross platform native application that works on Linux, Mac, Windows, Android, and iOS, making a web app—even with offline support—is delightful and efficient.