Astro 1.0 Migration
Table of contents
- Who is this guide for?
- Pre-requisites
- Highlight of changes in Astro version 1
- Typical upgrade process
Who is this guide for? #
This guide is intended for developers working on an adaptive project that are looking to upgrade Astro version 0.18 to version 1.0.
Pre-requisites #
The two main requisites for this upgrade are:
- Willingness to remove support for iOS 8 from your project.
- Node v8 and npm v5.
Highlight of changes in Astro version 1 #
- Deprecated methods from JS have been removed
- All deprecated methods were in NavigationPlugin.js
NavigationPlugin.prototype.proxyCallToTopPlugin
NavigationPlugin.prototype.navigate
- Use
navigateToUrl
- Use
NavigationPlugin.prototype.reload
NavigationPlugin.prototype.showPage
NavigationPlugin.prototype.manuallyShowPageForHosts
NavigationPlugin.prototype.setBackgroundColor
NavigationPlugin.prototype.showScrollBars
NavigationPlugin.prototype.hideScrollBars
NavigationPlugin.prototype.enableScrollBounce
NavigationPlugin.prototype.disableScrollBounce
NavigationPlugin.prototype.enableScrolling
NavigationPlugin.prototype.disableScrolling
NavigationPlugin.prototype.setPageTimeoutDuration
NavigationPlugin.prototype.getCookie
- All deprecated methods were in NavigationPlugin.js
- Java API surface has been shrunk
- Methods/classes/variables that were never meant to be public were made private or package-private
- AstroWorker java has moved from package
com.mobify.astro.plugins
to packagecom.mobify.astro
(one up) - Removed iOS 8 support
- Webviews in the app now exclusively run on WKWebView, except for the worker
- Upgrade to Webpack 2.2
- Released version of webpack
- Upgraded to Node v6 and npm v3 From node v4 and npm v2.
- May require changes in build scripts because of npm 2 -> 3 and folder structure in node_modules
Typical upgrade process #
The typical upgrade process is as follows:
- From the root of your project, run
git clean -Xfd
. This removes all ignored files from your working directory. - Update the
progressive-app-sdk
dependency in your package.json to1.0.0-rc2
. - Run
npm run deps
from thenative
folder. - If you have an Android application:
- Build the app, the compiler will tell you if there are any issues.
- If you have an iOS application:
- Check that your code doesn't include any codepaths specifically for iOS8 and earlier. If it does, remove these as iOS 8 is no longer supported.
- Inspect the code relating to the use of the
NavigationPlugin
. A lot of methods have been removed from theNavigationPlugin
and there is no compiler to warn you about using them. You can see the list of removed methods above. - Finally, run the app and verify all behaviour is as expected.