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

update typescript version to 5 #7272

Open
wants to merge 11 commits into
base: 4.x
Choose a base branch
from

Conversation

Muhammad-Altabba
Copy link
Contributor

Description

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:

  • 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 lint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested 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.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

@Muhammad-Altabba Muhammad-Altabba linked an issue Sep 19, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Sep 19, 2024

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

Files count Total bundle size % Changed
10 640.73 kB → 638.49 kB (-2.23 kB) -0.35%
Changeset
File Δ Size
../web3-eth/lib/commonjs/utils/try_send_transaction.js 📈 +74 B (+2.76%) 2.62 kB → 2.69 kB
../web3-eth/lib/commonjs/utils/prepare_transaction_for_signing.js 📈 +102 B (+1.46%) 6.84 kB → 6.94 kB
../web3-eth-accounts/lib/commonjs/tx/eip2930Transaction.js 📈 +159 B (+1.11%) 13.94 kB → 14.09 kB
../web3-eth-accounts/lib/commonjs/tx/eip1559Transaction.js 📈 +159 B (+1.04%) 15 kB → 15.16 kB
src/web3.ts 📈 +45 B (+0.52%) 8.48 kB → 8.53 kB
../web3-eth-ens/lib/commonjs/resolver.js 📈 +32 B (+0.49%) 6.36 kB → 6.39 kB
../web3-eth/lib/commonjs/utils/wait_for_transaction_receipt.js 📈 +19 B (+0.48%) 3.87 kB → 3.89 kB
../web3-eth/lib/commonjs/utils/get_revert_reason.js 📈 +20 B (+0.46%) 4.26 kB → 4.28 kB
../web3-eth/lib/commonjs/web3_eth.js 📈 +402 B (+0.43%) 90.77 kB → 91.16 kB
../web3-eth/lib/commonjs/utils/send_tx_helper.js 📈 +32 B (+0.35%) 9.03 kB → 9.06 kB
../web3-eth/lib/commonjs/utils/transaction_builder.js 📈 +34 B (+0.32%) 10.22 kB → 10.26 kB
../web3-eth-ens/lib/commonjs/ens.js 📈 +24 B (+0.21%) 11.4 kB → 11.42 kB
../web3-core/lib/commonjs/web3_subscription_manager.js 📈 +17 B (+0.19%) 8.75 kB → 8.77 kB
../web3-utils/lib/commonjs/web3_eip1193_provider.js 📈 +8 B (+0.18%) 4.42 kB → 4.43 kB
../web3-eth-contract/lib/commonjs/contract-deployer-method-class.js 📈 +12 B (+0.17%) 6.9 kB → 6.92 kB
../web3-core/lib/commonjs/web3_batch_request.js 📈 +8 B (+0.16%) 4.95 kB → 4.96 kB
../web3-net/lib/commonjs/net.js 📈 +6 B (+0.12%) 4.8 kB → 4.81 kB
../web3-utils/lib/commonjs/socket_provider.js 📈 +17 B (+0.12%) 13.98 kB → 14 kB
../web3-providers-http/lib/commonjs/index.js 📈 +4 B (+0.09%) 4.43 kB → 4.43 kB
../web3-eth-contract/lib/commonjs/contract.js 📉 -14 B (-0.03%) 41.75 kB → 41.74 kB
../web3-core/lib/commonjs/web3_config.js 📉 -8 B (-0.05%) 16.96 kB → 16.95 kB
../web3-core/lib/commonjs/web3_request_manager.js 📉 -8 B (-0.05%) 16.21 kB → 16.2 kB
src/web3_eip6963.ts 📉 -8 B (-0.25%) 3.08 kB → 3.08 kB
../web3-eth/lib/commonjs/utils/reject_if_block_timeout.js 📉 -31 B (-0.43%) 7.04 kB → 7.01 kB
../web3-utils/lib/commonjs/validation.js 📉 -28 B (-0.45%) 6.05 kB → 6.03 kB
../web3-eth/lib/commonjs/rpc_method_wrappers.js 📉 -201 B (-0.46%) 42.44 kB → 42.25 kB
../web3-validator/lib/commonjs/utils.js 📉 -87 B (-0.54%) 15.81 kB → 15.72 kB
../web3-eth-accounts/lib/commonjs/common/utils.js 📉 -136 B (-0.65%) 20.43 kB → 20.3 kB
../web3-eth/lib/commonjs/utils/get_transaction_gas_pricing.js 📉 -39 B (-0.77%) 4.93 kB → 4.89 kB
../web3-rpc-providers/lib/commonjs/types.js 📉 -16 B (-0.89%) 1.75 kB → 1.74 kB
../web3-types/lib/commonjs/eth_types.js 📉 -16 B (-0.93%) 1.68 kB → 1.67 kB
../web3-eth-accounts/lib/commonjs/common/enums.js 📉 -40 B (-0.98%) 3.98 kB → 3.94 kB
../web3-types/lib/commonjs/data_format_types.js 📉 -16 B (-1.06%) 1.48 kB → 1.46 kB
../web3-eth/lib/commonjs/utils/get_transaction_error.js 📉 -38 B (-1.09%) 3.41 kB → 3.37 kB
../web3-eth-abi/lib/commonjs/coders/base/tuple.js 📉 -52 B (-1.10%) 4.63 kB → 4.58 kB
../web3-eth/lib/commonjs/utils/format_transaction.js 📉 -36 B (-1.11%) 3.17 kB → 3.13 kB
../web3-eth-abi/lib/commonjs/coders/base/array.js 📉 -52 B (-1.17%) 4.33 kB → 4.28 kB
../web3-validator/lib/commonjs/validation/string.js 📉 -46 B (-1.28%) 3.52 kB → 3.47 kB
../web3-eth-abi/lib/commonjs/coders/base/number.js 📉 -54 B (-1.28%) 4.12 kB → 4.07 kB
../web3-eth-abi/lib/commonjs/coders/base/bytes.js 📉 -52 B (-1.34%) 3.79 kB → 3.74 kB
../web3-eth-abi/lib/commonjs/coders/base/index.js 📉 -76 B (-1.35%) 5.49 kB → 5.42 kB
../web3-eth-abi/lib/commonjs/coders/encode.js 📉 -75 B (-1.52%) 4.81 kB → 4.74 kB
../web3-net/lib/commonjs/rpc_method_wrappers.js 📉 -39 B (-1.53%) 2.49 kB → 2.45 kB
../web3-eth-accounts/lib/commonjs/common/types.js 📉 -8 B (-1.54%) 519 B → 511 B
../web3-eth/lib/commonjs/utils/watch_transaction_for_confirmations.js 📉 -51 B (-1.79%) 2.78 kB → 2.73 kB
../web3-eth-abi/lib/commonjs/coders/base/address.js 📉 -56 B (-1.90%) 2.89 kB → 2.83 kB
../web3-eth-abi/lib/commonjs/coders/base/utils.js 📉 -38 B (-1.99%) 1.87 kB → 1.83 kB
../web3-eth/lib/commonjs/utils/decode_signed_transaction.js 📉 -42 B (-2.31%) 1.78 kB → 1.74 kB
../web3-eth/lib/commonjs/validation.js 📉 -325 B (-2.37%) 13.38 kB → 13.06 kB
../web3-eth-abi/lib/commonjs/coders/base/bool.js 📉 -53 B (-2.52%) 2.05 kB → 2 kB
../web3-utils/lib/commonjs/promise_helpers.js 📉 -189 B (-2.70%) 6.83 kB → 6.65 kB
../web3-eth-abi/lib/commonjs/coders/decode.js 📉 -35 B (-2.74%) 1.25 kB → 1.21 kB
../web3-eth-abi/lib/commonjs/coders/base/string.js 📉 -54 B (-3.41%) 1.55 kB → 1.49 kB
../web3-eth-abi/lib/commonjs/coders/utils.js 📉 -170 B (-3.49%) 4.75 kB → 4.59 kB
../web3-eth-accounts/lib/commonjs/tx/types.js 📉 -64 B (-3.58%) 1.75 kB → 1.69 kB
../web3-utils/lib/commonjs/uint8array.js 📉 -85 B (-4.12%) 2.01 kB → 1.93 kB
../web3-rpc-methods/lib/commonjs/net_rpc_methods.js 📉 -69 B (-4.29%) 1.57 kB → 1.5 kB
../web3-rpc-methods/lib/commonjs/eth_rpc_methods.js 📉 -1.35 kB (-6.38%) 21.22 kB → 19.86 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
../lib/commonjs/accounts.d.ts 3.89 kB → 4.45 kB (+572 B) +14.35%
../lib/commonjs/abi.d.ts 999 B → 1.05 kB (+73 B) +7.31%

