React Native. Why would you want a desktop app when it's already working in a browser? If you really want a desktop app, I would recommend using React for the web, React with Electron for desktop, and React with CapacitorJS for mobile.
I want the mobile and desktop versions to be able to operate in offline mode with a local database.
Ask HN: How to create web, mobile, and desktop apps from a common code base?
21–30 of 30 posts
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#22You could look into Flutter. It pretty much fits what you are looking for. I have tried it myself, but did not love it fwiw
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#23You could look into Flutter. It pretty much fits what you are looking for. I have tried it myself, but did not love it fwiw
That said, there is nothing that tackles iOS, Android and Web very well.
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#24Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#25Earlier quoted context omitted.
Have you seen PWAs? https://www.google.com/search?q=pwa Websites already have access to offline storage via the localStorage API. When the user installs a PWA, it gets additional permissions which make it even more similar to a native app.
As a web dev, I'd recommend against this. They have pretty shitty UX and always feel like second class citizens... If you want your users to be happy, make a proper app
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#26Earlier quoted context omitted.
As a web dev, I'd recommend against this. They have pretty shitty UX and always feel like second class citizens... If you want your users to be happy, make a proper app
PWA tech has every building block needed to create a proper app besides the operator capable of creating the app
How long have we been talking about them now as a replacement for native apps? I've still never seen one that's acceptable, much less equally good.
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#27Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#28Earlier quoted context omitted.
One of the versions will be a website, but I want mobile and desktop versions to be able to operate in offline mode with a local database.
Have you seen PWAs? https://www.google.com/search?q=pwa Websites already have access to offline storage via the localStorage API. When the user installs a PWA, it gets additional permissions which make it even more similar to a native app.
If you're going to build an app that can be accessed in a browser from a url, there are only benefits to making it a PWA. Offline, local capabilities, wider native device access, first-class icon placement with mobile apps, and the simplest distribution network ever invented. Absolute win to make your app a PWA.
That said, it may lack some polish? I never had any issue with what they offered because I HATE apps. I will NEVER install an app on my device if I can help it. No facebook, no twitter, no amazon. If I should be able to do everything the app needs with a browser, then I will NOT download that app. Twitter and amazon at least understand that enough to have functional websites on all platforms. Things like facebook, on the other hand, are 'never installs' for me. So if there's something that capital-A Apps provide that you need, then you should probably go ahead and make one (hopefully using the same UI code you use for your PWA/web-app, but that's not always possible). Things like Twitch and YouTube get apps because they deal with a very specific type of data and can be (and are) optimized to handle that specific data type. Browsers just don't serve that kind of special-purpose design (nor should then), so there's valid reasons for those to be apps.
On the other hand, if you can avoid making a single-purpose app, you should probably try it? Besides the wonks like me refusing app downloads, you also have the headache of maintenance for multiple platforms and all of that pretty much necessitates code mutations and generations for each specific platform that then each all need to be maintained (or worse, in-house developed and maintained). For all of the people out there pitching "holy grail" versions of the write-once, publish-everywhere mantra, I haven't found any that don't include some pretty fine text to the tune of "we use these specific processes and you've just gotta roll with that, even though they will probably cause you compatibility issues in your codebase at least once"
As far as storage, though, localStorage is pretty sparse, it's true. But you can also use IndexedDB storage (pretty good!), and now there's a new file system api that mimics a disk file system in the browser, which is apparently way better but I don't have any first hand experience with that (and it's not useful to me until it can act like a database, but SQLite does seem to be working dilligently to make that happen ASAP). So there are options there, and while people may waffle about the reliability of some of them, I personally haven't run into any issues using IndexedDB (other than it's atrocious development experience).
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#29Earlier quoted context omitted.
PWA tech has every building block needed to create a proper app besides the operator capable of creating the app
They load slow, have poor menu bars, don't use native UI widgets, have unclear update/versioning systems, can't be on all app stores, have inferior notifications, etc. How long have we been talking about them now as a replacement for native apps? I've still never seen one that's acceptable, much less equally good.
Re: Ask HN: How to create web, mobile, and desktop apps from a common code base?
#30Flutter also does support Web but has a few issues. But still I wou choose it.