Polymer (library)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Wongmjane (talk | contribs) at 21:48, 4 December 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Polymer
Developer(s)Google and contributors
Initial releaseMay 27, 2015; 8 years ago (2015-05-27)
Stable release
1.7.0 / September 29, 2016; 7 years ago (2016-09-29)
Repository
Written inJavaScript, HTML
TypeJavaScript library
License3-Clause BSD
Websitewww.polymer-project.org

Polymer is an open-source JavaScript library for building web applications using web components. The library is being developed by Google developers and contributors on GitHub. Modern design principles are implemented as a separate project using Google's Material Design design principles.

Polymer is used by a number of Google services and websites, including YouTube Gaming, Google I/O websites, Google Play Music and redesign of Google Sites.[1]

History

Public development of Polymer began in Nov 14, 2013 with the release of a Promises Polyfill. This steadily expanded into a web design library covering visual styling guidelines (via Material Design), data binding, and a large number of "Core" and "Paper" web components. Core components were originally envisioned to encompass generic functionality that would be essential to most websites, while Paper components were intended to provide more specialized components with Material Design concepts forming a key part of their design. A major milestone was reached with the release of Version 0.5, which was considered the first version of the project ready for use by early adopters.[2]

Google continued to revise the design of Polymer after the release of 0.5, with special consideration given to the performance issues a number of developers found issue with. This culminated with the release of Polymer 1.0 in 2015, which was the first "production ready" version of the library.[3] Version 1.0 significantly improved the performance of Polymer, reducing load times by up to 7 times.[4] With version 1.0 Google split the elements from the Polymer project to clearly distinguish the elements catalog from the Polymer polyfill & webcomponents-sugaring library.

On 14–15 September 2015 Google organized a Polymer Summit in Amsterdam.

Features

Polymer provides a number of features over vanilla web components:

  • Simplified way of creating custom elements
  • Two-way data binding
  • Computed properties
  • Conditional and repeat templates
  • Gesture events
  • Library of elements (Polymer Element Catalog)

Usage

Polymer has begun to gain increasing recognition in the market, with special attention paid to its structured design process, allowing for a "lego block" structure.[5]

Custom elements

Custom elements can be created using the dom-module element provided by Polymer. Custom element definition comprises CSS style, HTML template of the element's local DOM, element properties, lifecycle callbacks and JavaScript methods:

<dom-module id="hello-element">
  <template>
    <style>
      /* Local DOM CSS style */
    </style>
    <!-- Local DOM -->
    Hello {{name}}!
  </template>
  <script>
  Polymer({
    is: 'hello-element',
    properties: {
      name: String
      /* Element properties */
    },
    ready: function() {
      /* Called when local DOM is initialized */
    },
    /* Custom methods */
  });
  </script>
</dom-module>

The element defined above can be used in HTML code:

<hello-element name="World"></hello-element>

Libraries using Polymer

Vaadin Elements extends the Polymer element catalog with elements designed for business app use.

See also

References

  1. ^ "Who's using Polymer?". GitHub. Retrieved 4 June 2016.
  2. ^ "Polymer gives us a closer look at Google's Material Design UI". Android Authority.
  3. ^ Steven Max Patterson (29 May 2015). "Google's Polymer 1.0 brings reuse and better branding to Web development". CIO.
  4. ^ "Welcome - Polymer 1.0".
  5. ^ Allie Coyne (13 August 2015). "Inside ING Direct's new lego block app architecture". iTnews.

External links