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): implement composedPath, srcElement and path for events #859

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

caridy
Copy link
Contributor

@caridy caridy commented Nov 24, 2018

Details

  • event.composedPath()
  • event.path => getter alias for .composedPath()
  • event.srcElement => non-standard that is everywhere (thanks to IE)

Does this PR introduce a breaking change?

  • No

@caridy
Copy link
Contributor Author

caridy commented Nov 24, 2018

fixes #415
fixes #305

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 97bb075 | Target commit: a5caacb

lwc-engine-benchmark

table-append-1k metric base(97bb075) target(a5caacb) trend
benchmark-table/append/1k duration 147.55 (±4.90 ms) 150.05 (±4.35 ms) +2.5ms (1.7%) 👌
table-clear-1k metric base(97bb075) target(a5caacb) trend
benchmark-table/clear/1k duration 6.15 (±0.45 ms) 6.20 (±0.40 ms) +0.0ms (0.8%) 👌
table-create-10k metric base(97bb075) target(a5caacb) trend
benchmark-table/create/10k duration 886.10 (±6.10 ms) 880.30 (±6.85 ms) -5.8ms (0.7%) 👍
table-create-1k metric base(97bb075) target(a5caacb) trend
benchmark-table/create/1k duration 116.80 (±3.55 ms) 116.60 (±2.95 ms) -0.2ms (0.2%) 👌
table-update-10th-1k metric base(97bb075) target(a5caacb) trend
benchmark-table/update-10th/1k duration 77.00 (±2.65 ms) 78.00 (±2.55 ms) +1.0ms (1.3%) 👌
tablecmp-append-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-component/append/1k duration 247.90 (±16.40 ms) 256.00 (±8.25 ms) +8.1ms (3.3%) 👎
tablecmp-clear-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-component/clear/1k duration 11.30 (±1.35 ms) 12.25 (±1.65 ms) +0.9ms (8.4%) 👌
tablecmp-create-10k metric base(97bb075) target(a5caacb) trend
benchmark-table-component/create/10k duration 1701.95 (±13.70 ms) 1712.30 (±12.30 ms) +10.4ms (0.6%) 👎
tablecmp-create-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-component/create/1k duration 206.90 (±4.85 ms) 211.25 (±5.35 ms) +4.3ms (2.1%) 👎
tablecmp-update-10th-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-component/update-10th/1k duration 70.50 (±5.25 ms) 70.85 (±4.30 ms) +0.3ms (0.5%) 👌
wc-append-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-wc/append/1k duration 251.40 (±11.10 ms) 254.70 (±10.85 ms) +3.3ms (1.3%) 👌
wc-clear-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-wc/clear/1k duration 21.35 (±2.50 ms) 23.10 (±2.80 ms) +1.8ms (8.2%) 👎
wc-create-10k metric base(97bb075) target(a5caacb) trend
benchmark-table-wc/create/10k duration 1817.55 (±50.80 ms) 1833.65 (±38.80 ms) +16.1ms (0.9%) 👌
wc-create-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-wc/create/1k duration 224.20 (±4.70 ms) 223.85 (±3.50 ms) -0.3ms (0.2%) 👌
wc-update-10th-1k metric base(97bb075) target(a5caacb) trend
benchmark-table-wc/update-10th/1k duration 72.85 (±6.45 ms) 72.95 (±6.55 ms) +0.1ms (0.1%) 👌

Copy link
Contributor

@davidturissini davidturissini left a comment

Choose a reason for hiding this comment

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

Confirmed, srcElement is retargeted

@pmdartus
Copy link
Member

@caridy Don't we need tests for this?

@caridy caridy force-pushed the caridy/event-retargeting-compleition branch from a5caacb to d5886a1 Compare November 27, 2018 20:14
@caridy
Copy link
Contributor Author

caridy commented Nov 27, 2018

@pmdartus added the tests.
@diervo rebased.

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6a20ae0 | Target commit: d5886a1

lwc-engine-benchmark

table-append-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/append/1k duration 150.35 (±4.20 ms) 149.15 (±3.50 ms) -1.2ms (0.8%) 👌
table-clear-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/clear/1k duration 6.20 (±0.50 ms) 6.20 (±0.45 ms) 0.0ms (0.0%) 👌
table-create-10k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/create/10k duration 875.00 (±6.00 ms) 891.45 (±6.85 ms) +16.5ms (1.9%) 👎
table-create-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/create/1k duration 116.00 (±3.35 ms) 119.85 (±3.70 ms) +3.8ms (3.3%) 👎
table-update-10th-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/update-10th/1k duration 76.45 (±2.20 ms) 76.80 (±1.80 ms) +0.4ms (0.5%) 👌
tablecmp-append-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/append/1k duration 247.95 (±10.65 ms) 252.70 (±9.45 ms) +4.8ms (1.9%) 👎
tablecmp-clear-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/clear/1k duration 11.75 (±1.95 ms) 12.50 (±1.70 ms) +0.8ms (6.4%) 👌
tablecmp-create-10k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/create/10k duration 1725.55 (±11.75 ms) 1715.65 (±11.45 ms) -9.9ms (0.6%) 👍
tablecmp-create-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/create/1k duration 204.80 (±6.00 ms) 209.10 (±5.85 ms) +4.3ms (2.1%) 👌
tablecmp-update-10th-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/update-10th/1k duration 72.60 (±4.75 ms) 72.50 (±5.85 ms) -0.1ms (0.1%) 👌
wc-append-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/append/1k duration 253.35 (±7.40 ms) 258.00 (±8.10 ms) +4.7ms (1.8%) 👎
wc-clear-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/clear/1k duration 21.35 (±1.95 ms) 22.60 (±2.30 ms) +1.3ms (5.9%) 👌
wc-create-10k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/create/10k duration 1831.60 (±60.35 ms) 1836.50 (±34.05 ms) +4.9ms (0.3%) 👌
wc-create-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/create/1k duration 223.25 (±4.60 ms) 228.30 (±6.25 ms) +5.1ms (2.3%) 👎
wc-update-10th-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/update-10th/1k duration 72.60 (±6.05 ms) 70.55 (±4.10 ms) -2.0ms (2.8%) 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6a20ae0 | Target commit: d5886a1

lwc-engine-benchmark

table-append-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/append/1k duration 150.35 (±4.20 ms) 151.60 (±4.30 ms) +1.2ms (0.8%) 👌
table-clear-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/clear/1k duration 6.20 (±0.50 ms) 6.40 (±0.50 ms) +0.2ms (3.2%) 👌
table-create-10k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/create/10k duration 875.00 (±6.00 ms) 884.10 (±7.40 ms) +9.1ms (1.0%) 👎
table-create-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/create/1k duration 116.00 (±3.35 ms) 117.85 (±3.35 ms) +1.8ms (1.6%) 👎
table-update-10th-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table/update-10th/1k duration 76.45 (±2.20 ms) 84.50 (±6.30 ms) +8.0ms (10.5%) 👎
tablecmp-append-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/append/1k duration 247.95 (±10.65 ms) 253.00 (±5.20 ms) +5.1ms (2.0%) 👎
tablecmp-clear-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/clear/1k duration 11.75 (±1.95 ms) 13.10 (±1.70 ms) +1.3ms (11.5%) 👎
tablecmp-create-10k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/create/10k duration 1725.55 (±11.75 ms) 1712.45 (±11.90 ms) -13.1ms (0.8%) 👍
tablecmp-create-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/create/1k duration 204.80 (±6.00 ms) 211.95 (±6.00 ms) +7.1ms (3.5%) 👎
tablecmp-update-10th-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-component/update-10th/1k duration 72.60 (±4.75 ms) 73.05 (±5.95 ms) +0.5ms (0.6%) 👌
wc-append-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/append/1k duration 253.35 (±7.40 ms) 259.95 (±9.65 ms) +6.6ms (2.6%) 👌
wc-clear-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/clear/1k duration 21.35 (±1.95 ms) 23.60 (±2.45 ms) +2.3ms (10.5%) 👎
wc-create-10k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/create/10k duration 1831.60 (±60.35 ms) 1869.05 (±35.40 ms) +37.5ms (2.0%) 👎
wc-create-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/create/1k duration 223.25 (±4.60 ms) 225.65 (±5.45 ms) +2.4ms (1.1%) 👌
wc-update-10th-1k metric base(6a20ae0) target(d5886a1) trend
benchmark-table-wc/update-10th/1k duration 72.60 (±6.05 ms) 74.20 (±4.25 ms) +1.6ms (2.2%) 👌

