BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News NativeScript 8 Released with Apple M1, Webpack 5, and Dynamic View Support

NativeScript 8 Released with Apple M1, Webpack 5, and Dynamic View Support

This item in japanese

The recently released NativeScript 8 features official Apple M1 support, and webpack 5 builds. NativeScript 8 supports a new layout container for creative view development and two new styling properties: box-shadow and text-shadow.

NativeScript 8 now supports webpack 5. The release note mentions a two-fold increase in speed vs. webpack 4:

# cold run after ns clean (includes npm install, pod install etc.)
prepare ios  21.78s user 6.78s system 98% cpu 28.985 total

prepare ios  6.58s user 0.63s system 134% cpu 5.361 total

vs.

# cold run after ns clean (includes npm install, pod install etc.)
prepare ios  42.08s user 10.86s system 125% cpu 42.063 total

prepare ios  13.01s user 1.00s system 126% cpu 11.052 total

The new RootLayout container extends GridLayout and offers new layering possibilities. The release note explains:

[The] brand new layout container extends GridLayout [and] offers new APIs for powerful and fun dynamic view creation and layering.

<RootLayout> is a layout container designed to be used as the primary root layout container for your app with a built-in API to easily control dynamic view layers. It extends a GridLayout so has all the features of a grid but enhanced with additional APIs.

The new layout includes for instance APIs to dynamically open, close, and recall views, with configurable animations:

export class RootLayout extends GridLayout {
  open(view: View, options?: RootLayoutOptions): Promise<void>;
  close(view: View, exitTo?: TransitionAnimation): Promise<void>;
  bringToFront(view: View, animated?: boolean): Promise<void>;
  closeAll(): Promise<void>;
  getShadeCover(): View;
}

Developers can now use box shadows and text shadows, which increase the designs that can be created with NativeScript. Box shadows support has been requested for the first time in 2015, signaling the strong community interest in the styling feature.

The full release note can be found online together with code examples. The NativeScript community provides a sample application that showcases the key features of the new release. Developers can migrate to NativeScript 8 as follows:

npm i -g nativescript

ns migrate

NativeScript recently joined the OpenJS foundation as an incubating project and adopted a new governance model that emphasized the role of the community. The OpenJS foundation consists of 32 open-source JavaScript projects, including jQuery, Node.js, webpack, and Electron.

Rate this Article

Adoption
Style

BT