What is the difference between Capacitor and Cordova?

Technology CommunityCategory: IonicWhat is the difference between Capacitor and Cordova?
VietMX Staff asked 3 years ago

At the end of the day, Capacitor has the same type of goals as Cordova. Capacitor is a cross-platform app runtime that makes it easy to build web apps that run natively on iOS, Android, Electron, and the web. It was created -and is maintained- by the Ionic Framework team. We can say that Capacitor is a spiritual successor to Apache Cordova and Adobe PhoneGap. For the majority of plugins today, Capacitor has full backward compatibility.

  • Capacitor treats the native projects that are generated such as iOS, Android, Electron, as code that you actually check in and maintain. it makes it easier to add custom native code to them. You just need to open the project into its native IDEs and make the changes you need without having to do this through a plugin.
  • Capacitor is pushing us towards using the platform’s specific IDE; Xcode for iOS and Android Studio for Android. This means no longer we’re going to have an abstracted layer, which today for Cordova is config.xml. So, the benefit here is that by not having that abstraction over the native layers, it gives us far more control and visibility into the native project changes and overall leads to a better experience maintaining apps over time.
  • The Ionic Team behind Capacitor ensures that by embracing the native platform IDEs it will just lead to a better experience for everyone.
  • The main change for plugin development and maintainability is building them with more modern capabilities, as frameworks on iOS and Libraries on Android.
  • Capacitor registers and exports all JavaScript for each plugin based on the methods it detects at runtime. This means that all of your code is available right away at runtime when your app starts out.
  • Cordova typically gets installed globally on your machine while the Capacitor CLI gets installed locally into each project.