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

Add browser docs #3329

Closed
wants to merge 2 commits into from
Closed

Add browser docs #3329

wants to merge 2 commits into from

Conversation

acolytec3
Copy link
Contributor

This adds an initial readme for building for the browser.

  • Lists a few projects that use our code in browser
  • Lists knoown dependency incompatibilities that require polyfills

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.90%. Comparing base (48e6a30) to head (46aa89d).
Report is 253 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.43% <ø> (ø)
blockchain 91.61% <ø> (ø)
client 84.85% <ø> (ø)
common 98.43% <ø> (ø)
devp2p 82.12% <ø> (ø)
ethash ∅ <ø> (∅)
evm 74.10% <ø> (ø)
genesis 99.98% <ø> (ø)
rlp ∅ <ø> (?)
statemanager 77.08% <ø> (ø)
trie 89.32% <ø> (ø)
tx 95.08% <ø> (ø)
util 89.34% <ø> (ø)
vm 79.90% <ø> (ø)
wallet 88.35% <ø> (ø)

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

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Some general comments with questions/suggestions on how to proceed here.

config/BROWSER.md Outdated Show resolved Hide resolved

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
Copy link
Member

Choose a reason for hiding this comment

The 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:

grafik

And Blobs4Every1 can go into the 4844 tx section of the tx library?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with this approach, provided we can make #3330 work. Will leave this PR here for the moment until #3330 is closed or merged.


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
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

@roninjin10
Copy link
Collaborator

an idea to add to this is to addstack blitz example using ethereumjs in browser. Cool thing about that is you can get a forkable working example up and running in one click.

I did an example of what this looks like for OP here: ethereum-optimism/docs#574

@acolytec3
Copy link
Contributor Author

an idea to add to this is to addstack blitz example using ethereumjs in browser. Cool thing about that is you can get a forkable working example up and running in one click.

I did an example of what this looks like for OP here: ethereum-optimism/docs#574

That's brilliant! I'm gonna have to try that out.

@holgerd77
Copy link
Member

Will close this, so much changed along the way and not necessarily the best way to integrate docs any more.

@holgerd77 holgerd77 closed this Oct 9, 2024
@holgerd77 holgerd77 deleted the browser-docs branch October 9, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants