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

Use webpack to reduce the code loading times #2835

Merged
merged 16 commits into from
Feb 6, 2019
Merged

Conversation

akshita31
Copy link
Contributor

@akshita31 akshita31 commented Feb 1, 2019

This PR enables the usage of webpack to bundle the extension, so that the corresponding js produced and the code load times are lesser, to fix issues like : #2817, #2757.

  1. While working, we were facing problems that when webpack is used in production, the names of the classes were removed from the js files and hence the type checking we had in place for the logging pipeline(which was based on names of the classes) was falling apart, hence we have now modified the Observers to match based on enum values.
  2. This will reduce the extension size to around 300Kb from current 3Mb 💃
  3. Now in travis we dont need to unpack the extension we can run our tests against the dist folders directly, hence I have removed the gulp vsix:release:unpackage step and also the --codeExtensionPath flag being passed to the gulp tasks.

Also, this PR updates the vscode tasks to version 2.0.

@codecov
Copy link

codecov bot commented Feb 1, 2019

Codecov Report

Merging #2835 into master will increase coverage by 21.28%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #2835       +/-   ##
===========================================
+ Coverage   64.87%   86.15%   +21.28%     
===========================================
  Files         104       58       -46     
  Lines        4501     1589     -2912     
  Branches      657      206      -451     
===========================================
- Hits         2920     1369     -1551     
+ Misses       1395      165     -1230     
+ Partials      186       55      -131
Flag Coverage Δ
#integration 100% <ø> (+47.46%) ⬆️
#unit 86.15% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/NetworkSettings.ts 37.5% <0%> (-62.5%) ⬇️
src/packageManager/proxy.ts 42.1% <0%> (-36.85%) ⬇️
src/observers/BaseLoggerObserver.ts 60% <0%> (-20%) ⬇️
src/common.ts 55.55% <0%> (-18.89%) ⬇️
src/packageManager/PackageError.ts 83.33% <0%> (-16.67%) ⬇️
src/packageManager/ZipInstaller.ts 72.97% <0%> (-16.22%) ⬇️
src/platform.ts 60.22% <0%> (-15.91%) ⬇️
src/observers/OptionProvider.ts 57.14% <0%> (-14.29%) ⬇️
src/observables/CreateOptionStream.ts 88.88% <0%> (-11.12%) ⬇️
src/Disposable.ts 77.77% <0%> (-11.12%) ⬇️
... and 63 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 656c182...ab51ec4. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 1, 2019

Codecov Report

Merging #2835 into master will increase coverage by 22.3%.
The diff coverage is 98.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2835      +/-   ##
==========================================
+ Coverage   64.87%   87.17%   +22.3%     
==========================================
  Files         104       59      -45     
  Lines        4501     1739    -2762     
  Branches      657      206     -451     
==========================================
- Hits         2920     1516    -1404     
+ Misses       1395      168    -1227     
+ Partials      186       55     -131
Flag Coverage Δ
#integration 100% <ø> (+47.46%) ⬆️
#unit 87.17% <98.83%> (+1.02%) ⬆️
Impacted Files Coverage Δ
src/observers/ProjectStatusBarObserver.ts 100% <100%> (ø) ⬆️
src/observers/DotnetLoggerObserver.ts 100% <100%> (ø) ⬆️
src/observers/OmnisharpStatusBarObserver.ts 100% <100%> (ø) ⬆️
src/observers/TelemetryObserver.ts 92.3% <100%> (-7.7%) ⬇️
src/observers/DotnetChannelObserver.ts 100% <100%> (ø) ⬆️
src/observers/OmnisharpDebugModeLoggerObserver.ts 87.23% <100%> (-2.13%) ⬇️
src/observers/OmnisharpChannelObserver.ts 100% <100%> (ø) ⬆️
src/observers/ErrorMessageObserver.ts 100% <100%> (ø) ⬆️
src/observers/RazorLoggerObserver.ts 100% <100%> (ø) ⬆️
src/observers/DotnetTestLoggerObserver.ts 98.61% <100%> (-1.39%) ⬇️
... and 84 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 656c182...93d69f8. Read the comment docs.

@akshita31 akshita31 changed the title WIP: Use webpack to reduce the code loading times Use webpack to reduce the code loading times Feb 6, 2019
Copy link
Member

@colombod colombod left a comment

Choose a reason for hiding this comment

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

Looks good to me, great job in size reduction.

Copy link

@rchande rchande left a comment

Choose a reason for hiding this comment

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

Nice work--thanks!

@colombod colombod merged commit ae80ee3 into dotnet:master Feb 6, 2019
@akshita31 akshita31 deleted the webpack branch February 6, 2019 18:34
@akshita31
Copy link
Contributor Author

Through this work we were able to reduce the code load time from ~430 ms to 40ms.
This is a screenshot for the activation time of the extension for a simple workspace for extension version 1.17
image

And here is the same for the 1.18-beta7
beta7_cpu_profile

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