BT

Ionic Announces Capacitor 1.0.0 Alpha for Creating Web, Hybrid, and Native Apps

| by Dylan Schiemann Follow 5 Followers on Mar 15, 2018. Estimated reading time: 2 minutes |

The Ionic team has announced the first alpha release of Capacitor, a new approach for building web, hybrid, and native apps on mobile and desktop platforms with JavaScript.

Capacitor seeks a position between traditional hybrid platforms like Cordova and native compilation platforms like React Native and NativeScript, while also offering full support for Progressive Web Apps (PWA). For installed mobile applications, the Capacitor project promises developer flexibility for determining which portions of an application get delivered as native code vs. features offered in a web view or as a PWA.

The project draws significant inspiration from Cordova, but has several distinctions from this framework:

  • A JavaScript runtime to include within Capacitor apps, providing a cross-platform API translation layer for native and Web API calls
  • Swift-based code on iOS platforms
  • Progressive Web Apps for web apps
  • Electron for hybrid desktop apps in a future release

The Ionic team explains in their alpha announcement that Ionic users had:

[...] problems beyond just the core Ionic Framework UI components they are using. These teams expect that we can help them with other mobile challenges, and highest on their list is almost universally better native support and plugins.

These requirements motivated the Ionic team to start a new project rather than attempting to make significant changes to Cordova. Capacitor strives to maintain compatibility with Cordova for plugins to facilitate the use of Cordova plugins within Capacitor applications. Ionic CEO Max Lynch explained to the InfoQ team that:

Cordova has had a solid vision since day 1 to shim web APIs for native apps, but sometimes this doesn't go far enough for creating real world app use cases. Today there are some things that are easier to build natively. Also Cordova doesn't really support building Progressive Web Apps."

As a result, Capacitor provides flexibility in targeting common development experiences and patterns for apps created with web technologies and deployed with a mixture of native and web code. For example, Capacitor strives to provide a simple experience for creating applications with camera access that is consistent with both native and web technologies.

To add Capacitor to existing modern JavaScript web apps, run the following commands:

cd my-app
npm install --save @capacitor/core @capacitor/cli

Once installed, Capacitor is initialized with application information:

npx cap init [appName] [appId]

Within the previous command, appName is the name of the application, and appId is the domain-style app identifier for an app (e,g, com.example.app). Additional information is available at the Capacitor getting started guide.

Developers using Ionic should expect integration with Capacitor to be complete with the Capacitor beta release. The Ionic team anticipates a stable release of Capacitor by mid-2018. Capacitor is open source software under the MIT license, and contributions are welcome via the Capacitor GitHub project.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT