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): identify LWC console logs #674

Merged
merged 1 commit into from
Sep 28, 2018

Conversation

jodarove
Copy link
Contributor

@jodarove jodarove commented Sep 25, 2018

Details

Adds [LWC err/warn] prefix in assert.logError and assert.logWarning to clearly identify LWC's console logs

Does this PR introduce a breaking change?

  • Yes
  • No

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 fine with this but:

  • there are test failures
  • LWC is a brand that is not ready to be public, adding this to the logs mean that people will start asking about LWC even though they are only using Aura on their end. /cc @diervo

@@ -67,7 +67,7 @@ const assert = {
throw new Error(msg);
},
logError(message: string, elm: Element | null) {
Copy link
Member

Choose a reason for hiding this comment

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

Change type of the logError and logWarning function to be undefined instead of null:

function logWarning(message: string, elm?: Element) {}

Copy link
Member

Choose a reason for hiding this comment

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

I did a quick code search in the engine to make sure we are not missing any error message, there is still console.error in def.ts. Can you make the change and add it to this PR?

@@ -67,7 +67,7 @@ const assert = {
throw new Error(msg);
},
logError(message: string, elm: Element | null) {
let msg = message;
let msg = `[LWC err]: ${message}`;
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about using error and warning there, instead of the shorthand?

@jodarove jodarove force-pushed the jodarove/add-header-to-console-logs branch from 72f857f to 4a54e71 Compare September 26, 2018 16:00
Copy link
Contributor

@diervo diervo left a comment

Choose a reason for hiding this comment

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

Talked to @pmdartus we are fine with this PR.
Given that in 218 when this goes live LWC will be life this is ok.

@jodarove jodarove force-pushed the jodarove/add-header-to-console-logs branch 2 times, most recently from c6f58c5 to b1a34f9 Compare September 27, 2018 16:17
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: cc705d0 | Target commit: a3c9a5b

lwc-engine-benchmark

table-append-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/append/1k duration 159.00 (±7.10 ms) 154.80 (±5.40 ms) -4.2ms (2.6%) 👍
table-clear-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/clear/1k duration 12.30 (±0.95 ms) 12.05 (±0.75 ms) -0.3ms (2.0%) 👍
table-create-10k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/create/10k duration 936.80 (±9.55 ms) 953.05 (±7.30 ms) +16.3ms (1.7%) 👎
table-create-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/create/1k duration 110.20 (±1.80 ms) 110.30 (±2.65 ms) +0.1ms (0.1%) 👌
table-update-10th-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/update-10th/1k duration 98.60 (±3.55 ms) 85.65 (±2.85 ms) -12.9ms (13.1%) 👍
tablecmp-append-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/append/1k duration 239.50 (±7.20 ms) 230.65 (±16.50 ms) -8.8ms (3.7%) 👍
tablecmp-clear-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/clear/1k duration 20.15 (±2.05 ms) 20.50 (±2.20 ms) +0.4ms (1.7%) 👌
tablecmp-create-10k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/create/10k duration 1670.65 (±14.25 ms) 1677.55 (±18.05 ms) +6.9ms (0.4%) 👌
tablecmp-create-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/create/1k duration 190.40 (±6.60 ms) 181.10 (±6.75 ms) -9.3ms (4.9%) 👍
tablecmp-update-10th-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/update-10th/1k duration 83.70 (±5.50 ms) 84.55 (±5.20 ms) +0.9ms (1.0%) 👌
wc-append-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/append/1k duration 277.30 (±13.50 ms) 275.35 (±13.20 ms) -1.9ms (0.7%) 👌
wc-clear-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/clear/1k duration 29.75 (±2.35 ms) 30.10 (±1.90 ms) +0.4ms (1.2%) 👌
wc-create-10k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/create/10k duration 2148.35 (±13.90 ms) 2191.05 (±16.35 ms) +42.7ms (2.0%) 👎
wc-create-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/create/1k duration 229.00 (±6.20 ms) 226.65 (±5.55 ms) -2.4ms (1.0%) 👌
wc-update-10th-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/update-10th/1k duration 85.05 (±5.00 ms) 87.65 (±6.75 ms) +2.6ms (3.1%) 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: cc705d0 | Target commit: a3c9a5b

lwc-engine-benchmark

table-append-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/append/1k duration 159.00 (±7.10 ms) 167.55 (±4.35 ms) +8.6ms (5.4%) 👎
table-clear-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/clear/1k duration 12.30 (±0.95 ms) 13.30 (±0.50 ms) +1.0ms (8.1%) 👎
table-create-10k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/create/10k duration 936.80 (±9.55 ms) 973.30 (±7.65 ms) +36.5ms (3.9%) 👎
table-create-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/create/1k duration 110.20 (±1.80 ms) 114.90 (±2.65 ms) +4.7ms (4.3%) 👎
table-update-10th-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table/update-10th/1k duration 98.60 (±3.55 ms) 101.60 (±1.70 ms) +3.0ms (3.0%) 👎
tablecmp-append-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/append/1k duration 239.50 (±7.20 ms) 218.75 (±9.60 ms) -20.8ms (8.7%) 👍
tablecmp-clear-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/clear/1k duration 20.15 (±2.05 ms) 20.35 (±3.00 ms) +0.2ms (1.0%) 👌
tablecmp-create-10k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/create/10k duration 1670.65 (±14.25 ms) 1672.05 (±14.15 ms) +1.4ms (0.1%) 👌
tablecmp-create-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/create/1k duration 190.40 (±6.60 ms) 188.75 (±5.60 ms) -1.7ms (0.9%) 👌
tablecmp-update-10th-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-component/update-10th/1k duration 83.70 (±5.50 ms) 85.25 (±5.40 ms) +1.5ms (1.9%) 👌
wc-append-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/append/1k duration 277.30 (±13.50 ms) 278.85 (±16.90 ms) +1.6ms (0.6%) 👌
wc-clear-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/clear/1k duration 29.75 (±2.35 ms) 32.30 (±2.45 ms) +2.5ms (8.6%) 👎
wc-create-10k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/create/10k duration 2148.35 (±13.90 ms) 2190.20 (±13.70 ms) +41.8ms (1.9%) 👎
wc-create-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/create/1k duration 229.00 (±6.20 ms) 231.55 (±5.90 ms) +2.6ms (1.1%) 👌
wc-update-10th-1k metric base(cc705d0) target(a3c9a5b) trend
benchmark-table-wc/update-10th/1k duration 85.05 (±5.00 ms) 90.85 (±5.65 ms) +5.8ms (6.8%) 👎

@pmdartus
Copy link
Member

@jodarove LGTM

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: eaab65c | Target commit: a3c9a5b

lwc-engine-benchmark

table-append-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table/append/1k duration 170.00 (±4.40 ms) 166.25 (±3.25 ms) -3.8ms (2.2%) 👍
table-clear-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table/clear/1k duration 13.60 (±0.55 ms) 13.50 (±0.50 ms) -0.1ms (0.7%) 👌
table-create-10k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table/create/10k duration 958.15 (±7.05 ms) 945.00 (±12.15 ms) -13.1ms (1.4%) 👍
table-create-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table/create/1k duration 114.15 (±2.25 ms) 113.50 (±2.75 ms) -0.7ms (0.6%) 👌
table-update-10th-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table/update-10th/1k duration 91.15 (±2.90 ms) 100.60 (±2.20 ms) +9.4ms (10.4%) 👎
tablecmp-append-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-component/append/1k duration 247.40 (±8.05 ms) 253.45 (±6.45 ms) +6.1ms (2.4%) 👎
tablecmp-clear-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-component/clear/1k duration 21.70 (±2.20 ms) 22.75 (±2.10 ms) +1.1ms (4.8%) 👌
tablecmp-create-10k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-component/create/10k duration 1716.40 (±11.50 ms) 1683.70 (±13.75 ms) -32.7ms (1.9%) 👍
tablecmp-create-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-component/create/1k duration 188.95 (±5.35 ms) 186.70 (±4.90 ms) -2.3ms (1.2%) 👌
tablecmp-update-10th-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-component/update-10th/1k duration 81.40 (±4.45 ms) 84.50 (±7.50 ms) +3.1ms (3.8%) 👎
wc-append-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-wc/append/1k duration 273.10 (±20.25 ms) 265.75 (±16.75 ms) -7.4ms (2.7%) 👌
wc-clear-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-wc/clear/1k duration 30.75 (±1.95 ms) 29.30 (±3.20 ms) -1.4ms (4.7%) 👌
wc-create-10k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-wc/create/10k duration 2196.30 (±12.20 ms) 2188.95 (±14.65 ms) -7.4ms (0.3%) 👌
wc-create-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-wc/create/1k duration 226.45 (±6.05 ms) 231.00 (±6.55 ms) +4.6ms (2.0%) 👎
wc-update-10th-1k metric base(eaab65c) target(a3c9a5b) trend
benchmark-table-wc/update-10th/1k duration 87.20 (±7.10 ms) 82.60 (±7.00 ms) -4.6ms (5.3%) 👍

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 545c1b1 | Target commit: a3c9a5b

lwc-engine-benchmark

table-append-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table/append/1k duration 165.30 (±6.50 ms) 162.95 (±4.80 ms) -2.4ms (1.4%) 👌
table-clear-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table/clear/1k duration 13.30 (±0.55 ms) 12.95 (±0.65 ms) -0.4ms (2.6%) 👌
table-create-10k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table/create/10k duration 948.85 (±8.00 ms) 947.75 (±10.05 ms) -1.1ms (0.1%) 👌
table-create-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table/create/1k duration 112.75 (±2.35 ms) 111.35 (±2.55 ms) -1.4ms (1.2%) 👍
table-update-10th-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table/update-10th/1k duration 92.50 (±6.40 ms) 93.30 (±6.70 ms) +0.8ms (0.9%) 👌
tablecmp-append-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-component/append/1k duration 253.85 (±6.65 ms) 248.40 (±6.20 ms) -5.5ms (2.1%) 👍
tablecmp-clear-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-component/clear/1k duration 22.30 (±1.50 ms) 22.40 (±2.90 ms) +0.1ms (0.4%) 👌
tablecmp-create-10k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-component/create/10k duration 1712.50 (±15.20 ms) 1711.30 (±13.70 ms) -1.2ms (0.1%) 👌
tablecmp-create-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-component/create/1k duration 189.15 (±6.95 ms) 190.05 (±5.80 ms) +0.9ms (0.5%) 👌
tablecmp-update-10th-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-component/update-10th/1k duration 82.80 (±6.70 ms) 83.50 (±5.40 ms) +0.7ms (0.8%) 👌
wc-append-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-wc/append/1k duration 281.05 (±14.70 ms) 273.40 (±18.65 ms) -7.7ms (2.7%) 👌
wc-clear-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-wc/clear/1k duration 30.65 (±2.40 ms) 30.85 (±2.95 ms) +0.2ms (0.7%) 👌
wc-create-10k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-wc/create/10k duration 2149.75 (±17.55 ms) 2193.80 (±15.75 ms) +44.1ms (2.0%) 👎
wc-create-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-wc/create/1k duration 226.20 (±4.55 ms) 230.40 (±4.60 ms) +4.2ms (1.9%) 👎
wc-update-10th-1k metric base(545c1b1) target(a3c9a5b) trend
benchmark-table-wc/update-10th/1k duration 88.20 (±7.60 ms) 86.55 (±5.30 ms) -1.7ms (1.9%) 👌

Adds [LWC error/warning] prefix to clearly identify LWC's console logs
@jodarove jodarove force-pushed the jodarove/add-header-to-console-logs branch from a3c9a5b to 2242add Compare September 28, 2018 18:32
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 545c1b1 | Target commit: 2242add

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 545c1b1 | Target commit: 2242add

lwc-engine-benchmark

table-append-1k metric base(545c1b1) target(2242add) trend
benchmark-table/append/1k duration 165.30 (±6.50 ms) 167.45 (±4.90 ms) +2.1ms (1.3%) 👌
table-clear-1k metric base(545c1b1) target(2242add) trend
benchmark-table/clear/1k duration 13.30 (±0.55 ms) 12.75 (±1.10 ms) -0.6ms (4.1%) 👌
table-create-10k metric base(545c1b1) target(2242add) trend
benchmark-table/create/10k duration 948.85 (±8.00 ms) 957.25 (±10.75 ms) +8.4ms (0.9%) 👎
table-create-1k metric base(545c1b1) target(2242add) trend
benchmark-table/create/1k duration 112.75 (±2.35 ms) 112.25 (±2.80 ms) -0.5ms (0.4%) 👌
table-update-10th-1k metric base(545c1b1) target(2242add) trend
benchmark-table/update-10th/1k duration 92.50 (±6.40 ms) 88.85 (±2.70 ms) -3.7ms (3.9%) 👌
tablecmp-append-1k metric base(545c1b1) target(2242add) trend
benchmark-table-component/append/1k duration 253.85 (±6.65 ms) 252.55 (±7.70 ms) -1.3ms (0.5%) 👌
tablecmp-clear-1k metric base(545c1b1) target(2242add) trend
benchmark-table-component/clear/1k duration 22.30 (±1.50 ms) 20.60 (±2.00 ms) -1.7ms (7.6%) 👍
tablecmp-create-10k metric base(545c1b1) target(2242add) trend
benchmark-table-component/create/10k duration 1712.50 (±15.20 ms) 1638.85 (±14.10 ms) -73.7ms (4.3%) 👍
tablecmp-create-1k metric base(545c1b1) target(2242add) trend
benchmark-table-component/create/1k duration 189.15 (±6.95 ms) 186.00 (±5.65 ms) -3.1ms (1.7%) 👌
tablecmp-update-10th-1k metric base(545c1b1) target(2242add) trend
benchmark-table-component/update-10th/1k duration 82.80 (±6.70 ms) 86.60 (±7.30 ms) +3.8ms (4.6%) 👌
wc-append-1k metric base(545c1b1) target(2242add) trend
benchmark-table-wc/append/1k duration 281.05 (±14.70 ms) 268.20 (±20.50 ms) -12.9ms (4.6%) 👌
wc-clear-1k metric base(545c1b1) target(2242add) trend
benchmark-table-wc/clear/1k duration 30.65 (±2.40 ms) 31.75 (±2.55 ms) +1.1ms (3.6%) 👌
wc-create-10k metric base(545c1b1) target(2242add) trend
benchmark-table-wc/create/10k duration 2149.75 (±17.55 ms) 2210.00 (±20.35 ms) +60.3ms (2.8%) 👎
wc-create-1k metric base(545c1b1) target(2242add) trend
benchmark-table-wc/create/1k duration 226.20 (±4.55 ms) 229.60 (±5.85 ms) +3.4ms (1.5%) 👌
wc-update-10th-1k metric base(545c1b1) target(2242add) trend
benchmark-table-wc/update-10th/1k duration 88.20 (±7.60 ms) 88.00 (±5.55 ms) -0.2ms (0.2%) 👌

@jodarove jodarove merged commit 816b643 into master Sep 28, 2018
@jodarove jodarove deleted the jodarove/add-header-to-console-logs branch September 28, 2018 18:54
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.

4 participants