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(engine): invert condition to apply click-event-composed polyfill #590

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

ekashida
Copy link
Member

@ekashida ekashida commented Aug 15, 2018

Details

Fixes a bug where the detection logic to apply the click-event-composed polyfill had the wrong condition. We need to apply the polyfill when the click event has composed=false.

Does this PR introduce a breaking change?

  • Yes
  • No

This polyfill has not been released yet.

@@ -16,5 +16,5 @@ export default function detect(): boolean {
button.addEventListener('click', event => clickEvent = event);
button.click();

return composedDescriptor.get!.call(clickEvent);
return !composedDescriptor.get!.call(clickEvent);
Copy link
Member Author

Choose a reason for hiding this comment

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

If the click event dispatched by the call to button.click() is not composed, then we want to apply our polyfill which makes it so that these click events will be composed.

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: edb8276 | Target commit: 402af56

lwc-engine-benchmark

table-append-1k metric base(edb8276) target(402af56) trend
benchmark-table/append/1k duration 145.60 (± 5.50 ms) 143.80 (± 5.50 ms) 1.24% 👌
table-clear-1k metric base(edb8276) target(402af56) trend
benchmark-table/clear/1k duration 11.15 (± 0.60 ms) 10.80 (± 0.55 ms) 3.14% 👌
table-create-10k metric base(edb8276) target(402af56) trend
benchmark-table/create/10k duration 844.60 (± 8.70 ms) 831.00 (± 4.50 ms) 1.61% 👍
table-create-1k metric base(edb8276) target(402af56) trend
benchmark-table/create/1k duration 103.00 (± 1.80 ms) 103.70 (± 2.00 ms) -0.68% 👌
table-update-10th-1k metric base(edb8276) target(402af56) trend
benchmark-table/update-10th/1k duration 84.90 (± 2.80 ms) 83.90 (± 3.60 ms) 1.18% 👌
tablecmp-append-1k metric base(edb8276) target(402af56) trend
benchmark-table-component/append/1k duration 220.10 (± 3.90 ms) 231.00 (± 5.30 ms) -4.95% 👎
tablecmp-clear-1k metric base(edb8276) target(402af56) trend
benchmark-table-component/clear/1k duration 33.55 (± 1.75 ms) 34.70 (± 2.20 ms) -3.43% 👌
tablecmp-create-10k metric base(edb8276) target(402af56) trend
benchmark-table-component/create/10k duration 1511.40 (± 11.60 ms) 1519.00 (± 10.60 ms) -0.50% 👎
tablecmp-create-1k metric base(edb8276) target(402af56) trend
benchmark-table-component/create/1k duration 170.70 (± 3.30 ms) 174.80 (± 3.50 ms) -2.40% 👎
tablecmp-update-10th-1k metric base(edb8276) target(402af56) trend
benchmark-table-component/update-10th/1k duration 77.40 (± 4.20 ms) 77.50 (± 2.40 ms) -0.13% 👌
wc-append-1k metric base(edb8276) target(402af56) trend
benchmark-table-wc/append/1k duration 260.80 (± 6.00 ms) 237.60 (± 10.20 ms) 8.90% 👍
wc-clear-1k metric base(edb8276) target(402af56) trend
benchmark-table-wc/clear/1k duration 33.60 (± 1.50 ms) 34.40 (± 1.00 ms) -2.38% 👌
wc-create-10k metric base(edb8276) target(402af56) trend
benchmark-table-wc/create/10k duration 1963.10 (± 10.80 ms) 1948.40 (± 9.30 ms) 0.75% 👍
wc-create-1k metric base(edb8276) target(402af56) trend
benchmark-table-wc/create/1k duration 208.45 (± 2.85 ms) 211.20 (± 3.20 ms) -1.32% 👎
wc-update-10th-1k metric base(edb8276) target(402af56) trend
benchmark-table-wc/update-10th/1k duration 73.90 (± 2.90 ms) 73.30 (± 3.20 ms) 0.81% 👌

@byao byao merged commit dc506e4 into 216/patch Aug 15, 2018
@ekashida ekashida deleted the fix-click-event-composed-polyfill-detect branch August 15, 2018 07:47
ekashida added a commit that referenced this pull request Aug 15, 2018
ekashida added a commit that referenced this pull request Aug 23, 2018
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