Disparate Matters

Reflections On A Week In The SPA

It was intended as a mere day-long jaunt into investigating the feasibility of a progressive web application ("PWA") as an alternative to mobile apps, following my experience(s) with developing my Flutter app (as detailed in my previous few posts).  What prompted me to set out on this excursion was two main points.

First, though I totally understand the reasoning behind Apple and Google's app store gatekeeping, it doesn't mean I'm a fan of it.

I think if you clearly spell out your intentions as a producer of apps (e.g., what your apps do, how you make money, what data you collect, how you store it and for how long, etc.), and then demonstrate a level of honesty and integrity that your customers can grow to trust, they should be free to decide whether to install your offerings, on to their phones and other mobile devices, without hardware or operating system vendors horning in.

And second, as I documented, the literal steps for getting an app into the app stores are time-consuming, not particularly well-documented, and likely to continue evolving.  It seems preferable to, instead, concentrate my efforts on providing my customers "near-native" experiences for their mobile devices, built with tools and delivered in an environment over which I have total control.

So imagine my surprise when, after first methodically working through MDN's comprehensive PWA documentation, including their tutorials, getting a clear understanding of the pieces required to make a web app installable, I quickly found myself immersed back in the land of single page apps ("SPA"), a place I hadn't visited in a couple of years.

No Vue to be seen here, either, just plain ol' vanilla JavaScript in all its glory.  This was not going to be a day hike after all. :)  I did, however, indulge in relying upon Dexie.js instead of writing all the verbose code required to interact with IndexedDB myself.  And I have to acknowledge the satisfaction in muddling through and reminding myself just how much can be done strictly in a browser (granted, as of late December 2023, there remain inconsistent levels of support by browser implementation) when your intention is to build an "offline-first" application (intended to function at least somewhat, when disconnected from the internet, but sync up whenever possible).

Ideally, I'd actually prefer to build an "offline-ONLY(!)" app (where you download it and use it disconnected indefinitely with NO intention to ever sync up with anything again, except perhaps to install security fixes or some such).

This experience did make me appreciate how much the modern frameworks provide (recalling my time with Vue) and makes me curious to (finally) take a look at React (and React Native, for that matter).

As for going all in on JavaScript, front-to-back, I remain skeptical (though willing to be convinced that I'm wrong), based on my limited firsthand experience with Node.js.  I question it as a sane choice for a backend, primarily because of the fragility of the Jenga-like tower of dependencies of [NPM] packages relying on additional packages, and on-and-on, all-the-way-down.  I also I think it is ridiculous to choose JavaScript as a server-side solution when there are so many other languages better suited for it.  The argument some make that, if you use JavaScript on both the client side and server side, developers won't need to learn-and-use another language is, at best, laughable, and, at worst, insulting, in its implication.  Rest assured, if you can write passable JavaScript you ARE capable of learning to write PHP, Python, Ruby, Java, Go, etc.

NOTE: Shortly after drafting this, DHH's post, making the case that "native mobile apps are optional in 2024", came through my feed reader and, while I won't break it down here (absolutely do go read it yourself, though!), it made me feel better that my frustrations with the state of the art may well become moot, as it appears the improvements afoot will move PWAs closer yet to parity with mobile apps.  Maybe I should just put my head back down to focus on web apps for a few months before reassessing just how powerful PWAs have become in the interim?!

All Posts