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
Add browser docs #3329
base: master
Are you sure you want to change the base?
Add browser docs #3329
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Building for the browser | ||
|
||
One of the goals of our libraries is to be fully browser compatible. We have examples using the [`vite`](https://vitejs.dev/) framework in each of the libraries that can be referenced as a jumping off point. | ||
|
||
## Projects that use EthereumJS libraries in the browser | ||
|
||
Here are some projects that use our libraries in browser to give you some inspiration. These are not guaranteed to be 100% up to date but give you some examples of projects that use our code. | ||
|
||
- [TEVM](https://github.com/evmts/tevm-monorepo) - a JavaScript EVM client and a Solidity-to-TypeScript compiler | ||
- [Remix](https://remix.ethereum.org/) - a browser based Soldity compiler | ||
- [Blobs4Every1](https://github.com/acolytec3/blobs4every1) - a simple Vite + React web app that can generate Blob EIP 4844 Transactions and submit them to the Holesky chain | ||
|
||
## Potential Gotchas | ||
|
||
Some of our libraries use Javascript APIs where the NodeJS and browser versions are not 100% equivalent. In these cases, these APIs need to be polyfilled when building for the browser. Below are known potential browser incompatibilities and polyfills that are known to work in browser. Please refer to your particular bundler/framework on guidance for how to leverage these polyfills in your application. | ||
|
||
- `events` - [`eventemitter3`](https://www.npmjs.com/package/eventemitter3) - Our usage of the native NodeJS `eventemitter` class apparently onflicts with the typing of the browser equivalent `eventemitter` and polyfilling with `eventemitter3` is known to resolve this | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that we are in discussion of also eliminate this major remaining gotcha, I wonder if there is enough substance left in the whole browser section to justify a separte document. 🤔 Basically only the examples left to stay for now. Totally not against adding example projects, but maybe in this case we can move TEVM and Remix to the EVM, I would suggest a new section "External Projects" or "Using Projects" or similar in between here: And Blobs4Every1 can go into the 4844 tx section of the tx library? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️