Select Page

What are the changes in Polymer 3?

The biggest changes that had been announced at the 2017 Polymer Summit in Copenhagen are:

  • Moving to npm from Bower
  • Switching to using ES6 Modules instead of HTML Imports.

Why NPM?

Bower’s flat dependency tree i.e. it doesn’t support nested dependencies is one of the reason to move to npm. This means if Bower cannot find a version of the dependency that meets all the conditions, then you must resolve it manually. Also, Bower is no longer being actively developed.

Moving to npm will make Polymer packages seamlessly available to the millions of npm users, and allow Polymer packages to easily use other packages from the massive npm ecosystem.

For the flat installs Polymer will be using Yarn npm client which helps to resolve mismatching versions of dependencies to a single version to avoid.

Why ES6 Modules?

ES6 modules allow JavaScript files to import other files, causing them to be loaded and executed by the browser. The loading behavior of ES6 modules is nearly identical to HTML Imports:

  • Web-native loading mechanism.
  • Transitive loading of dependencies with ordered evaluation.
  • Deduplication of dependencies by URL.

For more information : https://www.polymer-project.org/blog/2017-08-22-npm-modules

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *