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

include sources for sourcemaps #5956

Merged
merged 8 commits into from
Mar 28, 2023
Merged

include sources for sourcemaps #5956

merged 8 commits into from
Mar 28, 2023

Conversation

luu-alex
Copy link
Contributor

@luu-alex luu-alex commented Mar 25, 2023

Description

#5857
Please include a summary of the changes and be sure to follow our Contribution Guidelines.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist for 1.x:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build with success.
  • I have tested the built dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.

Checklist for 4.x:

  • I have selected the correct 4.x base branch.
  • Within the description, the feature or issue is discussed in detail or an issue is linked.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added any required tests for the changes I made
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules.
  • I ran yarn successfully
  • I ran yarn lint successfully
  • I ran yarn build:web successfully
  • I ran yarn test:unit successfully
  • I ran yarn test:integration successfully
  • I ran compile:contracts successfully
  • I have tested my code.
  • I have updated the corresponding CHANGELOG.md file in the packages I have edited.

@github-actions
Copy link

github-actions bot commented Mar 25, 2023

Bundle Stats

Hey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Asset Old size New size Diff Diff %
Total 1.06 MB 1.06 MB -476 bytes -0.04%
View detailed bundle breakdown

Added

Asset Old size New size Diff Diff %
../lib/commonjs/accounts.d.ts 0 3.39 KB 3.39 KB -
../lib/commonjs/types.d.ts 0 1.64 KB 1.64 KB -
../lib/commonjs/abi.d.ts 0 966 bytes 966 bytes -
../lib/commonjs/index.d.ts 0 864 bytes 864 bytes -
../lib/commonjs/web3.d.ts 0 808 bytes 808 bytes -
../lib/commonjs/eth.exports.d.ts 0 280 bytes 280 bytes -
../lib/commonjs/providers.exports.d.ts 0 191 bytes 191 bytes -
../lib/commonjs/version.d.ts 0 60 bytes 60 bytes -

Removed

Asset Old size New size Diff Diff %
../lib/accounts.d.ts 3.42 KB 0 -3.42 KB -100.00%
../lib/types.d.ts 1.68 KB 0 -1.68 KB -100.00%
../lib/types.d.ts.map 1.51 KB 0 -1.51 KB -100.00%
../lib/abi.d.ts 999 bytes 0 -999 bytes -100.00%
../lib/index.d.ts.map 919 bytes 0 -919 bytes -100.00%
../lib/index.d.ts 899 bytes 0 -899 bytes -100.00%
../lib/web3.d.ts 842 bytes 0 -842 bytes -100.00%
../lib/web3.d.ts.map 694 bytes 0 -694 bytes -100.00%
../lib/accounts.d.ts.map 528 bytes 0 -528 bytes -100.00%
../lib/eth.exports.d.ts.map 358 bytes 0 -358 bytes -100.00%
../lib/eth.exports.d.ts 321 bytes 0 -321 bytes -100.00%
../lib/providers.exports.d.ts.map 292 bytes 0 -292 bytes -100.00%
../lib/providers.exports.d.ts 238 bytes 0 -238 bytes -100.00%
../lib/version.d.ts.map 140 bytes 0 -140 bytes -100.00%
../lib/abi.d.ts.map 124 bytes 0 -124 bytes -100.00%
../lib/version.d.ts 97 bytes 0 -97 bytes -100.00%

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset Old size New size Diff Diff %
web3.min.js 1.05 MB 1.05 MB 4.33 KB 0.40%

@codecov
Copy link

codecov bot commented Mar 25, 2023

Codecov Report

Merging #5956 (f1a5ecd) into 4.x (dd33e17) will not change coverage.
The diff coverage is n/a.

❗ Current head f1a5ecd differs from pull request most recent head 5e46f3a. Consider uploading reports for the commit 5e46f3a to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##              4.x    #5956   +/-   ##
=======================================
  Coverage   82.14%   82.14%           
=======================================
  Files         137      137           
  Lines        5981     5981           
  Branches     1572     1572           
=======================================
  Hits         4913     4913           
  Misses       1068     1068           
Flag Coverage Δ
UnitTests 82.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
web3 ∅ <ø> (∅)
web3-core ∅ <ø> (∅)
web3-errors ∅ <ø> (∅)
web3-eth ∅ <ø> (∅)
web3-eth-abi ∅ <ø> (∅)
web3-eth-accounts ∅ <ø> (∅)
web3-eth-contract ∅ <ø> (∅)
web3-eth-ens ∅ <ø> (∅)
web3-eth-iban ∅ <ø> (∅)
web3-eth-personal ∅ <ø> (∅)
web3-net ∅ <ø> (∅)
web3-providers-http ∅ <ø> (∅)
web3-providers-ipc ∅ <ø> (∅)
web3-providers-ws ∅ <ø> (∅)
web3-rpc-methods ∅ <ø> (∅)
web3-utils ∅ <ø> (∅)
web3-validator ∅ <ø> (∅)

@luu-alex luu-alex changed the title include src files when installing on npm for sourcemaps include sources for sourcemaps Mar 25, 2023
@luu-alex luu-alex marked this pull request as ready for review March 25, 2023 18:22
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 27, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62d9716
Status: ✅  Deploy successful!
Preview URL: https://7a10f4b1.web3-js-docs.pages.dev
Branch Preview URL: https://5857.web3-js-docs.pages.dev

View logs

@jdevcs
Copy link
Contributor

jdevcs commented Mar 27, 2023

@luu-alex this will whitelist source files to be included , can you see how much difference of lib size is created after that?

@luu-alex
Copy link
Contributor Author

@jdevcs used this command to find the size of all src files in web3js packages.
find . -type d -name 'src' -not -path '*/node_modules/*' -exec du -skc {} + | awk '/total/{sum+=$1} END{print sum "K"}'

1224K

1224KB will be added to the current library size.

Copy link
Contributor

@spacesailor24 spacesailor24 left a comment

Choose a reason for hiding this comment

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

We should technically be updating the CHANGELOGs to say we're adding the source files to dist/ for each package

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.

6 participants