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, Facebook or Linkedin.



AI Replaces Thousand Dollar Guitar Tube Amps

The faithful still love their old fashioned technology in the form of analog tube amps specifically, but not always, for guitars. The only problem is that they can cost thousands of dollars. Why not l [ ... ]

Developers Finally In Revolt Against Apple

The Epic v Apple legal wrangle seems to have started a long overdue revolt against the Apple App store. Can the Coalition for App Fairness make a difference?

More News






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