Smaller

Asset File Size % Changed
web3.min.js 621.32 kB → 618.46 kB (-2.86 kB) -0.46%
../lib/commonjs/web3_eip6963.d.ts 1.28 kB → 1.27 kB (-8 B) -0.61%

Unchanged

Asset File Size % Changed
../lib/commonjs/index.d.ts 8.69 kB 0%
../lib/commonjs/types.d.ts 2.67 kB 0%
../lib/commonjs/web3.d.ts 1.38 kB 0%
../lib/commonjs/eth.exports.d.ts 280 B 0%
../lib/commonjs/providers.exports.d.ts 183 B 0%
../lib/commonjs/version.d.ts 60 B 0%

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.46%. Comparing base (cc99825) to head (32c8cc8).

Additional details and impacted files
@@            Coverage Diff             @@
##              4.x    #7272      +/-   ##
==========================================
+ Coverage   94.44%   94.46%   +0.02%     
==========================================
  Files         216      216              
  Lines        8463     8533      +70     
  Branches     2339     2339              
==========================================
+ Hits         7993     8061      +68     
- Misses        470      472       +2     
Flag Coverage Δ
UnitTests 94.46% <92.85%> (+0.02%) ⬆️

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

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 8c17262 Previous: cc99825 Ratio
processingTx 22167 ops/sec (±6.72%) 21879 ops/sec (±7.68%) 0.99
processingContractDeploy 38000 ops/sec (±8.48%) 38811 ops/sec (±6.95%) 1.02
processingContractMethodSend 15290 ops/sec (±7.78%) 15153 ops/sec (±7.20%) 0.99
processingContractMethodCall 26462 ops/sec (±6.94%) 27291 ops/sec (±6.06%) 1.03
abiEncode 42440 ops/sec (±7.70%) 41796 ops/sec (±7.77%) 0.98
abiDecode 29709 ops/sec (±7.88%) 28813 ops/sec (±7.30%) 0.97
sign 1485 ops/sec (±3.42%) 1512 ops/sec (±0.76%) 1.02
verify 359 ops/sec (±0.63%) 359 ops/sec (±0.56%) 1

This comment was automatically generated by workflow using github-action-benchmark.

@Muhammad-Altabba Muhammad-Altabba changed the title [DRAFT] fix typescript version issue update typescript version to 5 Sep 23, 2024
@Muhammad-Altabba Muhammad-Altabba marked this pull request as ready for review September 23, 2024 13:22
@@ -137,7 +137,7 @@
"typedoc-plugin-markdown": "^3.17.0",
"typedoc-plugin-mdn-links": "^2.0.0",
"typedoc-plugin-merge-modules": "^5.1.0",
"typescript": "^4.7.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we are updating at devDependencies, there should be no issues with the braking changes except with our code that I needed to update at few places for the detected issues.

But for the users of our lib there should be, theoretically no issues at all. However, there could be some very edge case that I am not aware of. But according to my search and up to my knowledge, there should be no issues for the users.

Copy link
Contributor

Choose a reason for hiding this comment

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

types created as output of build using TS in this PR are fully backward compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to my reading, the generated JavaScript is only affected by the targeted ECMA Script. And for the same ECMA Script, the transpiled code is compatible. I checked few of the generated JavaScript source code and things seems almost identical and 100% compatible.

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.

abitype@npm:0.7.1 [20ff3] → >=4.9.4 ✘
3 participants