@diervo diervo added the nomerge label Dec 14, 2018
@caridy
Copy link
Contributor Author

caridy commented Jan 2, 2019

@ravijayaramappa let's validate what locker does for srcElement and path property, and the composedPath() method. If locker can protect us until 220, then we should do that.

Note: srcElement is just an alias of target.

@ravijayaramappa
Copy link
Contributor

ravijayaramappa commented Jan 2, 2019

Under locker,

  1. srcElement

    • Property is exposed
    • The raw value is filtered to apply namespace rules and then wrapped in a SecureElement
    • Customers could be using it. Higher chance of a regression if locker blocks it without notice.
  2. path

    • Property is exposed
    • The raw array is wrapped in a proxy. On access, array values are filtered to apply namespace rules and either wrapped in a SecureElement or an opaque(no properties) object
    • This one should be low risk to block in locker. Since this is a non-standard property, chances of a customer regression is low.
    • User story for Locker to assess this property W-5694860
  3. composedPath()

    • Property is exposed but has never worked as expected. It does not work because the property is exposed incorrectly.
    • This one should be low risk to block in locker because it has never worked. So chances of customer regression is very low. There might be customers who have sniffing if a such a property exists on an event, but nothing beyond that.
    • User story for Locker to assess this property W-5694762

@caridy caridy added this to the 220 milestone Jan 7, 2019
@caridy
Copy link
Contributor Author

caridy commented Jan 7, 2019

locker will protect us for now, until we can clean this up.

@caridy caridy force-pushed the caridy/event-retargeting-compleition branch from d5886a1 to 6244d1c Compare January 17, 2019 19:28
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6eb7eda | Target commit: 6244d1c

lwc-engine-benchmark

table-append-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table/append/1k duration 155.60 (±5.65 ms) 152.35 (±5.00 ms) -3.3ms (2.1%) 👌
table-clear-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table/clear/1k duration 6.25 (±0.40 ms) 6.30 (±0.40 ms) +0.0ms (0.8%) 👌
table-create-10k metric base(6eb7eda) target(6244d1c) trend
benchmark-table/create/10k duration 931.65 (±5.60 ms) 917.85 (±7.20 ms) -13.8ms (1.5%) 👍
table-create-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table/create/1k duration 120.80 (±3.05 ms) 121.60 (±2.90 ms) +0.8ms (0.7%) 👌
table-update-10th-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table/update-10th/1k duration 77.15 (±3.00 ms) 88.45 (±2.00 ms) +11.3ms (14.6%) 👎
tablecmp-append-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-component/append/1k duration 257.45 (±8.40 ms) 256.10 (±7.45 ms) -1.4ms (0.5%) 👌
tablecmp-clear-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-component/clear/1k duration 12.35 (±1.55 ms) 12.10 (±1.65 ms) -0.3ms (2.0%) 👌
tablecmp-create-10k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-component/create/10k duration 1781.45 (±18.20 ms) 1763.25 (±24.05 ms) -18.2ms (1.0%) 👍
tablecmp-create-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-component/create/1k duration 214.60 (±4.70 ms) 209.35 (±5.05 ms) -5.2ms (2.4%) 👌
tablecmp-update-10th-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-component/update-10th/1k duration 72.40 (±5.05 ms) 69.90 (±3.55 ms) -2.5ms (3.5%) 👌
wc-append-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-wc/append/1k duration 261.80 (±5.55 ms) 259.45 (±5.05 ms) -2.3ms (0.9%) 👌
wc-clear-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-wc/clear/1k duration 23.10 (±2.30 ms) 23.15 (±2.20 ms) +0.0ms (0.2%) 👌
wc-create-10k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-wc/create/10k duration 2011.55 (±10.45 ms) 1993.05 (±10.90 ms) -18.5ms (0.9%) 👍
wc-create-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-wc/create/1k duration 229.15 (±5.10 ms) 221.70 (±3.70 ms) -7.4ms (3.3%) 👍
wc-update-10th-1k metric base(6eb7eda) target(6244d1c) trend
benchmark-table-wc/update-10th/1k duration 73.20 (±4.50 ms) 74.20 (±5.00 ms) +1.0ms (1.4%) 👌

