Skip to content

Migration

There are changes to Mobile Development Kit as well as migration requirements to consider when you move from one version of Mobile Development Kit to the next.

Note

If you are upgrading minor or major version, make sure you follow the upgrade notes for each version higher than your current version. e.g. If you are upgrading from 3.2 to 4.2. Please follow the upgrade notes for 4.0, 4.1 and 4.2 (if any)

Upgrading to 5.0 or Newer

Deprecating OData Initialization Actions

  • Offline OData Initialize (Action.Type.OfflineOData.Initialize)
  • OData Service Create (Action.Type.ODataService.Create)
  • OData Service Open (Action.Type.ODataService.Open)

These are now unified into a single action: OData Service Initialize (Action.Type.ODataService.Initialize).

This new action can be used to initialize both offline or online OData service.

Deprecating font-color Styling Property

  • font-color is now deprecated and is replaced with color

Upgrading to 4.3 or Newer

ClientAPI.sendMobileServiceRequest function is deprecated and should not be used anymore.

It has been replaced by ClientAPI.sendRequest which has the same functionality.

Upgrading to 4.2 or Newer

Migrating Mobile Development Kit Modules Import

If you have imported Mobile Development Kit client's classes via relative path such as:

import { IControl } from './controls/IControl';

// or
import { IControl } from '../../controls/IControl';

// or
import { IView } from './controls/IView';

// and so on

These should be migrated to use mdk-core module:

import { IControl } from 'mdk-core/controls/IControl';
import { IView } from 'mdk-core/controls/IView';

Upgrading to 4.0 or Newer

Upgrading NativeScript Full Path Import

With NativeScript 6.0 or newer, you must use fully qualified module path for tns-core-modules imports.

For example:

Before version 4.0, you can write import with short path:

import * as fs from 'file-system';

In version 4.0 or newer, you must write import with fully qualified path:

import * as fs from 'tns-core-modules/file-system';

Using Built-in NativeScript Framework Modules

If you are importing the following NativeScript modules in your rules:

  • tns-core-modules/application-settings
  • tns-core-modules/connectivity
  • tns-core-modules/file-system
  • tns-core-modules/platform
  • tns-core-modules/ui/dialogs
  • tns-core-modules/utils/utils

These 6 modules are now part of the ClientAPI and you can access them via ClientAPI.nativescript.

You should now migrate and use them via ClientAPI.nativescript.<modulename>

e.g. ClientAPI.nativescript.appSettingsModule

For more details please see NativeScript Framework Modules


Last update: October 20, 2020