News

CodePush Now Part of Visual Studio Mobile Center

Microsoft's Visual Studio Mobile Center -- a back-end "mission control for mobile apps" -- now supports CodePush updates of JavaScript-based apps.

CodePush, still in preview, was announced about two years ago, providing a way to update certain apps directly without going through an app store redeployment.

Those apps include JavaScript-based Apache Cordova and React Native apps, because store-deployed apps with interpreted code -- as opposed to compiled code -- are typically able to bypass the sometimes-problematic and time-consuming review process with direct updates. Such Updates need to be minor in nature, described by Microsoft as "bug fixes and improvements/features that maintain the app's original/presented purpose."

CodePush is open source and free to use during its preview, with a free tier expected to be available even after the service goes to production-ready general availability.

In a blog post yesterday, Microsoft detailed how CodePush updates as of June 2 are supported in Visual Studio Mobile Center, a cloud-based, back-end hub that provides services such as building, testing, distribution, crash analytics, user authentication, table storage and so on.

Program manager Ian Geoghegan noted that since its debut in 2015, "mobile app developers have deployed thousands of releases to in-production apps -- deploying quick bug fixes, feature improvements and content updates via the cloud. In a world where updates submitted through the app store can sometimes take days, these developers have enjoyed a huge market advantage because they can respond to customer feedback more quickly with instant app updates to some or all of their end-users."

He further explained the inner workings of the CodePush service and how to use it with Mobile Center for updating a React Native "hello world" app.

The CodePush Update Lifecycle
[Click on image for larger view.] The CodePush Update Lifecycle (source: Microsoft).

"Mobile apps written with Cordova and React Native execute at least some of their code as interpreted JavaScript," Geoghegan said. "In the case of Cordova, JavaScript runs in a webview that displays HTML and CSS controls. For React Native, JavaScript runs in a background thread (i.e. JavaScript Core) that ultimately produces native UI and animations via the React Native framework.

"Developers bundle this JavaScript and include it with their application prior to distribution. CodePush-enabled applications dynamically update their JavaScript code either automatically or on-demand, thus empowering developers to provide incremental updates at-will."

CodePush update lifecycles typically work like this, Geoghegan said:

  • You publish your app to the store with both native and JavaScript code bundled together. We'll call this version 1.0.0 (0) where the parenthetical represents the CodePush release number.
  • Your customer installs your app from the store.
  • After changing your JavaScript, you release update v1.0.0 (1) to the CodePush service hosted in Azure. Notice the CodePush release number has incremented to "(1)."
  • On any app event (for example, onresume), the app queries the CodePush service to compare the JavaScript bundle installed on the device to the most recent one available in the cloud.
  • If the cloud version is both higher and matches the native code version, then it downloads and installs the newer update.

Future plans for the CodePush service, the senior program manager for the Mobile Developer Division said, include better integration with the Mobile Center crash service (now providing only JavaScript stack traces for iOS) and bundle signing. Also, the Mobile Center team will seek to provide more platform support for CodePush and other services. Those plans can be seen in the Mobile Center roadmap.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube