Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Fix: Webpack options #245

Merged
merged 1 commit into from
Oct 14, 2022
Merged

Fix: Webpack options #245

merged 1 commit into from
Oct 14, 2022

Conversation

xhulz
Copy link
Contributor

@xhulz xhulz commented Oct 14, 2022

PR description

Thedevtool option was changed from source-map to eval. We know that this may not be the best option, however, the memory of the virtual machines was overflowing due to the large use of resources to generate the code mapping.

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if documentation updates are required.

Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

lgtm

@acuarica
Copy link
Contributor

Hey @xhulz, thanks for taking care and sending this. Do you know why this is happening all of a sudden? Is it something coming from Truffle upstream?

@xhulz
Copy link
Contributor Author

xhulz commented Oct 14, 2022

Hey @acuarica!

Truffle packages have a lot of dependencies, so the extension has grown a lot in size. So, when webpack starts to pack the extension, the machine's memory doesn't stop increasing and when it reaches 95% usage, it ends the process. This is because webpack creates a lot of processes trying to create the source maps. When you come back, I can show you this happening. Another option is to increase the memory of the virtual machine that we are creating inside the Action and keep the source maps.

Anyway, we need to think about a solution for this issue.

@kevinbluer
Copy link
Member

Looks good from my side too! As an additional check, I'll do smoke test off the pre-release when it's published to the marketplace 👍 Thanks for the wrangling on this @xhulz!

@xhulz xhulz merged commit 4b84ea4 into develop Oct 14, 2022
@xhulz xhulz deleted the fix/webpack-compilation branch October 14, 2022 14:34
@acuarica
Copy link
Contributor

Thanks for the detail explanation @xhulz, super helpful!

xhulz added a commit that referenced this pull request Oct 27, 2022
* Dedicated tab(s) in VS Code panel (#205)

* feat: implementing the new truffle panel log

* build: multi tab has been implemented

* build: dead code has been removed

* build: dispose tab and onview activation has implemented

* refactor: main.js has converted to object

* docs: ts documentation and code comments has been added

* fix: code review resolutions

* fix: required.test has been fixed

* fix: change gfx (#215)

Bryan supplied a revised logo image san's dropshadow.

* Remove redundant txns from dialog after a redeploy (#225)

fix: the debug transaction dropdown is now showing only the last deployed transaction

* New solidity project types has added: empty, sample and unbox a truffle project (#222)

* feat: new types of project were added to create a new project

* fix: folder projectPath has been vanish out

* Networks (Local Instance) - Get More Information (#217)

* feat: saving progress

* feat: saving the progress

* feat: saving the progress

* feat: it has been created the option to get details for ganache instances

* fix: problems pointed out in the code review have been fixed

Co-authored-by: MB <951378+michaeljohnbennett@users.noreply.github.com>

* Fix/directory selection flow (#226)

* feat: new types of project were added to create a new project

* fix: folder projectPath has been vanish out

* fix: the directory selection has moved to the end of the flow

* fix: truffle box sample project name variable has changed

* Dropdown when selecting a box to "unbox" (#220)

chore: the textbox has been replaced by a dropdown with the list of boxes

* Create an "auto-deploy on save" toggle in the Contract Explorer (#227)

* chore: saving the progress

* chore: status bar for auto deploy was placed on vscode environment

* chore: auto deploy action has been implemented for contracts

* fix: remove auto focus from log panel (#233)

fix: auto focus from log panel has been removed

* Fix: Debug no source file (#229)

* fix: truffle compile has been added to gather the artifacts compilation in correct way

* fix: drizzle has been removed from truffle boxes list

* docs: the typescript docs has been created

* fix: typo

* fix: pretting missing code

* fix: references no longer used have been removed

* fix: namespace from contract helpers has been removed

* fix: suggestions from code review have been implemented

* Spurious closing bracket on "Create sample project" entry when creating a new project (#238)

fix: the sample project description text has been fixed

* Temporarily continue logging to the Truffle for VS Code output channel (#237)

* chore: logging using output channels has been implemented again

* fix: auto focus has been removed from log create and log dispose

* fix: the focus on output channels has been restaured

* fix: minor stylistic tweaks to output tabs (#240)

* fix: minor stylistic tweaks to output tabs

* fix: output tab accommodations for light(er) modes

* Changelog has been updated with new features (#242)

* chore: changelog has been updated with new features

* fix: text has been changed

* Fix: original-require package issues (#243)

fix: webpack has been updated to solve the problem with original-require package

* Fix: Webpack options (#245)

fix: devtool has changed to eval instead source-map

Co-authored-by: MB <951378+michaeljohnbennett@users.noreply.github.com>
Co-authored-by: Kevin Bluer <kevin@bluer.com>
@acuarica
Copy link
Contributor

acuarica commented Nov 24, 2022

Hey, related to

I've running some benchmarks to see if we can improve performance. In the list below you can see the command and the size of its output, except in the 4th command, which shows an approximation of the Activation time.

Please note, all these commands were run in a pristine environment, i.e., to set up each environment you need to run

rm -r node_modules
rm yarn.lock
yarn install

On develop

  • yarn webpack:dev && ll out/src. [..] 79M [..] extension.js
  • yarn webpack:prod && ll out/src. [..] 31M [..] extension.js
  • yarn package. DONE Packaged: [..]/truffle-vscode-2.3.5.vsix (110 files, 10.38MB)
  • code --install-extension truffle-vscode-2.3.5.vsix. Activation time 769ms

With no faker

  • yarn webpack:dev && ll out/src. [..] 70M [..] extension.js
  • yarn webpack:prod && ll out/src. [..] 28M [..] extension.js
  • yarn package. DONE Packaged: [..]/truffle-vscode-2.3.5.vsix (110 files, 9.67MB)
  • code --install-extension truffle-vscode-2.3.5.vsix. Activation time 713ms

With no faker and devtool: false in webpack.prod.js

  • yarn webpack:prod && ll out/src. [..] 15M [..] extension.js
  • yarn package. DONE Packaged: [..]/truffle-vscode-2.3.5.vsix (110 files, 7.6MB)
  • code --install-extension truffle-vscode-2.3.5.vsix. Activation time 529ms

This shows that by removing faker we improve a little bit, but by far the major improvement is when we remove devtool.
So in summary, should we remove devtool, i.e., devtool: false, from the production bundle?

@xhulz
Copy link
Contributor Author

xhulz commented Nov 25, 2022

Hey @acuarica,

Thanks for that :)

I've tried to bundling using devtool: false but I've got some problems to do that on Windows. Windows shut down the process every time. Have you tried creating a VSIX on Windows VM with the same Github CI setup?

@acuarica
Copy link
Contributor

Not yet, but I was wondering about any potential issues we might have when removing devtool in the production bundle. Do you know why we had source-map in the first place? Maybe @michaeljohnbennett or @kevinbluer know about this.

@xhulz
Copy link
Contributor Author

xhulz commented Nov 25, 2022

No, i don't...

@acuarica
Copy link
Contributor

Have you tried creating a VSIX on Windows VM with the same Github CI setup?

No, so let's see #268

@michaeljohnbennett
Copy link
Contributor

Hey, not sure about the source-map, I think it was probably a historical thing, but in reality we don't need it for debugging the packed plugin so if you can get it working to deploy and run without it, do it! 👍🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants