Commit Graph

6883 Commits

Author SHA1 Message Date
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
Peter Burns
afdd9119ad Rebase sanitize dom value getter onto legacy-undefined-noBatch (#5618)
* Add  getSanitizeDOMValue to settings API

For environments that don't well support `export let`.

* Add a test for getSanitizeDOMValue
2020-01-17 14:07:17 -08:00
Peter Burns
aec4cb681e Add getSanitizeDOMValue to settings API (#5617)
* Add  getSanitizeDOMValue to settings API

For environments that don't well support `export let`.

* Add a test for getSanitizeDOMValue
2020-01-17 14:06:33 -08:00
Steve Orvell
7d071f7e7a Merge pull request #5615 from Polymer/legacy-undefined-noBatch-update
Merge from master
2020-01-13 15:14:20 -08:00
Steven Orvell
a55e6f039e Merge branch 'master' into legacy-undefined-noBatch-update 2020-01-13 13:40:39 -08:00
Steve Orvell
13a8ea479a Merge pull request #5614 from Polymer/closure-extern-fix
FIx closure annotation
2020-01-13 13:40:05 -08:00
Steven Orvell
15ce881fda FIx closure annotation
Closure was unhappy with the change from `var` to `let` so reverting it.
2020-01-13 11:18:01 -08:00
Kevin Schaaf
4f6fed5082 Merge pull request #5613 from Polymer/legacy-undefined-noBatch-closure
Fix closure annotation.
2020-01-10 16:40:47 -08:00
Steven Orvell
0427abe402 Fix closure annotation. 2020-01-10 14:26:15 -08:00
Steve Orvell
4464cca751 Merge pull request #5612 from Polymer/legacy-undefined-noBatch-sync
Merge from master.
2020-01-10 12:04:53 -08:00
Steven Orvell
943905fb8e Merge branch 'master' into legacy-undefined-noBatch-sync 2020-01-10 10:46:17 -08:00