Using JSDOs to create mobile and web clients : What is new in JSDO 5.0?
  

What is new in JSDO 5.0?

This section briefly describes what is new in JSDO 5.0.

ES6 Promises

Promises, like callback functions, provide a mechanism to handle asynchronous operations. Prior to JSDO 5.0, JQuery Promises were used to handle asynchronous operations. Since JavaScript natively supports Promises with ES6, ES6 Promise is now the preferred method of handling asynchronous operations in JSDO 5.0.
ES6 Promises are also required where JSDO provides a seamless integration between a NativeScript app and a Progress Data Object resource. This is due to the fact that NativeScript has built-in support for ES6 Promises, whereas JQuery Promises cannot be used with either NativeScript or Angular.
In JSDO 5.0, the following changes have been made to the JSDO library:
*Using Promises is no longer optional.
*Asynchronous JSDO APIs use ES6 Promises by default.
*Exceptions in asynchronous APIs call the error handler.
Note: JSDO 5.0 can still use JQuery Promises, if required.

JSDO 5.0 as an npm package

JSDO 5.0 is available as an npm package. This is primarily to support mobile app development in NativeScript, which uses npm to install libraries.
JSDO and Data Source for NativeScript and Angular provide a seamless way of integrating a NativeScript app with a Data Object resource. You can perform either of the following actions:
*Install and use these npm packages in an existing NativeScript app to access a Data Object resource.
*Use the starter template—tns-template-master-detail-progress-ng—which, too, is available as an npm package, to create a NativeScript app.
To install the JSDO and Data Source packages in an existing NativeScript project, run the following npm command:
npm install @progress/jsdo-nativescript
To create a NativeScript app using the starter template, run the following NativeScript command:
tns create project_foldername --template tns-template-master-detail-progress-ng

JSDO type definitions

JSDO 5.0 includes TypeScript declaration files for the JSDO and the Progress Data Source. These files provide type checking with the TypeScript compiler. Development tools use these files for intelli-sense and refactoring support.

Progress Data Source for NativeScript and Angular

The Data Source component provides seamless integration between client apps built with the Angular framework (that is, NativeScript and Angular web apps) and a Progress Data Object Service. It is available as an npm package on www.npmjs.com, which you can download and use in your NativeScript or web app.
The Data Source module allows you to access data as well as to perform CRUD operations on a data resource from a supported Progress Data Object Service. It is a TypeScript implementation. Therefore, along with the JavaScript code, a declaration file is also provided in the package. The declaration file defines the module’s types and function signatures.