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(compiler): raptor on platform #298

Merged
merged 37 commits into from
May 28, 2018
Merged

Conversation

apapko
Copy link
Collaborator

@apapko apapko commented May 11, 2018

Details

This PR includes several enhancements to the open source compiler to allow for source code diagnostics and cleaner integration with platform compiler. The open source compiler will be consumed by platform-compiler for transformation and bundling invocation. Furthermore, as part of the effort to minimize compiler maintenance and code/feature duplication, platform-compiler, which in-itself consumes open source compiler, will be now used by both Aura open source and core in the form of a jar ( maven dependency ).

Some details on the changes:

  • Types: everything in the compiler is typed now.
  • Feature based folder structure refactoring
  • More tests coverage
  • Compiler Interface changes
  • Diagnostics

Few remaining TODOS:

  • figure out how to expose all compiler types
  • regenerate expected results in 'amd' format for older tests

Does this PR introduce a breaking change?

  • Yes
  • No
    Compiler interface has changed. Aura will now be using platform compiler instead - thus invocation API must be change in Aura to satisfy platform compiler interface - tracked separately.

apapko added 30 commits March 5, 2018 14:38
* wip: module import locations

* wip: move import locations into metadata

* wip: rename import locations

* wip: use common location class in import locations

* wip: change regex and token retrieval
* feat(compiler): use real compiler version during build
* fix(compiler): module resolver fails to import custom template
@apapko apapko requested a review from diervo May 11, 2018 22:49
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: fde372d | Target commit: ac7d0a3

lwc-engine-benchmark

table-append-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table/append/1k duration 144.30 (± 4.40 ms) 143.90 (± 3.40 ms) 0.28% 👌
table-clear-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table/clear/1k duration 11.70 (± 0.50 ms) 11.80 (± 0.50 ms) -0.85% 👌
table-create-10k metric base(fde372d) target(ac7d0a3) trend
benchmark-table/create/10k duration 855.00 (± 4.50 ms) 850.90 (± 3.80 ms) 0.48% 👍
table-create-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table/create/1k duration 100.80 (± 1.90 ms) 101.95 (± 1.60 ms) -1.14% 👌
table-update-10th-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table/update-10th/1k duration 86.00 (± 5.00 ms) 92.35 (± 5.15 ms) -7.38% 👎
tablecmp-append-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table-component/append/1k duration 246.10 (± 5.20 ms) 248.20 (± 5.40 ms) -0.85% 👌
tablecmp-clear-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table/clear/1k duration 31.40 (± 1.30 ms) 31.90 (± 1.80 ms) -1.59% 👌
tablecmp-create-10k metric base(fde372d) target(ac7d0a3) trend
benchmark-table-component/create/10k duration 1678.50 (± 11.20 ms) 1692.40 (± 8.90 ms) -0.83% 👎
tablecmp-create-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table-component/create/1k duration 194.40 (± 3.10 ms) 195.60 (± 3.20 ms) -0.62% 👌
tablecmp-update-10th-1k metric base(fde372d) target(ac7d0a3) trend
benchmark-table-component/update-10th/1k duration 74.80 (± 4.30 ms) 76.40 (± 4.00 ms) -2.14% 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 75722cb | Target commit: f9f23f8

lwc-engine-benchmark

table-append-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table/append/1k duration 142.90 (± 2.40 ms) 143.30 (± 3.80 ms) -0.28% 👌
table-clear-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table/clear/1k duration 11.40 (± 0.40 ms) 11.30 (± 0.40 ms) 0.88% 👌
table-create-10k metric base(75722cb) target(f9f23f8) trend
benchmark-table/create/10k duration 849.10 (± 7.70 ms) 853.00 (± 6.20 ms) -0.46% 👎
table-create-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table/create/1k duration 101.00 (± 2.30 ms) 102.30 (± 1.70 ms) -1.29% 👌
table-update-10th-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table/update-10th/1k duration 95.00 (± 4.60 ms) 92.00 (± 4.70 ms) 3.16% 👌
tablecmp-append-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table-component/append/1k duration 243.40 (± 5.40 ms) 247.10 (± 5.10 ms) -1.52% 👎
tablecmp-clear-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table/clear/1k duration 31.60 (± 1.10 ms) 31.10 (± 1.40 ms) 1.58% 👌
tablecmp-create-10k metric base(75722cb) target(f9f23f8) trend
benchmark-table-component/create/10k duration 1717.10 (± 9.00 ms) 1678.20 (± 10.00 ms) 2.27% 👍
tablecmp-create-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table-component/create/1k duration 193.60 (± 3.80 ms) 192.80 (± 3.20 ms) 0.41% 👌
tablecmp-update-10th-1k metric base(75722cb) target(f9f23f8) trend
benchmark-table-component/update-10th/1k duration 74.10 (± 3.80 ms) 76.30 (± 4.80 ms) -2.97% 👌

@apapko
Copy link
Collaborator Author

apapko commented May 14, 2018

@byao @diervo compiler PR is up to date. We need to agree if this change is going into master before renaming PR and start merging

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6ad80ca | Target commit: 5a17ab5

1 similar comment
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6ad80ca | Target commit: 5a17ab5

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6ad80ca | Target commit: 6613936

lwc-engine-benchmark

table-append-1k metric base(6ad80ca) target(6613936) trend
benchmark-table/append/1k duration 151.80 (± 6.00 ms) 144.55 (± 3.70 ms) 4.78% 👍
table-clear-1k metric base(6ad80ca) target(6613936) trend
benchmark-table/clear/1k duration 11.90 (± 0.50 ms) 11.50 (± 0.50 ms) 3.36% 👌
table-create-10k metric base(6ad80ca) target(6613936) trend
benchmark-table/create/10k duration 843.60 (± 6.50 ms) 841.10 (± 5.10 ms) 0.30% 👌
table-create-1k metric base(6ad80ca) target(6613936) trend
benchmark-table/create/1k duration 102.60 (± 1.50 ms) 101.30 (± 1.70 ms) 1.27% 👍
table-update-10th-1k metric base(6ad80ca) target(6613936) trend
benchmark-table/update-10th/1k duration 90.35 (± 5.55 ms) 91.90 (± 4.20 ms) -1.72% 👌
tablecmp-append-1k metric base(6ad80ca) target(6613936) trend
benchmark-table-component/append/1k duration 213.10 (± 14.50 ms) 244.90 (± 4.30 ms) -14.92% 👎
tablecmp-clear-1k metric base(6ad80ca) target(6613936) trend
benchmark-table/clear/1k duration 31.90 (± 1.40 ms) 31.90 (± 1.00 ms) 0.00% 👌
tablecmp-create-10k metric base(6ad80ca) target(6613936) trend
benchmark-table-component/create/10k duration 1701.20 (± 11.20 ms) 1697.10 (± 9.00 ms) 0.24% 👌
tablecmp-create-1k metric base(6ad80ca) target(6613936) trend
benchmark-table-component/create/1k duration 192.90 (± 4.10 ms) 196.75 (± 4.50 ms) -2.00% 👎
tablecmp-update-10th-1k metric base(6ad80ca) target(6613936) trend
benchmark-table-component/update-10th/1k duration 77.50 (± 4.70 ms) 75.20 (± 3.90 ms) 2.97% 👌

* wip: merge master
* refactor(compiler): add proper type to css transformer
@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6ad3b7c | Target commit: bffafe1

lwc-engine-benchmark

table-append-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table/append/1k duration 145.90 (± 3.70 ms) 146.70 (± 4.50 ms) -0.55% 👌
table-clear-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table/clear/1k duration 11.70 (± 0.40 ms) 11.70 (± 0.50 ms) 0.00% 👌
table-create-10k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table/create/10k duration 855.90 (± 11.40 ms) 851.15 (± 6.25 ms) 0.55% 👍
table-create-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table/create/1k duration 102.20 (± 1.20 ms) 100.45 (± 2.05 ms) 1.71% 👍
table-update-10th-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table/update-10th/1k duration 86.70 (± 4.50 ms) 87.40 (± 4.40 ms) -0.81% 👌
tablecmp-append-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table-component/append/1k duration 246.80 (± 4.70 ms) 245.30 (± 5.30 ms) 0.61% 👌
tablecmp-clear-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table/clear/1k duration 31.80 (± 1.10 ms) 33.10 (± 1.30 ms) -4.09% 👎
tablecmp-create-10k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table-component/create/10k duration 1706.70 (± 14.20 ms) 1680.80 (± 7.40 ms) 1.52% 👍
tablecmp-create-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table-component/create/1k duration 190.90 (± 3.00 ms) 190.50 (± 4.30 ms) 0.21% 👌
tablecmp-update-10th-1k metric base(6ad3b7c) target(bffafe1) trend
benchmark-table-component/update-10th/1k duration 75.80 (± 4.20 ms) 73.10 (± 4.40 ms) 3.56% 👌

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 6ad3b7c | Target commit: 905ef3f

lwc-engine-benchmark

table-append-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table/append/1k duration 145.90 (± 3.70 ms) 145.60 (± 4.40 ms) 0.21% 👌
table-clear-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table/clear/1k duration 11.70 (± 0.40 ms) 11.80 (± 0.55 ms) -0.85% 👌
table-create-10k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table/create/10k duration 855.90 (± 11.40 ms) 842.90 (± 10.10 ms) 1.52% 👍
table-create-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table/create/1k duration 102.20 (± 1.20 ms) 100.70 (± 2.00 ms) 1.47% 👍
table-update-10th-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table/update-10th/1k duration 86.70 (± 4.50 ms) 92.00 (± 5.00 ms) -6.11% 👌
tablecmp-append-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table-component/append/1k duration 246.80 (± 4.70 ms) 245.80 (± 3.70 ms) 0.41% 👌
tablecmp-clear-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table/clear/1k duration 31.80 (± 1.10 ms) 31.10 (± 1.40 ms) 2.20% 👌
tablecmp-create-10k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table-component/create/10k duration 1706.70 (± 14.20 ms) 1680.60 (± 6.10 ms) 1.53% 👍
tablecmp-create-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table-component/create/1k duration 190.90 (± 3.00 ms) 186.80 (± 4.00 ms) 2.15% 👍
tablecmp-update-10th-1k metric base(6ad3b7c) target(905ef3f) trend
benchmark-table-component/update-10th/1k duration 75.80 (± 4.20 ms) 72.00 (± 5.20 ms) 5.01% 👌

@diervo diervo merged commit 922de78 into master May 28, 2018
@diervo diervo deleted the apapko/raptor-on-platform-compiler branch May 28, 2018 19:04
"author": "",
"license": "ISC",
"scripts": {
"clean": "rm -rf dist",
"build": "echo 'Building compiler...' && DIR=`pwd` && cd ../../ && tsc -p $DIR/tsconfig.json",
"build:all": "",
"build:umd": "webpack --progress",
Copy link
Contributor

Choose a reason for hiding this comment

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

@apapko removing build:umd breaks yarn build:compiler script in the base package.json https://github.com/salesforce/lwc/blob/master/package.json#L15

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