@caridy caridy removed the nomerge label Jan 17, 2019
@caridy
Copy link
Contributor Author

caridy commented Jan 18, 2019

validated that the failures in compat are flappers, merging!

@caridy caridy merged commit c415ece into master Jan 18, 2019
@caridy caridy deleted the caridy/event-retargeting-compleition branch January 18, 2019 20:22
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 5c16e22 | Target commit: 6244d1c

lwc-engine-benchmark

table-append-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table/append/1k duration 149.20 (±5.05 ms) 148.75 (±4.60 ms) -0.4ms (0.3%) 👌
table-clear-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table/clear/1k duration 5.70 (±0.40 ms) 6.30 (±0.45 ms) +0.6ms (10.5%) 👎
table-create-10k metric base(5c16e22) target(6244d1c) trend
benchmark-table/create/10k duration 865.20 (±9.75 ms) 907.70 (±6.60 ms) +42.5ms (4.9%) 👎
table-create-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table/create/1k duration 116.75 (±3.35 ms) 119.75 (±2.75 ms) +3.0ms (2.6%) 👎
table-update-10th-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table/update-10th/1k duration 85.20 (±2.25 ms) 76.40 (±2.60 ms) -8.8ms (10.3%) 👍
tablecmp-append-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-component/append/1k duration 220.45 (±14.35 ms) 250.55 (±7.65 ms) +30.1ms (13.7%) 👎
tablecmp-clear-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-component/clear/1k duration 12.25 (±1.95 ms) 11.95 (±1.70 ms) -0.3ms (2.4%) 👌
tablecmp-create-10k metric base(5c16e22) target(6244d1c) trend
benchmark-table-component/create/10k duration 1759.20 (±15.00 ms) 1771.65 (±18.70 ms) +12.5ms (0.7%) 👎
tablecmp-create-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-component/create/1k duration 208.60 (±5.85 ms) 209.75 (±5.95 ms) +1.2ms (0.6%) 👌
tablecmp-update-10th-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-component/update-10th/1k duration 69.90 (±4.85 ms) 72.00 (±6.30 ms) +2.1ms (3.0%) 👌
wc-append-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-wc/append/1k duration 256.70 (±6.15 ms) 254.60 (±5.85 ms) -2.1ms (0.8%) 👌
wc-clear-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-wc/clear/1k duration 21.65 (±2.15 ms) 21.50 (±3.15 ms) -0.1ms (0.7%) 👌
wc-create-10k metric base(5c16e22) target(6244d1c) trend
benchmark-table-wc/create/10k duration 1980.10 (±12.80 ms) 1994.20 (±9.85 ms) +14.1ms (0.7%) 👎
wc-create-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-wc/create/1k duration 221.50 (±5.25 ms) 222.55 (±4.60 ms) +1.1ms (0.5%) 👌
wc-update-10th-1k metric base(5c16e22) target(6244d1c) trend
benchmark-table-wc/update-10th/1k duration 68.55 (±4.35 ms) 70.95 (±5.70 ms) +2.4ms (3.5%) 👌

ravijayaramappa pushed a commit that referenced this pull request Jan 21, 2019
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.

5 participants