Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 04da750

Browse files
authored
Merge branch '4.x' into ok/6835-Research
2 parents e53e0bc + bd6cc71 commit 04da750

File tree

4 files changed

+41
-20
lines changed

4 files changed

+41
-20
lines changed

.github/CONTRIBUTING.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Contributing
22

3-
Thank you for contributing to web3.js! We appreciate your interest and welcome any contributions that can help improve our documentation, functionality, addressing bugs, or any other aspects that can contribute to the overall improvement of our project. Before you start contributing, please take a moment to review the guidelines below.
3+
Thank you for contributing to Web3.js! We appreciate your interest and welcome any contributions that can help improve our documentation, functionality, address bugs, or any other aspects that can contribute to the overall improvement of our project. Before you start contributing, please take a moment to review the guidelines below.
44

55
## Help and Support
66

7-
If you face any issues while contributing, or you want any type of support, we encourage you to join our [Discord Community](https://discord.com/invite/3shNX8cqGR) and ask any question in the `#web3js-general` channel, and/or submit a [New Issue](https://github.com/web3/web3.js/issues/new).
7+
If you face any issues while contributing or want any type of support, we encourage you to join our [Discord Community](https://discord.com/invite/3shNX8cqGR), ask any question in the `#web3js-general` channel, and/or submit a [new issue](https://github.com/web3/web3.js/issues/new).
88

99
## Prerequisites
1010

@@ -15,12 +15,12 @@ If you face any issues while contributing, or you want any type of support, we e
1515

1616
1. **Fork the docs:** Start by forking our repository to your GitHub account.
1717

18-
2. **Clone the repo:** Clone the forked repository to your local machine using the following command
18+
2. **Clone the repo:** Clone the forked repository to your local machine using the following command:
1919
```bash
2020
git clone https://github.com/your-username/web3.js.git
2121
```
2222
3. **Create a Branch:** Create a new branch for your changes with a descriptive name.
23-
**NOTE: The branch name must include the issue number (if there is no issue created for your contribution, please create one)**
23+
**NOTE: The branch name must include the issue number (if there is no issue created for your contribution, please create one).**
2424
```bash
2525
git checkout -b issue-name-1234
2626
```
@@ -32,7 +32,7 @@ yarn
3232
```
3333
6. **Make your changes:**...
3434

35-
7. Check changes in local environment: Run the command `yarn start` and you'll see a local environment in `localhost:3000` with the docs
35+
7. Check changes in the local environment: Run the command `yarn start` and you'll see a local environment in `localhost:3000` with the documents.
3636

3737
8. **Commit your changes:** `git add .` and `git commit -m 'descriptive msg'`
3838

@@ -41,9 +41,9 @@ yarn
4141
git push origin branch-name
4242
```
4343

44-
10. **Open a Pull request(PR):** Provide a detailed description of your changes, the problem you are solving, and any additional context(you can use the PR template).
44+
10. **Open a Pull Request (PR):** Provide a detailed description of your changes, the problem you are solving, and any additional context (you can use the PR template).
4545

46-
11. **Wait for review**: Before merging any branch into the main branch, it must be approved by 2 devs, after succesfully approved, you can `Squash and merge` your branch, Please be responsive to any feedback on your pull request and make necessary changes based on the review.
46+
11. **Wait for review**: Before merging any branch into the main branch, it must be approved by two devs, after it is successfully approved, you can `Squash and merge` your branch, Please be responsive to any feedback on your pull request and make necessary changes based on the review.
4747

4848
## Guidelines for Pull Requests and Releases (Web3 4.x)
4949

@@ -54,25 +54,25 @@ that **Web3 not break**.
5454
### Pull Requests for substantive changes (e.g. everything except comments and docs)
5555

5656
1. Any PR that introduces a logic change should include tests. (In many cases, the tests will take more time to write than the actual code).
57-
1. All PRs should sit for 72 hours with the `pleasereview` tag in order to garner feedback.
57+
1. All PRs should sit for 72 hours with the `please review` tag to garner feedback.
5858
1. No PR should be merged until it has been reviewed, passes CI, and all reviews' comments are
5959
addressed.
6060
1. PRs should:
6161
1. have a narrow, well-defined focus.
6262
1. make the smallest set of changes possible to achieve their goal.
6363
1. include a clear description in the opening comment.
6464
1. preserve the conventions and stylistic consistency of any files they modify.
65-
1. Given the choice between a conservative change that mostly works and an adventurous change which seems better but introduces uncertainty - prefer the conservative change.
65+
1. Given the choice between a conservative change that mostly works and an adventurous change that seems better but introduces uncertainty - prefer the conservative change.
6666

6767
### Reviews
6868

69-
The end goal of review is to suggest useful improvements to the author. Reviews should finish with approval unless there are issues that would result in:
69+
The end goal of the review is to suggest useful improvements to the author. Reviews should finish with approval unless there are issues that would result in:
7070

71-
1. Buggy behaviour.
71+
1. Buggy behavior.
7272
1. Undue maintenance burden.
73-
1. Pessimisation (i.e. speed reduction / meaningful build-size increases).
73+
1. Pessimisation (i.e. speed reduction or meaningful build-size increases).
7474
1. Feature reduction (i.e. it removes some aspect of functionality that users rely on).
75-
1. Avoidable risk (i.e it's difficult to test or hard to anticipate the implications of, without
75+
1. Avoidable risk (i.e. it's difficult to test or hard to anticipate the implications of, without
7676
being strictly necessary to fix something broken).
7777

7878
Read more in [Review Guidelines](./REVIEW.md).
@@ -85,9 +85,9 @@ Read more in [Review Guidelines](./REVIEW.md).
8585
1. Changes should trigger a new `rc` release and set the release clock back enough that reviewers have the time they need to test new changes.
8686
1. Regular maintainers should manually test the `rc` against a Node project and the published
8787
minified bundle in a browser context. An external reviewer should verify they've done the same.
88-
1. A release PR must be approved at least by two known contributors of the web3.js project.
88+
1. A release PR must be approved at least by two known contributors to the web3.js project.
8989

90-
Read more in [Release Guidelines](./RELEASE.md).
90+
Read more in the [Release Guidelines](./RELEASE.md).
9191

9292
### Emergencies
9393

.github/workflows/build.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ jobs:
8989
uses: actions/cache/restore@v3
9090
with:
9191
path: packages/web3/dist/4.x.json
92-
key: web3-bundle-stats-4x-${{github.sha}}
92+
key: web3-bundle-stats-4x-${{github.event.pull_request.base.sha}}
9393
- run: yarn build:web:analyze
9494
env:
9595
STATS_FILE: ${{ github.ref_name }}.json
9696
- name: Compare bundle stats
97-
uses: github/webpack-bundlesize-compare-action@v1
98-
if: github.event_name != 'push'
97+
uses: github/webpack-bundlesize-compare-action@v1.8.2
9998
continue-on-error: true
10099
with:
101100
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -105,9 +104,10 @@ jobs:
105104
uses: actions/cache/save@v3
106105
if: github.event_name == 'push' && github.ref == 'refs/heads/4.x'
107106
with:
108-
path: packages/web3/dist/4.x.json
107+
path: packages/web3/dist/${{ github.ref_name }}.json
109108
key: web3-bundle-stats-4x-${{github.sha}}
110109

110+
111111
unit:
112112
name: Unit Tests
113113
needs: build
@@ -239,7 +239,7 @@ jobs:
239239
path: ./
240240
key: web3-18-${{github.sha}}
241241
# @octokit/core not supported on node 16, so I can't add it to the package.json
242-
- run: npm install --no-package-lock --no-save --force @octokit/core
242+
- run: npm install --no-package-lock --no-save --force @octokit/core@5.1.0
243243
- name: Restore main branch benchmark data
244244
uses: actions/cache/restore@v3
245245
with:

docs/docs/guides/web3_upgrade_guide/1.x/accounts_migration_guide.md

+11
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,14 @@ const wallet = web3.eth.accounts.wallet.create(1, 'optionalEntropy'); // entropy
3434
const account = web3.eth.accounts.wallet.create(1, 'optionalEntropy'); // will result in an error
3535
const account = web3.eth.accounts.wallet.create(); // correct way
3636
```
37+
38+
## stripHexPrefix method
39+
40+
In 1.x `stripHexPrefix` method is located in the `web3-utils` package, in 4.x this has been moved to `web3-eth-accounts`
41+
42+
```typescript
43+
import { stripHexPrefix } from 'web3-eth-accounts';
44+
45+
console.log(stripHexPrefix('0x123')); // "123"
46+
47+
```

docs/docs/guides/web3_upgrade_guide/1.x/web3_utils_migration_guide.md

+10
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ isHex('-0x'); // in 1.x used to return `true`. But changed in 4.x to return `fal
7979

8080
isHexStrict('-0x'); // in 1.x used to return `true`. But changed in 4.x to return `false`
8181
// `false`
82+
```
83+
## stripHexPrefix method
84+
85+
In 1.x `stripHexPrefix` method is located in the `web3-utils` package, in 4.x this has been moved to `web3-eth-accounts`
86+
87+
```typescript
88+
import { stripHexPrefix } from 'web3-eth-accounts';
89+
90+
console.log(stripHexPrefix('0x123')); // "123"
91+
8292
```
8393

8494
## Other functions

0 commit comments

Comments
 (0)