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

refactor(engine): making aria properties a DOM polyfill #438

Merged

Conversation

caridy
Copy link
Contributor

@caridy caridy commented Jun 22, 2018

NOTE: this PR seats on top of #432

This refactor uses getShadowRootHost(shadowRoot) and getNodeKey(customElement), when dealing with aria properties. These 2 APIs are sufficient to apply the AOM logic without having to know anything about the internals of the engine.

Details

  • reworked aom.ts into src/polyfills/aria-properties/polyfill.ts
  • attribute.ts is about attributes, it has no more runtime logic on it
  • framework code and dom code does not know much about aria props other than their name.

Does this PR introduce a breaking change?

  • No

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 9581620 | Target commit: a8039e3

lwc-engine-benchmark

table-append-1k metric base(9581620) target(a8039e3) trend
benchmark-table/append/1k duration 153.50 (± 6.30 ms) 152.60 (± 2.60 ms) 0.59% 👌
table-clear-1k metric base(9581620) target(a8039e3) trend
benchmark-table/clear/1k duration 11.75 (± 0.55 ms) 12.00 (± 0.50 ms) -2.13% 👌
table-create-10k metric base(9581620) target(a8039e3) trend
benchmark-table/create/10k duration 895.60 (± 5.60 ms) 954.70 (± 7.40 ms) -6.60% 👎
table-create-1k metric base(9581620) target(a8039e3) trend
benchmark-table/create/1k duration 101.80 (± 2.00 ms) 108.00 (± 1.90 ms) -6.09% 👎
table-update-10th-1k metric base(9581620) target(a8039e3) trend
benchmark-table/update-10th/1k duration 92.40 (± 4.70 ms) 91.00 (± 5.50 ms) 1.52% 👌
tablecmp-append-1k metric base(9581620) target(a8039e3) trend
benchmark-table-component/append/1k duration 261.40 (± 4.80 ms) 267.35 (± 3.90 ms) -2.28% 👎
tablecmp-clear-1k metric base(9581620) target(a8039e3) trend
benchmark-table/clear/1k duration 36.80 (± 1.20 ms) 37.70 (± 1.90 ms) -2.45% 👎
tablecmp-create-10k metric base(9581620) target(a8039e3) trend
benchmark-table-component/create/10k duration 1809.50 (± 18.70 ms) 1933.40 (± 10.70 ms) -6.85% 👎
tablecmp-create-1k metric base(9581620) target(a8039e3) trend
benchmark-table-component/create/1k duration 201.90 (± 4.40 ms) 214.10 (± 4.70 ms) -6.04% 👎
tablecmp-update-10th-1k metric base(9581620) target(a8039e3) trend
benchmark-table-component/update-10th/1k duration 75.40 (± 4.50 ms) 79.50 (± 6.20 ms) -5.44% 👎

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 9581620 | Target commit: 468ec5a

lwc-engine-benchmark

table-append-1k metric base(9581620) target(468ec5a) trend
benchmark-table/append/1k duration 153.50 (± 6.30 ms) 156.90 (± 4.60 ms) -2.21% 👎
table-clear-1k metric base(9581620) target(468ec5a) trend
benchmark-table/clear/1k duration 11.75 (± 0.55 ms) 12.20 (± 0.60 ms) -3.83% 👌
table-create-10k metric base(9581620) target(468ec5a) trend
benchmark-table/create/10k duration 895.60 (± 5.60 ms) 924.20 (± 7.00 ms) -3.19% 👎
table-create-1k metric base(9581620) target(468ec5a) trend
benchmark-table/create/1k duration 101.80 (± 2.00 ms) 109.30 (± 2.90 ms) -7.37% 👎
table-update-10th-1k metric base(9581620) target(468ec5a) trend
benchmark-table/update-10th/1k duration 92.40 (± 4.70 ms) 89.80 (± 3.90 ms) 2.81% 👌
tablecmp-append-1k metric base(9581620) target(468ec5a) trend
benchmark-table-component/append/1k duration 261.40 (± 4.80 ms) 262.40 (± 3.70 ms) -0.38% 👌
tablecmp-clear-1k metric base(9581620) target(468ec5a) trend
benchmark-table/clear/1k duration 36.80 (± 1.20 ms) 36.60 (± 2.30 ms) 0.54% 👌
tablecmp-create-10k metric base(9581620) target(468ec5a) trend
benchmark-table-component/create/10k duration 1809.50 (± 18.70 ms) 1866.30 (± 7.70 ms) -3.14% 👎
tablecmp-create-1k metric base(9581620) target(468ec5a) trend
benchmark-table-component/create/1k duration 201.90 (± 4.40 ms) 208.00 (± 4.20 ms) -3.02% 👎
tablecmp-update-10th-1k metric base(9581620) target(468ec5a) trend
benchmark-table-component/update-10th/1k duration 75.40 (± 4.50 ms) 79.50 (± 5.90 ms) -5.44% 👎

@caridy caridy force-pushed the caridy/faux-shadow-refactor-aom branch from 468ec5a to 0008c1c Compare June 26, 2018 14:23
@caridy caridy force-pushed the caridy/faux-shadow-refactor-events branch 2 times, most recently from 5759aae to dcd991e Compare June 26, 2018 14:29
@caridy caridy force-pushed the caridy/faux-shadow-refactor-aom branch from 0008c1c to 65d7fb7 Compare June 26, 2018 14:30
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 773ce87 | Target commit: 0008c1c

