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

feat: Add support for locators #701

Merged
merged 5 commits into from
Oct 23, 2018
Merged

feat: Add support for locators #701

merged 5 commits into from
Oct 23, 2018

Conversation

tariqrafique
Copy link
Contributor

Add support to the compiler and engine for locators.

Details

See the locators.md proposal in the file list for this PR.

Does this PR introduce a breaking change?

  • Yes
  • No

*/
var locatorDetail = e.detail;
var target = locatorDetail.target;
var host = locatorDetail.host;
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this?

}
*/
var locatorDetail = e.detail;
var target = locatorDetail.target;
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this? how is this different from e.target?

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

I'm not supportive of this! I think we need to get back to the whiteboard here. There are many things that I don't like, it feels to me that this is the wrong abstraction.

const host: Element = component[ViewModelReflection].elm as Element;
const locatorEvent = new CustomEvent('LWCLocator', {
bubbles: false,
detail: {
Copy link
Contributor

Choose a reason for hiding this comment

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

detail should contain only strings. extract that information from the vm that owns the currentTarget.


return function(event: Event) {
try {
const target: Element = event.currentTarget as Element;
Copy link
Contributor

Choose a reason for hiding this comment

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

this currentTarget should be extracted using a getter, can't use the dot notation.

Copy link
Contributor Author

@tariqrafique tariqrafique Oct 3, 2018

Choose a reason for hiding this comment

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

How do I get the VNode for the target element here ?

@@ -39,8 +39,8 @@ describe('fixtures', () => {
const src = readFixtureFile('actual.html');

const configOverride = JSON.parse(readFixtureFile('config.json'));
const expectedCode = readFixtureFile(expectedJsFile);
const expectedMetaData = JSON.parse(readFixtureFile(expectedMetaFile));
let expectedCode = readFixtureFile(expectedJsFile);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are mutated in the case where the expected js and metadata files don't exists. May as well let the test run properly and use the same value for these thats being written to file

}

if (expectedMetaData === null) {
// write metadata file if doesn't exist (ie new fixture)
const metadata = {
warnings: actual.warnings,
...actualMeta,
metadata: {...actualMeta},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was actually busted. the file would not be correctly written out

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 7db6d74 | Target commit: 4efe5b9

lwc-engine-benchmark

table-append-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table/append/1k duration 155.15 (±6.10 ms) 155.75 (±6.90 ms) +0.6ms (0.4%) 👌
table-clear-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table/clear/1k duration 12.25 (±0.80 ms) 12.40 (±0.70 ms) +0.2ms (1.2%) 👌
table-create-10k metric base(7db6d74) target(4efe5b9) trend
benchmark-table/create/10k duration 872.80 (±8.45 ms) 898.70 (±5.95 ms) +25.9ms (3.0%) 👎
table-create-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table/create/1k duration 109.70 (±2.05 ms) 110.10 (±2.65 ms) +0.4ms (0.4%) 👌
table-update-10th-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table/update-10th/1k duration 84.40 (±1.70 ms) 84.20 (±1.60 ms) -0.2ms (0.2%) 👌
tablecmp-append-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-component/append/1k duration 204.50 (±12.40 ms) 213.40 (±13.40 ms) +8.9ms (4.4%) 👎
tablecmp-clear-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-component/clear/1k duration 20.85 (±2.20 ms) 18.70 (±1.90 ms) -2.1ms (10.3%) 👍
tablecmp-create-10k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-component/create/10k duration 1605.00 (±12.80 ms) 1645.85 (±10.75 ms) +40.8ms (2.5%) 👎
tablecmp-create-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-component/create/1k duration 185.05 (±5.90 ms) 185.20 (±3.85 ms) +0.1ms (0.1%) 👌
tablecmp-update-10th-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-component/update-10th/1k duration 79.60 (±5.35 ms) 82.05 (±5.45 ms) +2.5ms (3.1%) 👌
wc-append-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-wc/append/1k duration 274.55 (±15.45 ms) 270.00 (±17.50 ms) -4.5ms (1.7%) 👌
wc-clear-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-wc/clear/1k duration 29.30 (±2.55 ms) 28.55 (±2.20 ms) -0.8ms (2.6%) 👌
wc-create-10k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-wc/create/10k duration 2052.25 (±10.75 ms) 2020.10 (±14.55 ms) -32.2ms (1.6%) 👍
wc-create-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-wc/create/1k duration 223.55 (±5.40 ms) 219.60 (±4.00 ms) -4.0ms (1.8%) 👍
wc-update-10th-1k metric base(7db6d74) target(4efe5b9) trend
benchmark-table-wc/update-10th/1k duration 84.70 (±5.65 ms) 81.00 (±5.55 ms) -3.7ms (4.4%) 👌

@@ -0,0 +1,349 @@
# RFC: Locators
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I still need to update the RFC. Please focus on changes to the compiler and engine and test cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

@tariq-sfdc if you don't have time to finish this today/tomorrow, then remove it from the PR, and make another PR just for the RFC, no rush.

@@ -17,6 +18,8 @@ export interface RenderAPI {
p(text: string): VComment;
d(value: any): VNode | null;
b(fn: EventListener): EventListener;
fb(fn: () => any): () => any;
ll(fn: EventListener): EventListener;
Copy link
Contributor

Choose a reason for hiding this comment

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

signature does not correspond to the implementation.

@@ -438,6 +441,53 @@ export function b(fn: EventListener): EventListener {
};
}

// [f]unction_[b]ind
export function fb(fn: () => any): () => any {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is what we need. What we need is just a regular binding mechanism where you pass the obj and the fn to be bound, and this method does the trick. Imagine something like this: <button locator:context={foo.bar}>, in that case, bar method must be called with the this value set to $cmp.foo. Keep in mind that invokeComponentCallback is for callbacks, e.g.: connectedCallback, etc, it is not for common functions like locator:context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so looking at what the click event handler does is api_bind and cmp is set as the context. Is that intended behavior ?

if todoItem is the iteration index and todoItem.handleClick was the event handler attached to a todo item, then when the click handler executes (no locators), the this context is set to the component. You don't get access to the this which is the todo items

So we're saying that for locator:provider it's going to be different ?

Copy link
Contributor

Choose a reason for hiding this comment

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

a context provider is not an event handler. api.b is equivalent to elm.addEventListener('click', foo.bar), in which case the context is still the element. In your case, it is not an event handler, it is just a function call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it.

So if we have {x.y.z}, then we first find to $cmp if we need to or if it's inside an iteration then that remains unchanged.
Then from the resulting expression, the this context should be everything just before .z ?

Is there anything that already in codegen that can help extract this ?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, that's it.

no, I don't know.

locator.resolved = {
target: id,
host: locator.id,
targetProvider: isFunction(provider) && invokeComponentCallback(vm, provider),
Copy link
Contributor

Choose a reason for hiding this comment

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

here is should just call provider(). when is provider supposed to be a non-function? in the method signature, it says it must be a function, why the test?

target: id,
host: locator.id,
targetProvider: isFunction(provider) && invokeComponentCallback(vm, provider),
hostProvider: isFunction(locator.provider) && locator.provider()
Copy link
Contributor

Choose a reason for hiding this comment

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

locator.provider.call() otherwise you might be leaking information as a this value.

Copy link
Contributor

Choose a reason for hiding this comment

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

when locator.provider will not be a function? if locator exists, how is the provider not provided?

const interaction = {
target: target,
scope: host,
context: Object.assign(targetProvider || {}, hostProvider)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this work could be done in the layer above inside ll

scope: host,
context: Object.assign(targetProvider || {}, hostProvider)
};
console.log("interaction", interaction);
Copy link
Contributor

Choose a reason for hiding this comment

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

???

($ctx._m1 = locator_listener_bind(
$cmp.handleClick,
"button-in-slot",
$cmp.locatorProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

remember that this one should also be bounded via function_bind, something like function_bind($cmp, $cmp.locatorProvider)

locator: {
id: "button-in-slot",
provider:
_m0 || ($ctx._m0 = function_bind($cmp.locatorProvider))
Copy link
Contributor

Choose a reason for hiding this comment

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

function_bind($cmp, $cmp.locatorProvider) should be the proper process to bind the method.

Copy link
Contributor

Choose a reason for hiding this comment

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

make sure that it also work for deep obj as a provider, e.g: function_bind($cmp.foo, $cmp.foo.bar)

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

few things to be adjusted

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: ec359c0 | Target commit: fd21c35

lwc-engine-benchmark

table-append-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table/append/1k duration 156.10 (±5.40 ms) 152.60 (±6.05 ms) -3.5ms (2.2%) 👍
table-clear-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table/clear/1k duration 11.95 (±0.75 ms) 11.80 (±0.90 ms) -0.1ms (1.3%) 👌
table-create-10k metric base(ec359c0) target(fd21c35) trend
benchmark-table/create/10k duration 872.90 (±5.50 ms) 865.90 (±6.20 ms) -7.0ms (0.8%) 👍
table-create-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table/create/1k duration 108.20 (±1.85 ms) 108.95 (±2.45 ms) +0.8ms (0.7%) 👌
table-update-10th-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table/update-10th/1k duration 84.20 (±1.85 ms) 84.95 (±2.35 ms) +0.8ms (0.9%) 👌
tablecmp-append-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-component/append/1k duration 208.85 (±14.35 ms) 209.75 (±13.05 ms) +0.9ms (0.4%) 👌
tablecmp-clear-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-component/clear/1k duration 18.75 (±2.55 ms) 19.20 (±2.35 ms) +0.4ms (2.4%) 👌
tablecmp-create-10k metric base(ec359c0) target(fd21c35) trend
benchmark-table-component/create/10k duration 1593.80 (±11.30 ms) 1643.05 (±8.45 ms) +49.3ms (3.1%) 👎
tablecmp-create-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-component/create/1k duration 183.10 (±5.20 ms) 182.90 (±5.05 ms) -0.2ms (0.1%) 👌
tablecmp-update-10th-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-component/update-10th/1k duration 80.60 (±5.60 ms) 81.35 (±4.90 ms) +0.8ms (0.9%) 👌
wc-append-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-wc/append/1k duration 260.95 (±16.10 ms) 275.25 (±11.90 ms) +14.3ms (5.5%) 👎
wc-clear-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-wc/clear/1k duration 28.45 (±2.50 ms) 27.55 (±2.65 ms) -0.9ms (3.2%) 👌
wc-create-10k metric base(ec359c0) target(fd21c35) trend
benchmark-table-wc/create/10k duration 2032.65 (±11.35 ms) 2069.10 (±11.35 ms) +36.4ms (1.8%) 👎
wc-create-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-wc/create/1k duration 216.15 (±4.55 ms) 222.85 (±4.80 ms) +6.7ms (3.1%) 👎
wc-update-10th-1k metric base(ec359c0) target(fd21c35) trend
benchmark-table-wc/update-10th/1k duration 79.35 (±5.55 ms) 79.15 (±6.05 ms) -0.2ms (0.3%) 👌

@salesforce salesforce deleted a comment from tariqrafique Oct 16, 2018
@@ -9,19 +9,21 @@ import { VM } from "./vm";
type ServiceCallback = (component: object, data: VNodeData, def: ComponentDef, context: Context) => void;
interface ServiceDef {
wiring?: ServiceCallback;
located?: ServiceCallback;
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably rename this to locator as well

locator.resolved = {
target : id,
host : locator.id,
targetProvider: provider && provider(),
Copy link
Contributor

Choose a reason for hiding this comment

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

isFunction(provider) ? provider() : {} maybe?

same for the following line.

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: ec359c0 | Target commit: a818a6b

lwc-engine-benchmark

table-append-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table/append/1k duration 156.10 (±5.40 ms) 153.65 (±5.40 ms) -2.5ms (1.6%) 👌
table-clear-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table/clear/1k duration 11.95 (±0.75 ms) 12.10 (±0.70 ms) +0.2ms (1.3%) 👌
table-create-10k metric base(ec359c0) target(a818a6b) trend
benchmark-table/create/10k duration 872.90 (±5.50 ms) 874.10 (±4.60 ms) +1.2ms (0.1%) 👌
table-create-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table/create/1k duration 108.20 (±1.85 ms) 109.10 (±1.50 ms) +0.9ms (0.8%) 👎
table-update-10th-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table/update-10th/1k duration 84.20 (±1.85 ms) 97.55 (±2.30 ms) +13.4ms (15.9%) 👎
tablecmp-append-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-component/append/1k duration 208.85 (±14.35 ms) 214.85 (±15.55 ms) +6.0ms (2.9%) 👌
tablecmp-clear-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-component/clear/1k duration 18.75 (±2.55 ms) 19.60 (±1.60 ms) +0.9ms (4.5%) 👎
tablecmp-create-10k metric base(ec359c0) target(a818a6b) trend
benchmark-table-component/create/10k duration 1593.80 (±11.30 ms) 1633.05 (±9.55 ms) +39.3ms (2.5%) 👎
tablecmp-create-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-component/create/1k duration 183.10 (±5.20 ms) 183.40 (±5.00 ms) +0.3ms (0.2%) 👌
tablecmp-update-10th-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-component/update-10th/1k duration 80.60 (±5.60 ms) 78.60 (±4.70 ms) -2.0ms (2.5%) 👌
wc-append-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-wc/append/1k duration 260.95 (±16.10 ms) 268.75 (±13.35 ms) +7.8ms (3.0%) 👌
wc-clear-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-wc/clear/1k duration 28.45 (±2.50 ms) 29.15 (±2.10 ms) +0.7ms (2.5%) 👌
wc-create-10k metric base(ec359c0) target(a818a6b) trend
benchmark-table-wc/create/10k duration 2032.65 (±11.35 ms) 2039.25 (±12.30 ms) +6.6ms (0.3%) 👎
wc-create-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-wc/create/1k duration 216.15 (±4.55 ms) 223.50 (±5.55 ms) +7.3ms (3.4%) 👎
wc-update-10th-1k metric base(ec359c0) target(a818a6b) trend
benchmark-table-wc/update-10th/1k duration 79.35 (±5.55 ms) 83.55 (±6.60 ms) +4.2ms (5.3%) 👎

@@ -438,6 +441,54 @@ export function b(fn: EventListener): EventListener {
};
}

// [f]unction_[b]ind
export function fb(scope: any, fn: (...args: any[]) => any): () => any {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caridy I'll remove this completely and instead use invokeComponentCallback ?

context: {
locator: {
id: "todo-item",
provider: function_bind(todo, todo.locatorProviderTodo)
Copy link
Contributor Author

@tariqrafique tariqrafique Oct 19, 2018

Choose a reason for hiding this comment

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

this will just become

    provider:api_bind(todo.locatorProviderTodo) // memorized

click: locator_listener_bind(
todo.clickHandler,
"todo-item",
function_bind(todo, todo.locatorProviderTodo)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here. it just becomes

todo.locatorProviderTodo

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: ce341b8 | Target commit: 9d79beb

lwc-engine-benchmark

table-append-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table/append/1k duration 146.90 (±3.90 ms) 147.05 (±4.25 ms) +0.2ms (0.1%) 👌
table-clear-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table/clear/1k duration 6.00 (±0.30 ms) 6.15 (±0.45 ms) +0.2ms (2.5%) 👌
table-create-10k metric base(ce341b8) target(9d79beb) trend
benchmark-table/create/10k duration 862.15 (±6.35 ms) 870.80 (±5.50 ms) +8.6ms (1.0%) 👎
table-create-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table/create/1k duration 114.05 (±3.05 ms) 116.65 (±3.15 ms) +2.6ms (2.3%) 👌
table-update-10th-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table/update-10th/1k duration 77.50 (±4.50 ms) 87.10 (±2.65 ms) +9.6ms (12.4%) 👎
tablecmp-append-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-component/append/1k duration 236.75 (±10.45 ms) 239.90 (±11.20 ms) +3.2ms (1.3%) 👌
tablecmp-clear-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-component/clear/1k duration 11.70 (±1.30 ms) 11.75 (±1.65 ms) +0.1ms (0.4%) 👌
tablecmp-create-10k metric base(ce341b8) target(9d79beb) trend
benchmark-table-component/create/10k duration 1648.65 (±10.95 ms) 1637.30 (±7.70 ms) -11.3ms (0.7%) 👍
tablecmp-create-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-component/create/1k duration 196.90 (±4.45 ms) 198.50 (±4.75 ms) +1.6ms (0.8%) 👌
tablecmp-update-10th-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-component/update-10th/1k duration 71.40 (±5.20 ms) 70.70 (±4.65 ms) -0.7ms (1.0%) 👌
wc-append-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-wc/append/1k duration 231.85 (±8.80 ms) 232.00 (±11.70 ms) +0.1ms (0.1%) 👌
wc-clear-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-wc/clear/1k duration 23.40 (±2.05 ms) 21.40 (±2.40 ms) -2.0ms (8.5%) 👌
wc-create-10k metric base(ce341b8) target(9d79beb) trend
benchmark-table-wc/create/10k duration 1665.90 (±67.30 ms) 1702.10 (±36.35 ms) +36.2ms (2.2%) 👎
wc-create-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-wc/create/1k duration 200.15 (±6.60 ms) 202.95 (±5.50 ms) +2.8ms (1.4%) 👌
wc-update-10th-1k metric base(ce341b8) target(9d79beb) trend
benchmark-table-wc/update-10th/1k duration 72.65 (±4.85 ms) 68.85 (±6.15 ms) -3.8ms (5.2%) 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: ce341b8 | Target commit: 1379096

lwc-engine-benchmark

table-append-1k metric base(ce341b8) target(1379096) trend
benchmark-table/append/1k duration 146.90 (±3.90 ms) 151.40 (±3.70 ms) +4.5ms (3.1%) 👎
table-clear-1k metric base(ce341b8) target(1379096) trend
benchmark-table/clear/1k duration 6.00 (±0.30 ms) 6.35 (±0.35 ms) +0.3ms (5.8%) 👎
table-create-10k metric base(ce341b8) target(1379096) trend
benchmark-table/create/10k duration 862.15 (±6.35 ms) 884.90 (±6.30 ms) +22.8ms (2.6%) 👎
table-create-1k metric base(ce341b8) target(1379096) trend
benchmark-table/create/1k duration 114.05 (±3.05 ms) 116.05 (±3.00 ms) +2.0ms (1.8%) 👌
table-update-10th-1k metric base(ce341b8) target(1379096) trend
benchmark-table/update-10th/1k duration 77.50 (±4.50 ms) 87.10 (±3.80 ms) +9.6ms (12.4%) 👎
tablecmp-append-1k metric base(ce341b8) target(1379096) trend
benchmark-table-component/append/1k duration 236.75 (±10.45 ms) 237.00 (±11.30 ms) +0.3ms (0.1%) 👌
tablecmp-clear-1k metric base(ce341b8) target(1379096) trend
benchmark-table-component/clear/1k duration 11.70 (±1.30 ms) 11.70 (±1.40 ms) 0.0ms (0.0%) 👌
tablecmp-create-10k metric base(ce341b8) target(1379096) trend
benchmark-table-component/create/10k duration 1648.65 (±10.95 ms) 1650.85 (±11.50 ms) +2.2ms (0.1%) 👌
tablecmp-create-1k metric base(ce341b8) target(1379096) trend
benchmark-table-component/create/1k duration 196.90 (±4.45 ms) 201.65 (±3.95 ms) +4.8ms (2.4%) 👎
tablecmp-update-10th-1k metric base(ce341b8) target(1379096) trend
benchmark-table-component/update-10th/1k duration 71.40 (±5.20 ms) 71.10 (±5.05 ms) -0.3ms (0.4%) 👌
wc-append-1k metric base(ce341b8) target(1379096) trend
benchmark-table-wc/append/1k duration 231.85 (±8.80 ms) 235.95 (±10.65 ms) +4.1ms (1.8%) 👌
wc-clear-1k metric base(ce341b8) target(1379096) trend
benchmark-table-wc/clear/1k duration 23.40 (±2.05 ms) 22.95 (±1.90 ms) -0.4ms (1.9%) 👌
wc-create-10k metric base(ce341b8) target(1379096) trend
benchmark-table-wc/create/10k duration 1665.90 (±67.30 ms) 1752.60 (±30.10 ms) +86.7ms (5.2%) 👎
wc-create-1k metric base(ce341b8) target(1379096) trend
benchmark-table-wc/create/1k duration 200.15 (±6.60 ms) 206.05 (±5.70 ms) +5.9ms (2.9%) 👎
wc-update-10th-1k metric base(ce341b8) target(1379096) trend
benchmark-table-wc/update-10th/1k duration 72.65 (±4.85 ms) 72.15 (±5.65 ms) -0.5ms (0.7%) 👌

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

minor nips, and notes... but I'm good with this.

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 3ee81d5 | Target commit: 973fdc1

lwc-engine-benchmark

table-append-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table/append/1k duration 150.25 (±3.45 ms) 151.20 (±4.60 ms) +0.9ms (0.6%) 👌
table-clear-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table/clear/1k duration 6.00 (±0.30 ms) 6.30 (±0.40 ms) +0.3ms (5.0%) 👎
table-create-10k metric base(3ee81d5) target(973fdc1) trend
benchmark-table/create/10k duration 866.90 (±6.25 ms) 877.80 (±6.95 ms) +10.9ms (1.3%) 👎
table-create-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table/create/1k duration 113.15 (±2.05 ms) 114.10 (±2.80 ms) +0.9ms (0.8%) 👌
table-update-10th-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table/update-10th/1k duration 75.55 (±1.75 ms) 86.45 (±3.55 ms) +10.9ms (14.4%) 👎
tablecmp-append-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-component/append/1k duration 229.35 (±15.25 ms) 239.10 (±13.00 ms) +9.8ms (4.3%) 👌
tablecmp-clear-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-component/clear/1k duration 11.30 (±1.60 ms) 12.75 (±1.25 ms) +1.4ms (12.8%) 👎
tablecmp-create-10k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-component/create/10k duration 1652.40 (±9.60 ms) 1661.15 (±11.80 ms) +8.8ms (0.5%) 👎
tablecmp-create-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-component/create/1k duration 195.30 (±5.00 ms) 197.40 (±5.25 ms) +2.1ms (1.1%) 👌
tablecmp-update-10th-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-component/update-10th/1k duration 73.55 (±5.50 ms) 71.20 (±6.05 ms) -2.3ms (3.2%) 👌
wc-append-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-wc/append/1k duration 224.65 (±9.75 ms) 236.65 (±9.95 ms) +12.0ms (5.3%) 👎
wc-clear-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-wc/clear/1k duration 21.05 (±2.40 ms) 20.30 (±2.40 ms) -0.8ms (3.6%) 👌
wc-create-10k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-wc/create/10k duration 1670.20 (±19.05 ms) 1698.80 (±45.40 ms) +28.6ms (1.7%) 👌
wc-create-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-wc/create/1k duration 203.00 (±4.05 ms) 204.80 (±5.15 ms) +1.8ms (0.9%) 👌
wc-update-10th-1k metric base(3ee81d5) target(973fdc1) trend
benchmark-table-wc/update-10th/1k duration 73.35 (±6.10 ms) 71.55 (±4.85 ms) -1.8ms (2.5%) 👌

Test needs to run in IE11. Use ES5 function definition style
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 3ee81d5 | Target commit: 794566d

lwc-engine-benchmark

table-append-1k metric base(3ee81d5) target(794566d) trend
benchmark-table/append/1k duration 150.25 (±3.45 ms) 149.45 (±3.85 ms) -0.8ms (0.5%) 👌
table-clear-1k metric base(3ee81d5) target(794566d) trend
benchmark-table/clear/1k duration 6.00 (±0.30 ms) 5.90 (±0.40 ms) -0.1ms (1.7%) 👌
table-create-10k metric base(3ee81d5) target(794566d) trend
benchmark-table/create/10k duration 866.90 (±6.25 ms) 876.25 (±6.45 ms) +9.4ms (1.1%) 👎
table-create-1k metric base(3ee81d5) target(794566d) trend
benchmark-table/create/1k duration 113.15 (±2.05 ms) 116.30 (±2.20 ms) +3.2ms (2.8%) 👎
table-update-10th-1k metric base(3ee81d5) target(794566d) trend
benchmark-table/update-10th/1k duration 75.55 (±1.75 ms) 77.40 (±4.80 ms) +1.9ms (2.4%) 👎
tablecmp-append-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-component/append/1k duration 229.35 (±15.25 ms) 221.85 (±16.60 ms) -7.5ms (3.3%) 👌
tablecmp-clear-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-component/clear/1k duration 11.30 (±1.60 ms) 11.35 (±1.25 ms) +0.1ms (0.4%) 👌
tablecmp-create-10k metric base(3ee81d5) target(794566d) trend
benchmark-table-component/create/10k duration 1652.40 (±9.60 ms) 1658.75 (±9.60 ms) +6.3ms (0.4%) 👎
tablecmp-create-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-component/create/1k duration 195.30 (±5.00 ms) 197.50 (±5.70 ms) +2.2ms (1.1%) 👌
tablecmp-update-10th-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-component/update-10th/1k duration 73.55 (±5.50 ms) 69.90 (±5.05 ms) -3.6ms (5.0%) 👌
wc-append-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-wc/append/1k duration 224.65 (±9.75 ms) 232.55 (±8.35 ms) +7.9ms (3.5%) 👎
wc-clear-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-wc/clear/1k duration 21.05 (±2.40 ms) 22.15 (±2.10 ms) +1.1ms (5.2%) 👎
wc-create-10k metric base(3ee81d5) target(794566d) trend
benchmark-table-wc/create/10k duration 1670.20 (±19.05 ms) 1695.85 (±43.65 ms) +25.7ms (1.5%) 👎
wc-create-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-wc/create/1k duration 203.00 (±4.05 ms) 205.10 (±5.05 ms) +2.1ms (1.0%) 👌
wc-update-10th-1k metric base(3ee81d5) target(794566d) trend
benchmark-table-wc/update-10th/1k duration 73.35 (±6.10 ms) 70.85 (±4.65 ms) -2.5ms (3.4%) 👌

@caridy
Copy link
Contributor

caridy commented Oct 23, 2018

@tariq-sfdc thanks a lot of all the work. Let's get this merge today.

@diervo diervo merged commit 464daf4 into salesforce:master Oct 23, 2018
@tariqrafique tariqrafique deleted the locators-218 branch August 28, 2019 22:31
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.

3 participants