Comparison with Cordova and Capacitor

This page compares Peregrine with Cordova and Capacitor. Other hybrid mobile solutions such as React Native, Flutter, NativeScript, and Turbo Native are out of scope for this page.

There are several differences between Peregrine and similar solutions such as Cordova and Capacitor. This page attempts to highlight these differences in an unbiased way. For more in-depth explanations of these differences and the reasoning behind them, see the Philosophy page.

Technology

Peregrine has many technological differences between Cordova and Capacitor. To learn more about the technical implementation of Peregrine, see the Architecture page.

Library, not Framework

Peregrine is not a mobile development framework, i.e. it does not provide tooling or doctrine as to how your app is or should be structured.

  • Peregrine does not abstract or hook into the native platforms.
  • Peregrine does not have starter templates. Instead, developers install Peregrine libraries into their native and web apps.
  • Peregrine does not have a CLI. Instead, developers use the platform and its native tooling.

Extensions

Both Cordova and Capacitor provide an ecosystem around third-party plugins. Plugin authors have deep access to most of the Cordova and Capacitor APIs, which are used along with platform APIs to implement native functionality.

Peregrine does not have “plugins” in the same sense. Instead, developers explicitly attach functions and observables to each Web Frame that the web layer will be able to access. This is what’s known as the remote interface.

While creating and distributing collections of native functionality is possible, it should be discouraged. Instead, developers should use recipes to build tailored native solutions for their apps.

Cordova Compatibility

Peregrine is not compatible with Cordova plugins. There are architectural differences that make compatibility with Cordova plugins infeasible.

Migrating an app from Cordova or Capacitor to Peregrine is possible, but would require replacing the entire native layer.

Age

  • Cordova had its first release in 2009 (14 years ago!) and remains largely the same in architecture and implementation.
  • Capacitor was started in 2017, but extends Cordova code and has dependencies on Cordova libraries to support its compatibility layer.
  • Peregrine was started in 2022 and built from the ground up, abandoning the Cordova architecture altogether.

Size

Mostly because of reduced scope and not offering a compatibility layer with Cordova, the source code of each Peregrine native library is about a tenth the size of the respective Cordova or Capacitor platform.

Language

The following table is a breakdown of the languages each project is written in.

iOS

Android

Web

Cordova

Objective-C Java JavaScript

Capacitor

Swift and Objective-C Java TypeScript and JavaScript

Peregrine

Swift Kotlin TypeScript

Both Cordova and Capacitor support iOS plugins written in Objective-C and/or Swift and Android plugins written in Java and/or Kotlin. Peregrine only supports Swift for iOS and Kotlin for Android.

Stewardship

  • Cordova is primarily managed and maintained by the Apache Software Foundation, a long-running, volunteer-based open source foundation.
  • Capacitor is primarily managed and maintained by Ionic, a company founded in 2012 (now owned by OutSystems).
  • Peregrine is primarily managed and maintained by @imhoffd, an Ionic alumni (2015–2020).

Support

  • Cordova offers no guarantee of support—free or otherwise.
  • The Ionic sales department offers enterprise support for Capacitor.
  • Peregrine offers no guarantee of free support. Perhaps in the future, paid support will be an option.

Licensing

Peregrine and Capacitor are both MIT-licensed, whereas Cordova is Apache-licensed.

Please see the License page for a full description and legal information.