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

 

Banner


JetBrains Improves Kubernetes Support In IDE Upgrades
12/11/2024

JetBrains has improved its IDEs with features to suggest the logical structure of code, to streamline the debugging experience for Kubernetes applications, and provide comprehensive cluster-wide Kuber [ ... ]



Data Wrangler Gets Copilot Integration
11/11/2024

Microsoft has announced that Copilot is being integrated into Data Wrangler. The move will give data scientists the ability to use natural language to clean and transform data, and to get help with fi [ ... ]


More News

 

espbook

 

Comments




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