Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix condition for extracting children getter #1039

Merged
merged 1 commit into from
Feb 6, 2019
Merged

fix: fix condition for extracting children getter #1039

merged 1 commit into from
Feb 6, 2019

Conversation

ravijayaramappa
Copy link
Contributor

Details

The condition to extract children descriptor from Element.prototype or HTMLElement.prototype has a bug. It is checking the wrong property

Does this PR introduce a breaking change?

  • Yes
  • No

@@ -47,7 +47,7 @@ const matches: (this: Element, selector: string) => boolean = hasOwnProperty.cal
Element.prototype.matches :
(Element.prototype as any).msMatchesSelector; // IE11

const childrenGetter: (this: HTMLElement) => HTMLCollectionOf<Element> = hasOwnProperty.call(Element.prototype, 'innerHTML') ?
const childrenGetter: (this: HTMLElement) => HTMLCollectionOf<Element> = hasOwnProperty.call(Element.prototype, 'children') ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just go the whole mile and do

getOwnPropertyDescriptor(Element.prototype, 'children') ?
getOwnPropertyDescriptor(Element.prototype, 'children').get! :
getOwnPropertyDescriptor(HTMLElement.prototype, 'children').get!;

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 562da1a | Target commit: bf67d64

lwc-engine-benchmark

table-append-1k metric base(562da1a) target(bf67d64) trend
benchmark-table/append/1k duration 153.85 (±4.80 ms) 150.90 (±3.25 ms) -2.9ms (1.9%) 👍
table-clear-1k metric base(562da1a) target(bf67d64) trend
benchmark-table/clear/1k duration 6.50 (±0.40 ms) 6.10 (±0.50 ms) -0.4ms (6.2%) 👍
table-create-10k metric base(562da1a) target(bf67d64) trend
benchmark-table/create/10k duration 891.35 (±7.50 ms) 885.10 (±6.60 ms) -6.3ms (0.7%) 👍
table-create-1k metric base(562da1a) target(bf67d64) trend
benchmark-table/create/1k duration 117.80 (±3.65 ms) 118.35 (±2.45 ms) +0.5ms (0.5%) 👌
table-update-10th-1k metric base(562da1a) target(bf67d64) trend
benchmark-table/update-10th/1k duration 84.00 (±3.55 ms) 74.05 (±1.90 ms) -10.0ms (11.8%) 👍
tablecmp-append-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-component/append/1k duration 256.70 (±5.10 ms) 252.75 (±5.50 ms) -3.9ms (1.5%) 👍
tablecmp-clear-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-component/clear/1k duration 12.85 (±1.70 ms) 11.50 (±1.45 ms) -1.4ms (10.5%) 👍
tablecmp-create-10k metric base(562da1a) target(bf67d64) trend
benchmark-table-component/create/10k duration 1754.65 (±13.05 ms) 1753.80 (±15.05 ms) -0.9ms (0.0%) 👌
tablecmp-create-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-component/create/1k duration 211.75 (±5.45 ms) 211.40 (±6.25 ms) -0.3ms (0.2%) 👌
tablecmp-update-10th-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-component/update-10th/1k duration 71.15 (±4.70 ms) 69.45 (±5.05 ms) -1.7ms (2.4%) 👌
wc-append-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-wc/append/1k duration 257.45 (±6.00 ms) 258.10 (±6.05 ms) +0.7ms (0.3%) 👌
wc-clear-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-wc/clear/1k duration 23.10 (±2.30 ms) 21.35 (±1.85 ms) -1.8ms (7.6%) 👍
wc-create-10k metric base(562da1a) target(bf67d64) trend
benchmark-table-wc/create/10k duration 2008.35 (±17.15 ms) 1999.25 (±12.65 ms) -9.1ms (0.5%) 👍
wc-create-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-wc/create/1k duration 222.45 (±5.40 ms) 221.60 (±5.75 ms) -0.8ms (0.4%) 👌
wc-update-10th-1k metric base(562da1a) target(bf67d64) trend
benchmark-table-wc/update-10th/1k duration 69.45 (±3.55 ms) 66.85 (±5.40 ms) -2.6ms (3.7%) 👌

Copy link
Member

@ekashida ekashida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ravijayaramappa ravijayaramappa merged commit b9a3237 into salesforce:master Feb 6, 2019
@ravijayaramappa ravijayaramappa deleted the ravi/master/child-getter/W-5832932 branch February 6, 2019 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants