Why ionic isn't the right choice anymore

WARNING: Highly opinionated views against ionic and angular, opinions are mostly out of personal experience

Introduction

In September 2012, Mark Zuckerberg said in TechCrunch (our-biggest-mistake-with-mobile-was-betting-too-much-on-html5) that "The biggest mistake we made as a company was betting too much on HTML as opposed to native". Ironically, it still is too for most of the organisations even 10 years later.

When it comes to a mobile applications' reaction time or responses or screen rendering time, nothing beats native code, since they are interacting with the native OS tier directly. Whereas in Ionic/Cordova, there is an additional layer of HTML/CSS/JS, running in embedded browser in the native app window, and that interacts with the OS tier through the so called plugins, which are small code native code snippets converts to native code in the application build time. So, obviously there is a latency introduced.

Issues with Ionic/Cordova

Now these plugins are a big problem of the ionic/cordova platform. Cordova, and its steroid infused variant Ionic relies on the plugins to interact with device or OS APIs. That means, almost everything that happens in these devices, like camera, fingerprint/face detection, network access, API requests, data storage, secrets like passwords et al happens through the plugins. These plugins are open sourced, and (irregularly) maintained by independent developers, without support, sponsorships or any acknowledgements from Ionic or Cordova. As a result some of the popular plugins have not seen any updates in 3 years, while few "stable" plugins are actually a fork of the fork of the fork of the original repo in Github.

These plugins bring in such significant ambiguity that its almost impossible to guarantee predictable application behaviours across all consumer devices, esp. Android devices.

Issues with Ionic

There are challenges specifically with ionic platform too. You see, Applications based on Cordova are simple web apps, the simplicity being its USP. There is no web framework imposed on the developer, and the developer can simply write HTML/CSS and some vanilla JS and deliver a successful app.

Ionic, on the other hand, enforces you to learn Angular. Now, Angular had lived its time in the Web World. No matter however we deny, the fact remains that Angular has jumped the shark and is on a steady decline since 2018. Stack overflow trends, Google trends and Github Stars prove that emphatically.

Ionic brings along its own component library too, which is a bunch of webcomponents(or custom elements), created using Stencil. Is webcomponents the right choice for creating component library is a topic for another day, but in the case of ionic mobile apps, they are a disaster. Most irritating issue is, they mask default events like onChange and onBlur in case of form inputs, and expose customised events like ionChange and ionBlur.

Ionic moved from Cordova to Capacitor platform, which broke a lot of apps. Capacitor although claims to deliver native applications, but in reality when in use with Ionic, it continues to be HTML/JS/CSS UIs Running on Embedded Native WebViews. Moreover, Capacitor WebViews discourage a few native browser features like LocalStorage/SessionStorage etc, and ask developers to use its customised storage.

Conclusion

Despite these, the reality is these frameworks, ionic and cordova, are insanely popular. The reason behind that is that a single framework can deliver for both iOS and Android platforms. However, modern mobile app technologies, like React Native from facebook(Meta Platforms), Xamarin from Microsoft, or Flutter from Google address the issues superbly. These frameworks too can deliver for multiple platforms from a single codebase, at the same time, unlike ionic, they don't bank on HTML/CSS, they compile to respective native binaries. Therefore they deliver the right native user experience, as well as superb developer experience.

There is a popular belief, that react-native is still in beta, whereas, in reality, it is actually on version 0.x. It will become version 1.x only and only if they introduce a breaking change in its APIs, following the semantic versioning guidelines. But since its inception there are no decommissioned APIs which only proves how stable it is. It is absolutely production ready for all practical purposes.

Modern Mobile Technology landscape has evolved and offers a lot of choices to deliver the right developer experience and user experience. Ionic suits for a quick POC or a demo application but banking on it as a strategic choice is probably like acquiring Tech Debt for the organization.

Did you find this article valuable?

Support Tirtha Guha by becoming a sponsor. Any amount is appreciated!