Nativescript: Nativescript, React Native, or Native App. Which's the best for code maintenance?

Created on 3 Jan 2021  ·  2Comments  ·  Source: NativeScript/NativeScript

We are a small company that need your expert advices concerning the choice of technology for our next Mobile App.

For our first mobile app, 4 years ago, we choiced to use Nativescript Framework (on Angular), because our Web App was coded in Angular 2, and we was really attracked by the perfomances introduced by NS, his native approch and the time saving to developp Android and iOS app.

After 4 years using Nativescript, even if this techno is really great, we faced several problems during ours scalable/corrective maintenances, most of time after each NS major version release, or important releases :

  • It was almost 100% sure that our app will breaked at compilation or running time, after a new NS major release
  • Even by keeping our actual NS version and didn't update anything, the code breaked at some point (from NS Core or NS plugin), and forced us to update our NS Core
  • Most of the Nativescript plugins don't stay compatible with next release of NS version, so you are also forced to update all NS plugins
  • Sometimes, only one NS plugin breaks the code, so to fix you need to update it, and once is updated, the NS Core breaks, and you are in a infinite loop...

So from one side, you earn a lot of time to create your native Android and iOS app, but from the other side, you lost a considering time to adapt and fix the code after each NS update.

The worst of the worst is iOS, because undepending of Nativescript, you have to update Mac OS first, then Xcode, then iOS on devices to be able to run your app (if you have the chance that NS Core don't break the app, otherwise you are ready to become crazy during a week...)

Now that we are aware about this, we don't want to do the sames mistakes for our next Mobile App, and we would really appreciate some answers about this :

  • Is there a way to avoid all of this "undesired" behaviour on a Nativescript App ?
  • Do React Native Framework have the similar problems of scalable/corrective maintenance than Nativescript ? Concerning the Core and Plugins ?
  • Is the Native App developpment is the solution to avoid us the maintenance problem ?

Most helpful comment

@GrEg00z

  • It was almost 100% sure that our app will breaked at compilation or running time, after a new NS major release

This is standard with many frameworks – major releases often introduce breaking changes. I can say that the major changes between NativeScript 6 and 7 have absolutely been worth the necessary refactoring. For example, the changes introduced far easier management of imports, as well as the ability to transpile to ES6 (making bundle sizes smaller and increasing app performance).

When compared to React Native (which does not follow semver), React Native changes are typically smaller between versions, but for example, the changes 1-2 years ago to support autolinking of native modules caused a similar amount of grief.

  • Even by keeping our actual NS version and didn't update anything, the code breaked at some point (from NS Core or NS plugin), and forced us to update our NS Core

I've experienced this even with fully native apps – Apple are not very kind with iOS updates, making no guarantees whatsoever that existing apps will continue to work; and I've lost countless weekends since iOS 10 unbreaking my app after finding that the navigation/status bar no longer works as expected, or the app is crashing on launch.

As NativeScript is a cross-platform framework, it is more likely than a native app to unexpectedly break with OS updates, as there are more things to fail. It will also take longer for the core team to undo the damage with each OS update. This is true for React Native as well, but I would agree that any damage tends to be discovered and fixed sooner for React Native due to Facebook, Microsoft, Amazon, and many more companies committing significant engineering effort to it.

  • Most of the Nativescript plugins don't stay compatible with next release of NS version, so you are also forced to update all NS plugins

This is indeed a pain-point. Both the NativeScript 5 -> 6 and 6 -> 7 updates hit hard here. But with the latter update, the core team did reach out to plugins developers and offer to port their plugins to NativeScript 7. Now, an increasing number of plugins are maintained directly by the core team; and the new @nativescript-community organisation, with its stewardship over many plugins, gives more maintainers access to update plugins in future.

  • Sometimes, only one NS plugin breaks the code, so to fix you need to update it, and once is updated, the NS Core breaks, and you are in a infinite loop...

I agree that plugins maintenance has long been a problem with NativeScript and more needs to be done to reduce the maintenance burden.

The worst of the worst is iOS, because undepending of Nativescript, you have to update Mac OS first, then Xcode, then iOS on devices to be able to run your app (if you have the chance that NS Core don't break the app, otherwise you are ready to become crazy during a week...)

I can assure you that the majority of Xcode/iOS updates that break things in NativeScript also break things in React Native. There are ongoing headaches with splash screens, XCFrameworks, accessibility, and more, that all affect both frameworks equally.

  • Is there a way to avoid all of this "undesired" behaviour on a Nativescript App ?

Just as with any other app development approach, all I can recommend is writing tests for your apps, trying out iOS beta releases early, and keeping an eye on the latest GitHub Issues posted to the NativeScript repo. Keeping an eye on the questions posted in the Slack channel will also give you early warning of any upcoming potential problems.

Do React Native Framework have the similar problems of scalable/corrective maintenance than Nativescript ? Concerning the Core and Plugins ?

React Native is more mature (and hence more stable), due to greater full-time engineering investment from many companies, and the unwillingness of Facebook to introduce breaking changes into their enormous app; but as explained above, it does still encounter all the same problems as NativeScript does with respect to iOS and Xcode updates. As for the React Native plugins ecosystem, it is greatly tamed by the Expo team, who more or less build a business around React Native plugins, but inevitably there are many plugins that are solely community-maintained and do lose compatibility as React Native updates.

Is the Native App developpment is the solution to avoid us the maintenance problem ?

You will still have to respond to Apple-induced breaking changes with iOS and Xcode updates, even with native app development. But by avoiding a cross-platform framework, there will at least be one less layer of doubt between you and the cause of the issue.

Nonetheless, I would absolutely still use a cross-platform framework, as I value HMR and live reload for rapid development, and would much prefer to develop using declarative UI libraries (e.g. React) than imperative ones (UIKit). I am also far more familiar with web idioms (e.g. flexbox and CSS) and TypeScript than the native alternatives.

Whether to choose NativeScript Angular (or indeed, another flavour of NativeScript) or React Native should be decided based on:

  • your team's skill set
  • whether you also need target Web as a platform (React Native Web is an option for deploying to Web)
  • the extent to which you need to access native APIs (NativeScript is absolutely king when it comes to native access)
  • what sort of plugins you think you'll need for the app (you should compare the quality of the available plugins between the two ecosystems)

All 2 comments

@GrEg00z

  • It was almost 100% sure that our app will breaked at compilation or running time, after a new NS major release

This is standard with many frameworks – major releases often introduce breaking changes. I can say that the major changes between NativeScript 6 and 7 have absolutely been worth the necessary refactoring. For example, the changes introduced far easier management of imports, as well as the ability to transpile to ES6 (making bundle sizes smaller and increasing app performance).

When compared to React Native (which does not follow semver), React Native changes are typically smaller between versions, but for example, the changes 1-2 years ago to support autolinking of native modules caused a similar amount of grief.

  • Even by keeping our actual NS version and didn't update anything, the code breaked at some point (from NS Core or NS plugin), and forced us to update our NS Core

I've experienced this even with fully native apps – Apple are not very kind with iOS updates, making no guarantees whatsoever that existing apps will continue to work; and I've lost countless weekends since iOS 10 unbreaking my app after finding that the navigation/status bar no longer works as expected, or the app is crashing on launch.

As NativeScript is a cross-platform framework, it is more likely than a native app to unexpectedly break with OS updates, as there are more things to fail. It will also take longer for the core team to undo the damage with each OS update. This is true for React Native as well, but I would agree that any damage tends to be discovered and fixed sooner for React Native due to Facebook, Microsoft, Amazon, and many more companies committing significant engineering effort to it.

  • Most of the Nativescript plugins don't stay compatible with next release of NS version, so you are also forced to update all NS plugins

This is indeed a pain-point. Both the NativeScript 5 -> 6 and 6 -> 7 updates hit hard here. But with the latter update, the core team did reach out to plugins developers and offer to port their plugins to NativeScript 7. Now, an increasing number of plugins are maintained directly by the core team; and the new @nativescript-community organisation, with its stewardship over many plugins, gives more maintainers access to update plugins in future.

  • Sometimes, only one NS plugin breaks the code, so to fix you need to update it, and once is updated, the NS Core breaks, and you are in a infinite loop...

I agree that plugins maintenance has long been a problem with NativeScript and more needs to be done to reduce the maintenance burden.

The worst of the worst is iOS, because undepending of Nativescript, you have to update Mac OS first, then Xcode, then iOS on devices to be able to run your app (if you have the chance that NS Core don't break the app, otherwise you are ready to become crazy during a week...)

I can assure you that the majority of Xcode/iOS updates that break things in NativeScript also break things in React Native. There are ongoing headaches with splash screens, XCFrameworks, accessibility, and more, that all affect both frameworks equally.

  • Is there a way to avoid all of this "undesired" behaviour on a Nativescript App ?

Just as with any other app development approach, all I can recommend is writing tests for your apps, trying out iOS beta releases early, and keeping an eye on the latest GitHub Issues posted to the NativeScript repo. Keeping an eye on the questions posted in the Slack channel will also give you early warning of any upcoming potential problems.

Do React Native Framework have the similar problems of scalable/corrective maintenance than Nativescript ? Concerning the Core and Plugins ?

React Native is more mature (and hence more stable), due to greater full-time engineering investment from many companies, and the unwillingness of Facebook to introduce breaking changes into their enormous app; but as explained above, it does still encounter all the same problems as NativeScript does with respect to iOS and Xcode updates. As for the React Native plugins ecosystem, it is greatly tamed by the Expo team, who more or less build a business around React Native plugins, but inevitably there are many plugins that are solely community-maintained and do lose compatibility as React Native updates.

Is the Native App developpment is the solution to avoid us the maintenance problem ?

You will still have to respond to Apple-induced breaking changes with iOS and Xcode updates, even with native app development. But by avoiding a cross-platform framework, there will at least be one less layer of doubt between you and the cause of the issue.

Nonetheless, I would absolutely still use a cross-platform framework, as I value HMR and live reload for rapid development, and would much prefer to develop using declarative UI libraries (e.g. React) than imperative ones (UIKit). I am also far more familiar with web idioms (e.g. flexbox and CSS) and TypeScript than the native alternatives.

Whether to choose NativeScript Angular (or indeed, another flavour of NativeScript) or React Native should be decided based on:

  • your team's skill set
  • whether you also need target Web as a platform (React Native Web is an option for deploying to Web)
  • the extent to which you need to access native APIs (NativeScript is absolutely king when it comes to native access)
  • what sort of plugins you think you'll need for the app (you should compare the quality of the available plugins between the two ecosystems)

Thanks a lot @shirakaba for your details answers and explainations, really appreciate and I learned a lot 👍

From what I understood, the both hybrid and native app will face the same problems after an iOS/Android sdk update with breaking changes, depending on the api they are using. It takes a lot of sense!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

guillaume-roy picture guillaume-roy  ·  3Comments

hshristov picture hshristov  ·  3Comments

OscarLopezArnaiz picture OscarLopezArnaiz  ·  3Comments

rLoka picture rLoka  ·  3Comments

minjunlan picture minjunlan  ·  3Comments