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. 



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.



The Writing's On the Sand

Who hasn't taken a stick to sign their name in the sand - or in the case of one of the I Programmer team scrawl equations? An inventive creator and 3D printing enthusiast has built a beach printe [ ... ]

Node.js Even Its Creator Thinks Its Flawed

You have to admire Ryan Dahl for creating node.js, even if you don't like it - and there are plenty of people who don't. Now he is back with  an admission that node.js isn't as good as it co [ ... ]

More News






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


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.