I'd like to share my experience with mobile app and web app maintenance, highlighting its importance for developers. I believe it's crucial to perform maintenance 2-3 times a year, and I hope my experience will help you on your development journey.
My Challenges with Expokit
I want to start this article with an experience I had developing an app in React Native and Expokit. If you don’t know, Expo is a collection of tools and services that simplifies the process of building your React Native application. It provides a range of pre-built components, libraries, and services that make mobile app development faster and easier.
Some years ago, there was a tool called Expokit. ExpoKit was an option within Expo ecosystem that allows you to transition to a more customizable bare workflow when you need to include custom native code or libraries. It gives you more freedom to implement custom native code. In 2020, Expo announced that it would deprecate Expokit, and users will need to migrate to Expo Bareflow.
In 2022, I was working on a mobile app based on React Native, using Expokit as its foundation alongside various other React Native libraries. One day, Google removed the app from their app store for an upgrade that required some app information. I had to complete the necessary form and upload the app quickly, as it was in use by multiple users daily. To make things worse, while trying to run the app, I encountered numerous errors with Gradle.
Gradle, a vital build automation tool for building, testing, and packaging Android applications, is integral to the Android app development process. It manages project dependencies, configures the build process, and compiles source code into APK (Android Package) files. Android Studio alerted me to an SDK upgrade requirement to run the application, which is when I discovered that Expokit had been deprecated.
For several days, I struggled to run the app without success. I attempted upgrades for React Native, React, Gradle, Android Studio, and various other components. It was only after seeking advice from a friend experienced in the React Native ecosystem that I decided to rebuild the application. I created a new app and imported many of the components from the previous app. I also installed expo-modules-core to utilize the expo dependency modules in the new app. This involved upgrading all the modules, refactoring code, implementing new flows, and more. After a couple of weeks of effort, I finally managed to upload the application again and publish it on Google Play.
I took several components and created custom ones that would extend those components, then abstracting away the implementation details. This abstraction simplifies maintenance and code reuse. This will allow you to change the implementation if there is an upgrade or you need to change it to a different component or if you need to perform any change to the implementation.
Suggestions for Effective Maintenance
Research Module Changes: Begin by researching the modules you're using to identify what has changed from your current version to the latest release.
Avoid Immediate Upgrades: It's wise to refrain from upgrading to the very latest version immediately. Allow some time for the current version of the module, library, or package to be in circulation, as this ensures that different patches and fixes have been released.
Read Documentation: Always take the time to read the documentation for the new version or upgrade. It provides valuable insights into what has changed, deprecated, or will be removed in the next release.
Abstract the Libraries: In the case of React Native, I was using MaterialUI as a component library and other types of libraries to use in the project. It is a good practice to abstract their logic so that the business logic of your project does not get mixed up with it. This separation can lead to cleaner and more maintainable code.
Today, I strongly recommend performing regular maintenance after developing an application. Periodic maintenance ensures your app stays current with the latest framework and library updates. It's also beneficial in case your hosting provider, such as an app store or a cloud service like Heroku, updates its policies.
Top comments (0)