lwc-engine-benchmark

table-append-1k metric base(773ce87) target(0008c1c) trend
benchmark-table/append/1k duration 153.70 (± 5.50 ms) 163.10 (± 3.60 ms) -6.12% 👎
table-clear-1k metric base(773ce87) target(0008c1c) trend
benchmark-table/clear/1k duration 12.20 (± 0.40 ms) 12.30 (± 0.50 ms) -0.82% 👌
table-create-10k metric base(773ce87) target(0008c1c) trend
benchmark-table/create/10k duration 879.70 (± 4.15 ms) 940.10 (± 5.70 ms) -6.87% 👎
table-create-1k metric base(773ce87) target(0008c1c) trend
benchmark-table/create/1k duration 104.60 (± 2.20 ms) 109.50 (± 1.75 ms) -4.68% 👎
table-update-10th-1k metric base(773ce87) target(0008c1c) trend
benchmark-table/update-10th/1k duration 90.30 (± 4.70 ms) 91.00 (± 5.50 ms) -0.78% 👌
tablecmp-append-1k metric base(773ce87) target(0008c1c) trend
benchmark-table-component/append/1k duration 263.60 (± 4.70 ms) 262.90 (± 4.50 ms) 0.27% 👌
tablecmp-clear-1k metric base(773ce87) target(0008c1c) trend
benchmark-table/clear/1k duration 38.60 (± 1.40 ms) 37.50 (± 2.20 ms) 2.85% 👍
tablecmp-create-10k metric base(773ce87) target(0008c1c) trend
benchmark-table-component/create/10k duration 1798.10 (± 11.60 ms) 1860.00 (± 10.60 ms) -3.44% 👎
tablecmp-create-1k metric base(773ce87) target(0008c1c) trend
benchmark-table-component/create/1k duration 201.25 (± 4.45 ms) 207.50 (± 4.50 ms) -3.11% 👎
tablecmp-update-10th-1k metric base(773ce87) target(0008c1c) trend
benchmark-table-component/update-10th/1k duration 75.30 (± 5.20 ms) 78.70 (± 5.80 ms) -4.52% 👎

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 773ce87 | Target commit: 65d7fb7

lwc-engine-benchmark

table-append-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table/append/1k duration 153.70 (± 5.50 ms) 163.40 (± 3.50 ms) -6.31% 👎
table-clear-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table/clear/1k duration 12.20 (± 0.40 ms) 12.70 (± 0.80 ms) -4.10% 👎
table-create-10k metric base(773ce87) target(65d7fb7) trend
benchmark-table/create/10k duration 879.70 (± 4.15 ms) 946.10 (± 5.60 ms) -7.55% 👎
table-create-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table/create/1k duration 104.60 (± 2.20 ms) 111.60 (± 1.90 ms) -6.69% 👎
table-update-10th-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table/update-10th/1k duration 90.30 (± 4.70 ms) 89.40 (± 4.80 ms) 1.00% 👌
tablecmp-append-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table-component/append/1k duration 263.60 (± 4.70 ms) 268.20 (± 6.30 ms) -1.75% 👎
tablecmp-clear-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table/clear/1k duration 38.60 (± 1.40 ms) 38.60 (± 1.50 ms) 0.00% 👌
tablecmp-create-10k metric base(773ce87) target(65d7fb7) trend
benchmark-table-component/create/10k duration 1798.10 (± 11.60 ms) 1919.50 (± 8.60 ms) -6.75% 👎
tablecmp-create-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table-component/create/1k duration 201.25 (± 4.45 ms) 210.00 (± 4.50 ms) -4.35% 👎
tablecmp-update-10th-1k metric base(773ce87) target(65d7fb7) trend
benchmark-table-component/update-10th/1k duration 75.30 (± 5.20 ms) 77.95 (± 4.70 ms) -3.52% 👌

@caridy caridy merged commit 7caddb7 into caridy/faux-shadow-refactor-events Jun 27, 2018
caridy added a commit that referenced this pull request Jun 27, 2018
* refactor(engine): events do not need access to vm details
* fix(engine): patching template event in the right place
* refactor(engine): internal fields and symbols consolidation
* fix(engine): proxy issues and perf optimizations
* refactor(engine): making aria properties a DOM polyfill (#438)
caridy added a commit that referenced this pull request Jun 28, 2018
* refactor(engine): events do not need access to vm details
* fix(engine): patching template event in the right place
* refactor(engine): internal fields and symbols consolidation
* fix(engine): proxy issues and perf optimizations
* refactor(engine): making aria properties a DOM polyfill (#438)
caridy added a commit that referenced this pull request Jun 29, 2018
* refactor(engine): faux-shadow separation
* refactor(engine): events do not need access to vm details (#432)
* fix(engine): patching template event in the right place
* refactor(engine): internal fields and symbols consolidation
* fix(engine): proxy issues and perf optimizations
* refactor(engine): making aria properties a DOM polyfill (#438)
* fix(engine): parentElement on top level shadow element returns null
@diervo diervo deleted the caridy/faux-shadow-refactor-aom branch July 19, 2018 02:16
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