Skip to content

Releases: Polymer/polymer

v3.5.2

07 Oct 21:34
Compare
Choose a tag to compare
  • Fix an accidentally quadratic reduce(concat) in FlattenedNodesObserver (#5739) 3c2f759

v3.5.1...v3.5.2

v3.4.1

30 Apr 18:21
Compare
Choose a tag to compare
  • [ci skip] bump to 3.4.1 (commit)

  • Add type for DomApiNative's setAttribute method. (commit)

  • Remove gen-typescript-declarations; manually add LegacyElementMixin's setAttribute type. (commit)

  • Remove "DO NOT EDIT" warning comments. (commit)

  • Track TypeScript declarations. (commit)

  • Update Closure types for overridden setAttribute in LegacyElementMixin. (commit)

  • Add method / parameter descriptions. (commit)

  • Fix TypeScript breakages by specifying types for overridden setAttribute and getAttribute. (commit)

  • Add complete commit list for v3.4.0 (commit)

  • Fix a couple more compiler warnings (commit)

  • Typos and other minor changes. (commit)

  • Add a note about a bug fix for chunking. (commit)

  • Add useAdoptedStyleSheetsWithBuiltCSS section. (commit)

  • Add setters to settings titles. (commit)

  • Add a note about orderedComputed and cycles. (commit)

  • Add example of overriding suppressTemplateNotifications via notify-dom-change. (commit)

  • Add a section about automatic use of constructable stylesheets. (commit)

  • Add "Other new features" section for reuseChunkedInstances and LegacyElementMixin's built-in disable-upgrade support. (commit)

  • Added notes for fastDomIf, removeNestedTemplates, suppressNestedTemplates, and suppressTemplateNotifications. (commit)

  • Started on release notes for legacyUndefined, legacyWarnings, orderedComputed. (...) (commit)

  • Remove unused externs. (commit)

v3.4.0...v3.4.1

v3.4.0

27 Apr 20:54
Compare
Choose a tag to compare

New global settings

This update to Polymer includes some new global settings:

  • legacyUndefined / setLegacyUndefined

    What does it do? This setting reverts how computed properties handle undefined values to the Polymer 1 behavior: when enabled, computed properties will only be recomputed if none of their dependencies are undefined.

    Components can override the global setting by setting their _overrideLegacyUndefined property to true. This is useful for reenabling the default behavior as you migrate individual components:

    import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
    class MigratedElement extends PolymerElement { /* ... */ }
    // All MigratedElement instances will use the default behavior.
    MigratedElement.prototype._overrideLegacyUndefined = true;
    customElements.define('migrated-element', SomeElement);

    Should I use it? This setting should only be used for migrating legacy codebases that depend on this behavior and is otherwise not recommended.

  • legacyWarnings / setLegacyWarnings

    What does it do? This setting causes Polymer to warn if a component's template contains bindings to properties that are not listed in that element's properties block. For example:

    import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
    class SomeElement extends PolymerElement {
      static get template() {
        return html`<span>[[someProperty]] is used here</span>`;
      }
      static get properties() {
        return { /* but `someProperty` is not declared here */ };
      }
    }
    customElements.define('some-element', SomeElement);

    Only properties explicitly declared in the properties block are associated with an attribute and update when that attribute changes. Enabling this setting will show you where you might have forgotten to declare properties.

    Should I use it? Consider using this feature during development but don't enable it in production.

  • orderedComputed / setOrderedComputed

    What does it do? This setting causes Polymer to topologically sort each component's computed properties graph when the class is initialized and uses that order whenever computed properties are run.

    For example:

    import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
    class SomeElement extends PolymerElement {
      static get properties() {
        return {
          a: {type: Number, value: 0},
          b: {type: Number, computed: 'computeB(a)'},
          c: {type: Number, computed: 'computeC(a, b)'},
        };
      }
      computeB(a) {
        console.log('Computing b...');
        return a + 1;
      }
      computeC(a, b) {
        console.log('Computing c...');
        return (a + b) * 2;
      }
    }
    customElements.define('some-element', SomeElement);

    When a changes, Polymer's default behavior does not specify the order in which its dependents will run. Given that both b and c depend directly on a, one of two possible orders could occur: [computeB, computeC] or [computeC, computeB].

    • In the first case - [computeB, computeC] - computeB is run with the new value of a and produces a new value for b. Then, computeC is run with both the new values of a and b to produce c.

    • In the second case - [computeC, computeB] - computeC is run first with the new value of a and the current value of b to produce c. Then, computeB is run with the new value of a to produce b. If computeB changed the value of b then computeC will be run again, with the new values of both a and b to produce the final value of c.

    However, with orderedComputed enabled, the computed properties would have been previously sorted into [computeB, computeC], so updating a would cause them to run specifically in that order.

    If your component's computed property graph contains cycles, the order in which they are run when using orderedComputed is still undefined.

    Should I use it? The value of this setting depends on how your computed property functions are implemented. If they are pure and relatively inexpensive, you shouldn't need to enable this feature. If they have side effects that would make the order in which they are run important or are expensive enough that it would be a problem to run them multiple times for a property update, consider enabling it.

  • fastDomIf / setFastDomIf

    What does it do? This setting enables a different implementation of <dom-if> that uses its host element's template stamping facilities (provided as part of PolymerElement) rather than including its own. This setting can help with performance but comes with a few caveats:

    • First, fastDomIf requires that every <dom-if> is in the shadow root of a Polymer element: you can't use a <dom-if> directly in the main document or inside a shadow root of an element that doesn't extend PolymerElement.

    • Second, because the fastDomIf implementation of <dom-if> doesn't include its own template stamping features, it doesn't create its own scope for property effects. This means that any properties you were previously setting on the <dom-if> will no longer be applied within its template, only properties of the host element are available.

    Should I use it? This setting is recommended as long as your app doesn't use <dom-if> as described in the section above.

  • removeNestedTemplates / setRemoveNestedTemplates

    What does it do? This setting causes Polymer to remove the child <template> elements used by <dom-if> and <dom-repeat> from the their containing templates. This can improve the performance of cloning your component's template when new instances are created.

    Should I use it? This setting is generally recommended.

  • suppressTemplateNotifications / setSuppressTemplateNotifications

    What does it do? This setting causes <dom-if> and <dom-repeat> not to dispatch dom-change events when their rendered content is updated. If you're using lots of <dom-if> and <dom-repeat> but not listening for these events, this setting lets you disable them and their associated dispatch work.

    You can override the global setting for an individual <dom-if> or <dom-repeat> by setting its notify-dom-change boolean attribute:

    import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
    class SomeElement extends PolymerElement {
      static get properties() {
        return {
          visible: {type: Boolean, value: false},
        };
      }
      static get template() {
        return html`
          <button on-click="_toggle">Toggle</button>
          <!-- Set notify-dom-change to enable dom-change events for this particular <dom-if>. -->
          <dom-if if="[[visible]]" notify-dom-change on-dom-change="_onDomChange">
            <template>
              Hello!
            </template>
          </dom-if>
        `;
      }
      _toggle() {
        this.visible = !this.visible;
      }
      _onDomChange(e) {
        console.log("Received 'dom-change' event.");
      }
    }
    customElements.define('some-element', SomeElement);

    Should I use it? This setting is generally recommended.

  • legacyNoObservedAttributes / setLegacyNoObservedAttributes

    What does it do? This setting causes LegacyElementMixin not to use the browser's built-in mechanism for informing elements of attribute changes (i.e. observedAttributes and attributeChangedCallback), which lets Polymer skip computing the list of attributes it tells the browser to observe. Instead, LegacyElementMixin simulates this behavior by overriding attribute APIs on the element and calling attributeChangedCallback itself.

    This setting has similar API restrictions to those of the custom elements polyfill. You should only use the element's setAttribute and removeAttribute methods to modify attributes: using (e.g.) the element's attributes property to modify its attributes is not supported with legacyNoObservedAttributes and won't properly trigger attributeChangedCallback or any property effects.

    Components can override the global setting by setting their _legacyForceObservedAttributes property to true. This property's effects occur at startup; it won't have any effect if modified at runtime and should be set in the class definition.

    Should I use it? This setting should only be used if startup time is significantly affected by Polymer's class initialization work - for example, if you have a large number of components being loaded but are only instantiating a small subset of them. Otherwise, this setting is not recommended.

  • useAdoptedStyleSheetsWithBuiltCSS / setUseAdoptedStyleSheetsWithBuiltCSS

    What does it do? If your application is uses pre-built Shady CSS styles and your browser supports constructable stylesheet objects, this setting will cause Polymer to extract all <style> elements from your components' templates, join them into a single stylesheet, and share this stylesheet with all instances of the component using their shadow roots' adoptedStyleSheets array. This setting may improve your components' memory usage and perform...

Read more

v3.3.1

08 Nov 21:20
Compare
Choose a tag to compare
  • [ci skip] bump to 3.3.1 11f1f13
  • Merge pull request #5594 from rslawik/patch-1 e477a6f
  • Merge pull request #5600 from Polymer/TimvdLippe-patch-2 dc20fec
  • Remove TimvdLippe from CODEOWNERS b99c299
  • Merge pull request #5598 from Polymer/polymer-dom-api 8c69fb8
  • Add node field to PolymerDomApi 15747c8
  • Improve types for the template field on Polymer elements. (#5596) 4274bce
  • Add module field 9a4d4d9
  • Merge pull request #5584 from Polymer/closure-__hasRegisterFinished f6ccc9d
  • Wrap other hasOwnProperty checks in JSCompiler_renameProperty. 0541b21
  • Wrap hasOwnProperty checks for __hasRegisterFinished in JSCompiler_renameProperty(). 9e90fd2
  • Merge pull request #5578 from Polymer/fix-placeholder-typing 96c125e
  • Fix typing error in fixPlaceholder f050ce9
  • Merge pull request #5577 from Polymer/ie-placeholder-binding 7d6d715
  • Fix up comments based on feedback ab49f51
  • Workaround bindings to textarea.placeholder in IE 61767da
  • Add additional externs (#5575) 69ee468
  • Merge pull request #5566 from Polymer/compile e7e4c24
  • Make Closure compiler happier about ShadyDOM access 46ee2ae
  • Remove other double import (#5565) 0d2c2e5
  • Only use CONST_CASE for constants. (#5564) 54f8b47
  • [skip ci] update changelog ac12b3b

v3.3.0...v3.3.1

v3.3.0

24 Jun 19:17
Compare
Choose a tag to compare
  • [ci skip] Update version to 3.3.0 dd7c0d7
  • Don't import/export from the same file twice (#5562) 94585c3
  • Merge pull request #5559 from Polymer/compile 9c7492d
  • Add @OverRide, remove @attribute/@group/@hero/@homepage ed7709f
  • Merge pull request #5558 from Polymer/compile 8af0ec4
  • Closure compilation tweaks 15090f2
  • Merge pull request #5557 from Polymer/compile 1b8263f
  • Add @return description a6bff43
  • Fix some Closure annotations 0810bf3
  • Merge pull request #5550 from Polymer/externs-fixes-1 fe81676
  • Pin to firefox 66 because of selenium error f0fb532
  • Fix eslint errors. 6dfaa5f
  • Add some casts for places Closure doesn't understand constructor 10d43ce
  • Add new mixin annotations, remove GestureEventListeners alias 0ae14b9
  • Align signatures of attributeChangedCallback 4cc6c33
  • Add @return annotation for PROPERTY_EFFECT_TYPES getter 3dd189c
  • Annotate __dataEnabled in a way analyzer understands e4e9e2f
  • Fix old global namespace type annotation for TemplateInstanceBase fc190dd
  • Add @Suppress annotation for use of deprecated cssFromModules 54b1d78
  • Fix GestureEventListeners generated externs name. cdd4e20
  • Merge pull request #5548 from Polymer/hide-template-controls-globally 05231a0
  • Globally hide dom-{bind,if,repeat} elements with legacyOptmizations on 43f57b1
  • Merge pull request #5546 from Polymer/sync-closure-annotations 76bfc0a
  • Update dependencies to fix firefox 67 tests ff2edd5
  • Sync closure compiler annotations ad08420
  • Merge pull request #5544 from Polymer/scopesubtree-same-scope 927ae6a
  • remove unused variable in test c051c5b
  • remove debugger line 634d736
  • Make sure scopeSubtree does not recurse through other ShadowRoots 8a5c1e9
  • Merge pull request #5542 from Polymer/5541-kschaaf-template-display 4f40589
  • Don't set display: none under legacyOptimizations. Fixes #5541. c9cf56c
  • Merge pull request #5537 from Polymer/scopeSubtree 6be58b0
  • Use Array.from instead of a list comprehension 338d420
  • Merge pull request #5533 from LarsDenBakker/fix/configure-cancel-synthetic-click 971d32d
  • Merge pull request #5538 from Polymer/cl245273850 1c10f0c
  • Add check for // 3db5608
  • Use native qSA e10019a
  • Implement scopeSubtree for ShadyDOM noPatch mode 6bc9534
  • Remove unneccessary test 1f08059
  • Add URL try/catch 940b3cd
  • Upstreaming cl/245273850 413ef2f
  • Merge pull request #5534 from Polymer/removeAttribute-scoping 3b6f334
  • Allow configuring cancelling synthetic click behavior 00d4cdf
  • Add test for class$ binding 8043d4c
  • Fix class$ bindings for ShadyDOM.noPatch mode a0b83b2
  • Merge pull request #5531 from Polymer/resolve-url 969f289
  • Add test for resolveUrl('//') 5537380
  • Check directly for // in resolveUrl because it isn't a valid URL d0ea20a
  • Run resolveUrl for protocol-relative urls (#5530) 733cf68
  • Merge pull request #5527 from Polymer/localTarget-noPatch 03b2c66
  • Merge pull request #5528 from Polymer/closure-statics-workaround 8f7119a
  • Fix lint 6960c2b
  • Cast GestureEventListeners. 3437334
  • Work around google/closure-compiler#3240 cc7702b
  • Fix localTareget when ShadyDOM.noPatch is in use 7925254
  • Merge pull request #5518 from Polymer/fix-className-bindings-master 07f1e19
  • Merge branch 'master' into fix-className-bindings-master 652fea9
  • Merge pull request #5487 from Polymer/shadydom-upgrade 176c001
  • webcomponentsjs 2.2.10 002a431
  • upgrade dependencies. 3b7c9f8
  • upgrade webcomponentsjs to 2.2.9 4e60395
  • Merge pull request #5520 from Polymer/avoid-template-upgrade 8f4cc31
  • [ci skip] Add comment c7eb7c1
  • Merge branch 'master' into shadydom-upgrade dd98569
  • Use attachShadow({shadyUpgradeFragment}) 3af9f34
  • Merge pull request #5522 from Polymer/5428-kschaaf-undefined-wildcard ddcfc63
  • Remove test.only ca12448
  • Ensure wildcard arguments get undefined treatment. Fixes #5428. f5a45eb
  • Fix typo 6adbc23
  • Fix className on browsers without good native accessors b13e656
  • don't depend on attachDom existing. 8d7def7
  • Merge branch 'master' into shadydom-upgrade 707a376
  • Simplify f1a9d4f
  • Avoid upgrading template if no hostProps, for better perf. 65a5b48
  • Update webcomponents dev dependency for testing className fix a1c67e4
  • fix closure compiler error 002ef94
  • fix lint issues 439c245
  • Address review feedback via comment. 4e1d6a1
  • Ensure className bindings work correctly when ShadyDOM.noPatch is used. eb2385a
  • Merge pull request #5512 from Polymer/no-walker b7c73bd
  • Remove use of TreeWalker for finding nodes in templates. 24d642e
  • Merge pull request #5511 from dvanderleij/master 4043c84
  • Remove Google+ links in README.md and CONTRIBUTING.MD dc88057
  • Use correct ShadyDOM API: attachDom 1aeaa80
  • Use ShadyDOM.upgrade 50ba9ce

v3.2.0...v3.3.0

v2.8.0

24 Jun 18:54
Compare
Choose a tag to compare
  • Allow configuring cancelling synthetic click behavior (#5536) 9a8bca4
  • [ci skip] update changelog for 2.7.2 a7cb0ae

v2.7.2...v2.8.0

Stable Release v1.12.0

20 May 22:16
Compare
Choose a tag to compare

v2.7.2

16 Apr 21:44
Compare
Choose a tag to compare

Raw Notes

  • Ensure wildcard arguments get undefined treatment. Fixes #5428. (commit)

  • Fix type of template setter in element-mixin.html (#5519) (commit)

  • [ci skip] Update changelog for 2.7.1 (commit)

Stable release v3.2.0

22 Mar 01:27
Compare
Choose a tag to compare

Additions

  • Add support for ShadyDOM "noPatch" mode via Polymer.dom API (#5452, #5489)
  • Add warnings related to changes from Polymer 1.x (#5474)

Fixes

  • Various closure compiler fixes (#5424, #5506, #5462, #5465, #5466, #5467, #5480, #5483, #5495, #5502, #5506)
  • Fix for #5503: Ensure default value from behavior is respected (#5504)
  • Fix for #5250: Fix memory leak caused by debouncer flush queue (#5499, #5508)
  • Fix for #5422: Ensure LegacyDataMixin applies to Templatizer instances (#5423)
  • Allow ES6 class to be passed to legacy Polymer function (#5464)
  • Disable auto strip-whitespace on template under legacyOptimizations setting (#5470)
  • Fix for #5475: Ensure wildcard observer uses latest value during reentrant changes (#5476)

2.7.1

22 Mar 01:32
Compare
Choose a tag to compare
  • Sync with fixes on master branch. (commit)

  • Add comment about order when re-debouncing (commit)

  • Fix lint, update types (commit)

  • Fix order of flushed debouncers to match 1.x (commit)

  • Avoid Array.fill (commit)

  • Add comments (commit)

  • Update types (commit)

  • Use set and clear debouncer upon completion. Fixes #5250 (commit)

  • Revert "Use set and clear debouncer upon completion. Fixes #5250" (commit)

  • Use set and clear debouncer upon completion. Fixes #5250 (commit)

  • Quote the getStyle method of the custom style element. (commit)

  • Remove yet another string concatenation to a template string (commit)

  • Avoid string concatentation to template strings (commit)

  • Update several string references which can be renamed by closure-compiler (commit)

  • Disable auto strip-whitespace on template with legacyOptimizations (commit)

  • Polymer 2.x version of #5464 (commit)

  • Update generated types for Polymer 2.x (commit)

  • [ci skip] update chnagelog (commit)