Is Ionic3 PWA the best choice?

You are correct. You would write your Ionic app as a web app, but use Electron to install and run it on the desktop. For now, to avoid overwhelming yourself, you might not use Capacitor yet. Use what Electron gives you in terms of desktop integration.

You can use TypeScript with Electron, and it only requires an extra step. I kinda wish I’d done that with my course. However, you will see how I dealt with the differences in the course, so maybe it’s better that I used ES6 with the Electron side.

You may be forced to write a few of your functions twice: once for mobile and once for desktop. It isn’t the end of the world if you do. I tried to keep everything in the Ionic app as much as possible, only delegating to the Electron code what I had to. You’ll probably be happiest if you do likewise.

If it helps, here is how I think of those technologies in question.

  • Ionic: Build amazing web apps using mostly HTML and TypeScript.
  • Electron: Host your web app on Windows, Linux, MacOS as a “desktop” app. Provides compatibility layer to access underlying OS features, such as sound, file system, menus, etc. Can build installers and auto-updates.
  • Cordova: Mature technology to host your web app on a mobile device. Provides compatibility layer to access underlying hardware features, such as sound, file system, storage, camera, GPS, etc. Can put these apps into the mobile app stores.
  • Capacitor: Modern framework that makes using Ionic with or without Cordova or Electron easier, providing a higher level abstraction.

Hope that helps.

2 Likes