This release includes one new feature:

  • :dir() CSS selector is now supported.

    The :dir() selector allows for writing text-orientation specific styling. More information on MDN.

    For elements that extend Polymer.Element, add the Polymer.DirMixin mixin to use :dir() styling. Elements that use the legacy Polymer({}) call automatically include this mixin.

    Use of :dir() requires the application to set the dir attribute on <html>. All elements will use the same direction.

    Individual elements can opt-out of the global direction by setting the dir attribute in HTML or at ready(), but these elements must from then on be handled manually. Setting dir on an ancestor (other than html) has no effect.

This release includes a fix for the following issue:

  • #4679 Work around Chrome deprecation of styling main document from HTML
    Imports.

    Note that this release should prevent future problems when the feature is removed, but doesn't prevent the deprecation warning being logged to the console.

This release includes the following new feature:

  • New global passiveTouchGestures setting.

    The passiveTouchGestures setting allows an app to specify that gesture events like tap and track generated from touch will not be preventable, allowing for better scrolling performance.

    Since this could break elements or apps that depended on being able to call gestureEvent.preventDefault() to prevent scrolling, this is an opt-in setting.

    Use Polymer.setPassiveTouchGestures(true) to enable. See Native browser gesture handling for more information on gesture events and native browsers gestures.

This release includes the following bug fixes and enhancements:

  • An assortment of minor changes to help facilitate easier automated conversions to ES Modules for Polymer 3.x
  • Fix event path for gestures generated by touch events.
  • Add documentation for Polymer.sanitizeDOMValue
    • sanitizeDOMValue is a global callback that can be used to plug into XSS sanitization libraries before the databinding system sets values. See Global settings for more information.
  • Fix ordering of <link rel="import" type="css"> stylesheets to always be prepended, more aligned with their usage in 1.x.
  • The <dom-bind> element is now exposed on Polymer as Polymer.DomBind.
  • All <dom-*> elements are now explicitly styled as display: none.

This release includes the following fixes and enhancements:

  • Full Closure Compiler compatibility with Polymer Pass version 2. --polymer_version=2 flag to Closure Compiler
  • #4597. Fix for elements that take templates provided as light DOM children.
  • Fix DocumentFragment issues on IE 11.
  • #4643 Allow spaces inside of functions in template binding syntax.
  • #4650 Fix dom-repeat to always notify on observed properties changing.

This release includes a fix for the following issue:

  • #4601 Observers not firing when an element is stamped by <iron-list>.

The following changes have been made since 2.0.0-rc.1.

  • Hybrid elements can make template instances with mutable data.

  • dom-change events now fire with the composed flag.

  • Allow properties, behaviors, observers, hostAttributes, and listeners to be set in Polymer({}) calls.

  • Behaviors can only be set on the element prototype.

  • Reintroduce beforeRegister to the legacy API to install dynamic property effects. In a difference from 1.x, is property cannot be set in this function.

  • Maintain 1.x ordering of ready() lifecycle call, where children will always ready() before the parent.

  • Made data binding system more extensible, allowing elements to override template binding functions.

    • Adds override points for _parseBindings and _evaluateBinding.

    • Add override points for _enableProperties and _flushProperties.

    • Adds support for runtime template binding using _stampTemplate.

    • More information on using binding overrides in issue #4510

  • Add $ ID map to dom-bind elements.

  • Support listening to Gesture events with dom-bind elements.

  • Start supporting compilation with Closure Compiler in 'ADVANCED' mode.

  • Allow setProperties to set readOnly properties:

    this.setProperties({readOnlyProp: value}, true)`
    
  • Prevent properties from reverting to default value after boot when the property has no observers.

  • Fix linkPaths() to handle aliased paths.

  • Fix for observers firing before ready().

  • Refactor PropertyEffects mixin with a more usable API. Add new static API for creating property effects which mirror the instance versions:

    • PropertyEffects.addPropertyEffect
    • PropertyEffects.createPropertyObserver
    • PropertyEffects.createMethodObserver
    • PropertyEffects.createNotifyingProperty
    • PropertyEffects.createReadOnlyProperty
    • PropertyEffects.createReflectedProperty
    • PropertyEffects.createComputedProperty
    • PropertyEffects.bindTemplate

    These static methods are not necessary if you're creating a standard Polymer element, but could be helpful for using the PropertyEffects mixin on its own.

  • Fix a bug where setting a property inside of a notification event listener could break the guarantee that clients should be ready before host side effects are processed.

For a release-by-release breakdown of the release candidates, see the raw release notes on GitHub.

The following notable changes have been made since the 2.0 Preview announcement.

  • The config getter on element classes has been replaced by individual properties and observers getters, more closely resembling the 1.x syntax.

    static get properties() {
      return {
        aProp: String,
        bProp: Number
      }
    }
    static get observers() {
      return [
        '_observeStuff(aProp,bProp)'
      ]
    }
    
  • 1.x-style dirty checking has been reinstated for better performance. An optional mixin is available for elements to skip dirty checking of objects and arrays, which may be more easy to integrate with some state management systems. For details, see Using the MutableData mixin in Data system concepts.

  • Support for dynamically-created custom-style elements has been added.

  • Support for the external style sheet syntax, <link rel="import" type="css"> has been added. This was deprecated in 1.x, but will be retained until an alternate solution is available for importing unprocessed CSS.

  • New properties rootPath and basePath were added to Polymer.Element to allow authors to configure how URLs are rewritten inside templates. For details, see the Update URLs in templates in the Upgrade guide.