Commit Graph

6793 Commits

Author SHA1 Message Date
Russell Bicknell
1fa4948bb1 Add example of overriding suppressTemplateNotifications via notify-dom-change. 2020-04-02 14:26:40 -07:00
Russell Bicknell
d9c18b4735 Add a section about automatic use of constructable stylesheets. 2020-04-01 14:40:37 -07:00
Russell Bicknell
7a2e9f81b0 Add "Other new features" section for reuseChunkedInstances and LegacyElementMixin's built-in disable-upgrade support. 2020-04-01 14:19:16 -07:00
Russell Bicknell
3b6494bf0f Added notes for fastDomIf, removeNestedTemplates, suppressNestedTemplates, and suppressTemplateNotifications. 2020-03-30 14:33:35 -07:00
Russell Bicknell
d80fdca088 Started on release notes for legacyUndefined, legacyWarnings, orderedComputed. (...)
These might be too large for release notes and may be better off moved to the
docs site.
2020-03-27 16:12:37 -07:00
Russell Bicknell
0da4e63f26 Remove unused externs. 2020-03-26 13:38:47 -07:00
Peter Burns
20b207e142 Annotate more return types as !defined (#5642) 2020-03-09 17:59:22 -07:00
Kevin Schaaf
22e1d02f53 Merge pull request #5640 from Polymer/legacy-undefined-noBatch-5631-2
Ensure limit is reset when initialCount is disabled.
2020-03-05 13:58:36 -08:00
Kevin Schaaf
ddb37df985 Ensure any previously enqueued rAF is canceled when re-rendering.
Also, use instances length instead of renderedItemCount since it will be undefined on first render.
2020-03-04 22:49:16 -08:00
Kevin Schaaf
d92ff92fb2 Improve comment. 2020-03-04 11:33:19 -08:00
Kevin Schaaf
91f01e5781 Remove obsolete tests. 2020-03-04 11:24:16 -08:00
Kevin Schaaf
b5664cba10 Simplify by making limit a derived value from existing state.
This centralizes the calculation of limit based on changes to other state variables.
2020-03-04 11:20:57 -08:00
Kevin Schaaf
a02ed026e3 Update Sauce config to drop Safari 9, add 12 & 13.
Safari 9 is now very old, and has micro task ordering bugs issues that make testing flaky.
2020-03-03 17:17:34 -08:00
Kevin Schaaf
d67a8b5192 Remove accidental commit of test.only 2020-03-02 23:45:50 -08:00
Kevin Schaaf
1d96db3c38 When re-enabling, ensure __limit is at a good starting point and add a test for that.
Also:
* Ensure `__itemsArrayChanged` is cleared after every render.
* Enqueue `__continueChunkingAfterRaf` before notifying renderedItemCount for safety
2020-03-02 23:41:12 -08:00
Kevin Schaaf
b503db15f1 Remove accidental commit of suite.only 2020-03-02 22:51:52 -08:00
Kevin Schaaf
60f6ccfb7d Ensure limit is reset when initialCount is disabled.
Note that any falsey value for initialCount (including `0`) is interpreted as "chunking disabled". This is consistent with 1.x logic, and follows from the logic of "starting chunking by rendering zero items" doesn't really make sense.
2020-03-02 22:44:19 -08:00
Kevin Schaaf
5421b5b140 Merge pull request #5632 from Polymer/legacy-undefined-noBatch-5631
Fixes for several related dom-repeat chunking issues. Fixes #5631.
2020-02-21 17:44:30 -08:00
Kevin Schaaf
0797488bcc Updates from review.
* Refactoring `__render` for readability
* Removing `__pool`; this was never used in v2: since we reset the pool every update and items are only ever pushed at detach time and we only detach at the end of updates (as opposed to v1 which had more sophisticated splicing)
2020-02-21 17:11:58 -08:00
Kevin Schaaf
537da37129 Merge pull request #5630 from Polymer/legacy-undefined-noBatch-5629
Store syncInfo on instance and don't sync paths. Fixes #5629
2020-02-21 15:38:11 -08:00
Kevin Schaaf
fe86a8c85f Store syncInfo on the dom-if, but null it in teardown.
(same as invalidProps for non-fastDomIf)
2020-02-21 14:05:29 -08:00
Kevin Schaaf
b40840b969 Fixes for several related dom-repeat chunking issues. Fixes #5631.
* Only restart chunking (resetting the list to the initialCount) if the `items` array itself changed (and not splices to the array), to match Polymer 1 behavior.
* Add `reuseChunkedInstances` option to allow reusing instances even when `items` changes; this is likely the more common optimal case when using immutable data, but making it optional for backward compatibility.
* Only measure render time and throttle the chunk size if we rendered a full chunk of new items. Ensures that fast re-renders of existing items don't cause the chunk size to scale up dramatically, subsequently causing too many new items to be created in one chunk.
* Increase the limit by the chunk size as part of any render if there are new items to render, rather than only as a result of rendering.
* Continue chunking by comparing the filtered item count to the limit (not the unfiltered item count).
2020-02-20 23:26:59 -08:00
Kevin Schaaf
b9bbee2c75 Update comment. 2020-02-19 09:39:22 -08:00
Kevin Schaaf
353eabde23 Store syncInfo on instance and don't sync paths. Fixes #5629
* Previously the `syncInfo` used to store changed properties while the dom-if was false was stored on the dom-if. This means that even under `restamp`, any stored properties from a previous instance would be applied to the next instance. This change moves the `syncInfo` storage to the instance, so it naturally goes away when the instance is discarded.  Any new instance will take current values from the host.
* Due to limitations described in #4818, it is bad/illegal to allow paths to be batched and played through `runEffects`, since effect de-duping occurs by _root property_, so effects will only be running once for the first path matching an effect, with all other paths being dropped on the ground.  This can be particularly bad if the user e.g. `set` a path to an object, and then subsequently nulled the object; the observer would then be acting on a path that is no longer valid.  This change only stores the root property & value for any paths that come in, which matches the non-`fastDomIf` behavior with only storing `root(prop)` in `__invalidProps`.
2020-02-12 22:53:12 -08:00
Steve Orvell
c5c7eec498 Merge pull request #5625 from Polymer/legacyNoObservedAttributes-telemetry
Ensure telemetry system works with `legacyNoObservedAttributes` setting
2020-01-30 10:00:23 -08:00
Steven Orvell
5383f5f294 Avoid Array.find (doesn't exist in IE) 2020-01-30 09:26:05 -08:00
Steven Orvell
7df89ae2ed Add comment to skip. 2020-01-29 18:52:31 -08:00
Steven Orvell
fb1a7835a7 Skip test when custom elements polyfill is in use
Cannot be supported with polyfill because it uses setAttribute.
2020-01-29 18:51:56 -08:00
Steven Orvell
688243b32d Copy flag to a single location rather than two. 2020-01-29 18:15:28 -08:00
Steven Orvell
3fd967190e Lint fix. 2020-01-29 18:04:48 -08:00
Steven Orvell
dfd0e64183 Update test name. 2020-01-29 17:57:58 -08:00
Steven Orvell
eaca195467 Introduce opt-out per class for legacyNoObservedAttributes
This is necessary when a native property that sets an attribute should be observeable via attributeChangedCallback or Polymer property reflection (e.g. element.tabIndex = 5 setting the `tabindex` attribute).
2020-01-29 17:54:02 -08:00
Steven Orvell
63addd39ec Ensure telemetry system works with legacyNoObservedAttributes setting 2020-01-29 10:40:33 -08:00
Steve Orvell
3e6ba3e907 Merge pull request #5622 from Polymer/legacy-undefined-noBatch-undefinedTemplate
Allow `undefined` in legacy _template field to fall-through to normal lookup path
2020-01-22 10:08:02 -08:00
Steve Orvell
ccd92a2044 Merge pull request #5620 from Polymer/legacy-undefined-noBatch-imperative-attributes
Adds support for imperatively created elements to `legacyNoObservedAt…
2020-01-22 09:25:39 -08:00
Steven Orvell
c0bb601824 Merge branch 'legacy-undefined-noBatch' into legacy-undefined-noBatch-undefinedTemplate 2020-01-22 08:59:10 -08:00
Steven Orvell
b759988102 Merge branch 'legacy-undefined-noBatch' into legacy-undefined-noBatch-imperative-attributes 2020-01-22 08:57:20 -08:00
Steve Orvell
23acf208ac Merge pull request #5623 from Polymer/legacy-undefined-noBatch-master-merge
Legacy undefined no batch master merge
2020-01-22 08:56:50 -08:00
Steven Orvell
a7ffc3904e Update package-lock.json 2020-01-21 18:24:36 -08:00
Steven Orvell
5e88e6a70d Merge branch 'master' into legacy-undefined-noBatch-master-merge 2020-01-21 18:14:00 -08:00
Steven Orvell
02687acbf7 Merge branch 'master' into legacy-undefined-noBatch-master-merge 2020-01-21 18:07:39 -08:00
Steve Orvell
cb6f6c0f91 Merge pull request #5621 from Polymer/update-travis
modernize travis
2020-01-21 18:05:30 -08:00
Steve Orvell
47a54ef8c7 Update test/unit/inheritance.html 2020-01-21 17:42:32 -08:00
Steven Orvell
61a14c17ce Fix testing issues with latest webcomponentsjs
* querySelectorAll now polyfills an NodeList so coerce to Array when doing `deepEquals`
* when testing noPatch, add workaround for https://github.com/webcomponents/polyfills/issues/250.
2020-01-21 17:29:25 -08:00
Kevin Schaaf
220099cfb4 Allow undefined in legacy _template field to fall-through to normal lookup path. 2020-01-21 16:05:03 -08:00
Daniel Freedman
700c2b0cb3 re-add npm cache 2020-01-21 15:49:12 -08:00
Daniel Freedman
168572a755 regen package-lock 2020-01-21 15:47:24 -08:00
Daniel Freedman
15dba24149 mispelled services, node 10 for consistency 2020-01-21 15:40:34 -08:00
Daniel Freedman
148b2ea277 modernize travis 2020-01-21 15:34:56 -08:00
Steven Orvell
28f12ca9fa Adds support for imperatively created elements to legacyNoObservedAttributes
Using this flag previously read attributes in the element constructor (in addition to patching setAttribute). This covers use cases except imperative or parser created custom elements (not upgraded). In that case the element will not have attributes in the constructor. This is addressed here by checking if the element has a parentNode (which will also not be true in these cases) and if so, records attributes at connected time. This is not always done to avoid having to filter out changes made by bindings.
2020-01-21 13:56:53 -08:00