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

ensure backward compatibility for Web3 constructor #5221

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

Muhammad-Altabba
Copy link
Contributor

Description

Fixes #(5196)

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 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 yarn 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.

@Muhammad-Altabba Muhammad-Altabba added the 4.x 4.0 related label Jul 7, 2022
@Muhammad-Altabba Muhammad-Altabba marked this pull request as draft July 7, 2022 22:28
Copy link
Contributor

@nazarhussain nazarhussain left a comment

Choose a reason for hiding this comment

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

Please make this change to every default export in all the packages.

packages/web3/src/index.ts Outdated Show resolved Hide resolved
@Muhammad-Altabba
Copy link
Contributor Author

With the last commit, the export and import behaves exactly as it was in version 1.x (this is as far as I know. And let me know if this is not true) 😄

However, this also means that the types inside web3 package are no longer exported. So, I recommend having a follow-up task to put those types possibly at web3-core. This can be done perhaps in beta or at a later version. And this could be done along with the refactoring proposed at #5223, or separately.

@Muhammad-Altabba Muhammad-Altabba marked this pull request as ready for review July 13, 2022 18:26
@Muhammad-Altabba Muhammad-Altabba dismissed nazarhussain’s stale review July 13, 2022 19:42

The line, where the comment was on, has been deleted

Copy link
Contributor

@nazarhussain nazarhussain left a comment

Choose a reason for hiding this comment

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

Apart form the mentioned change, we need to apply same changes to all packages which are using export default.

packages/web3/src/index.ts Show resolved Hide resolved
@Muhammad-Altabba Muhammad-Altabba force-pushed the fix/5196/fix-web3-default-import-with-js branch from 0f6ca5a to 071959c Compare July 14, 2022 15:18
@jdevcs
Copy link
Contributor

jdevcs commented Jul 18, 2022

lgtm, plus we should add simplest blackbox tests as well #5261 as part of new PR

@Muhammad-Altabba Muhammad-Altabba force-pushed the fix/5196/fix-web3-default-import-with-js branch 3 times, most recently from 4028893 to 18078f3 Compare July 19, 2022 08:42
@Muhammad-Altabba Muhammad-Altabba force-pushed the fix/5196/fix-web3-default-import-with-js branch from 7e83fa3 to b2c957f Compare July 19, 2022 09:54
Signed-off-by: Muhammad-Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>
@Muhammad-Altabba Muhammad-Altabba force-pushed the fix/5196/fix-web3-default-import-with-js branch from b2c957f to 603d525 Compare July 19, 2022 10:01
@Muhammad-Altabba Muhammad-Altabba merged commit 85a86d2 into 4.x Jul 19, 2022
@Muhammad-Altabba Muhammad-Altabba deleted the fix/5196/fix-web3-default-import-with-js branch July 19, 2022 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants