TypeScript 2.2 plays nice with React Native JavaScript

TypeScript 2.2 plays nice with React Native JavaScript

Microsoft's TypeScript language is approaching its 2.2 release with an emphasis on support for React Native, Facebook's JavaScript framework for building native mobile apps.

The upgrade has moved to a release candidate status, which is commonly the last stage before general availability, and a road map for the language has version 2.2 arriving this month.

For React Native, which enables building of native apps via Facebook's React framework and JavaScript, TypeScript 2.2 offers a JSX emit mode, called react-native, to accommodate React Native's loader by generating .js files. The loader expects all input to be .js files. "It also satisfies cases where you want to just leave your JSX syntax alone but get .js files out from TypeScript," Daniel Rosenwasser, Microsoft program manager for TypeScript, said. JSX provides TypeScript with an embeddable XML-like syntax.

Version 2.2 also introduces an object type that lets a developer perform an object primitive type parameter, which should help catch a large class of bugs while more accurately modeling real-world code. To improve support for the mixin pattern, restrictions have been removed on classes. Developers can write a function that takes a constructor, declares a class that extends the constructor, adds members to the new class, and returns the class itself. Mixins enable building up classes from reusable components by combining simpler, partial classes.

Due in May, TypeScript 2.3 is set to feature generator support for ECMAScript 3 and 5, asynchronous iterators, and better support for literal types in JSX attributes. Other features planned for the language include variadic types, which support higher-order functions taking a variable number of parameters; project references; type-checking of computed properties for constraints and symbols; and bundling of module type definitions. Nominal typing support, enabling more-refined types, is being investigated as a possible addition to the language as well.

IDG Insider

PREVIOUS ARTICLE

«Beyerdynamic Amiron home headphone review: no high-tech gewgaws, just sweet sound

NEXT ARTICLE

If you own a PC with a DVD drive, you may get a $10 settlement»
author_image
IDG Connect

IDG Connect tackles the tech stories that matter to you

Add Your Comment

Most Recent Comments

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.

images

Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.

images

Poll

Should companies have Bitcoins on hand in preparation for a Ransomware attack?