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(compiler): resolve error code conflicts #770

Merged
merged 1 commit into from
Oct 26, 2018
Merged

Conversation

jye-sf
Copy link
Contributor

@jye-sf jye-sf commented Oct 26, 2018

Details

Fixes a bug with converting generic errors into compiler diagnostics.
Resolves a conflict with rollup clobbering error.code.

Does this PR introduce a breaking change?

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

@jye-sf jye-sf requested a review from apapko October 26, 2018 07:44
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 81093fc | Target commit: 1d8ee11

lwc-engine-benchmark

table-append-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table/append/1k duration 150.00 (±4.45 ms) 147.50 (±5.10 ms) -2.5ms (1.7%) 👍
table-clear-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table/clear/1k duration 6.25 (±0.35 ms) 5.90 (±0.30 ms) -0.3ms (5.6%) 👍
table-create-10k metric base(81093fc) target(1d8ee11) trend
benchmark-table/create/10k duration 868.75 (±8.20 ms) 885.95 (±4.95 ms) +17.2ms (2.0%) 👎
table-create-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table/create/1k duration 114.75 (±2.00 ms) 117.20 (±2.20 ms) +2.5ms (2.1%) 👎
table-update-10th-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table/update-10th/1k duration 86.05 (±3.75 ms) 85.85 (±2.85 ms) -0.2ms (0.2%) 👌
tablecmp-append-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-component/append/1k duration 239.40 (±9.45 ms) 231.85 (±12.00 ms) -7.5ms (3.2%) 👍
tablecmp-clear-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-component/clear/1k duration 11.50 (±1.60 ms) 11.75 (±1.20 ms) +0.3ms (2.2%) 👌
tablecmp-create-10k metric base(81093fc) target(1d8ee11) trend
benchmark-table-component/create/10k duration 1637.35 (±15.45 ms) 1655.65 (±11.00 ms) +18.3ms (1.1%) 👎
tablecmp-create-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-component/create/1k duration 200.00 (±5.20 ms) 199.20 (±6.15 ms) -0.8ms (0.4%) 👌
tablecmp-update-10th-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-component/update-10th/1k duration 74.15 (±4.85 ms) 70.20 (±4.90 ms) -4.0ms (5.3%) 👍
wc-append-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-wc/append/1k duration 238.15 (±9.45 ms) 228.15 (±10.85 ms) -10.0ms (4.2%) 👍
wc-clear-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-wc/clear/1k duration 22.45 (±2.00 ms) 21.85 (±2.00 ms) -0.6ms (2.7%) 👌
wc-create-10k metric base(81093fc) target(1d8ee11) trend
benchmark-table-wc/create/10k duration 1692.95 (±46.25 ms) 1711.95 (±30.40 ms) +19.0ms (1.1%) 👌
wc-create-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-wc/create/1k duration 204.20 (±3.70 ms) 202.80 (±3.45 ms) -1.4ms (0.7%) 👌
wc-update-10th-1k metric base(81093fc) target(1d8ee11) trend
benchmark-table-wc/update-10th/1k duration 70.15 (±3.85 ms) 73.15 (±4.35 ms) +3.0ms (4.3%) 👌

// Rollup may have clobbered error.code with its own data
if (e instanceof CompilerError && (e as any).pluginCode) {
e.code = (e as any).pluginCode;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rollup.js checks whether error.code exists. If it does, but it's not what it expects, it'll move that value over to .pluginCode and then put its own value into .code.

I'd like to link to something describing this behavior, but I wasn't able to find any documentation about this. Do you know if this documented anywhere?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looked over the docs, but can't find much.

// Rollup may have clobbered error.code with its own data
if (e instanceof CompilerError && (e as any).pluginCode) {
e.code = (e as any).pluginCode;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looked over the docs, but can't find much.

@jye-sf jye-sf merged commit 8885eb6 into master Oct 26, 2018
@jye-sf jye-sf deleted the jye/error-fixes branch October 26, 2018 23:11
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