Polymer 2.4 Strengthens TypeScript Support
Polymer 2.4 Strengthens TypeScript Support
Written by Kay Ewbank   
Friday, 02 February 2018

There's a new version of Polymer with improved TypeScript support, and a preview version of the next major release of Polymer. Polymer is a JavaScript library that can be used to create custom reusable HTML elements, and use them to build performant, maintainable apps.

The new release is Polymer 2.4., an incremental release has some new features designed to improve the current version, along with others that are getting ready for the forthcoming 3.0 release.

The main headline improvement is to the TypeScript support, with the addition of support for TypeScript types. Until now, type support has been via Closure Compiler types in jsdoc format, but the developers have added the TypeScript type support in acknowledgement of TypeScript's popularity. Using TypeScript in Polymer is as simple as adding references to the types for the library imports that you use from the types folder.

The developers have also introduced a set of decorators that can be used to write Polymer elements with TypeScript in a type-safe, convenient way. More support will be added for TypeScript in future versions of Polymer, including typings for Polymer 3.0, typings for the elements in the Polymer catalog, and support for using TypeScript projects with Polymer tools.

Another improvement in this release of Polymer is the splitting out of a key subset of Polymer’s features into a tiny new mixin. PropertiesMixin implements Polymer’s features for defining declarative properties, creating property accessors, and syncing properties with attributes. Its advantages is that it can be used to create new, lightweight base classes.

 

The other main change to this version is the addition of a Polymer.html tag function. This is in preparation for a change to the forthcoming 3.0 version, which will require you to return an instance of the HTMLTemplate element rather than a string from your element’s static template getter. The change has been made to make the template type predictable, which in turn will make it simpler to extend superclass templates.

The current way of working is still valid, but the html tag function has been added so developers can play around with it and see how it fits with their code.
Alongside the release of Polymer 2.4, the developers have also released another preview version of Polymer 3.0 with more

progress with the conversion of all Polymer elements to Polymer 3.0. 

polymer

 

More Information

Polymer Website

Related Articles

Dart 1.5 Released

TypeScript 2.5 Adds Optional Catch Binding

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

Banner


PowerHammer - Leaking Data Through The Power Line
15/04/2018

One of the things you just have to accept is that human ingenuity will always find a way. When it comes to security even the strongest protection will fail. An air-gapped computer has no external netw [ ... ]



Android Development Resources For Free
30/03/2018

Android development relies on a range of technologies which you need to know something about before you embark on creating your own app. Here's an overview of free resources that can help you. 


More News

 

 
 



Comments




or email your comment to: comments@i-programmer.info

 
 

   
Banner
Banner
RSS feed of news items only
I Programmer News
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.