-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
fix: allocate shared buffer at runtime to fix browser compatibility #7023
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #7023 +/- ##
============================================
- Coverage 49.24% 49.23% -0.01%
============================================
Files 578 578
Lines 37438 37441 +3
Branches 2162 2162
============================================
Hits 18435 18435
- Misses 18963 18966 +3
Partials 40 40 |
Performance Report✔️ no performance regression detected Full benchmark results
|
I prefer having a new export |
We can make it similar to api package which has /server, it is probably the best long-term solution |
Motivation
In #7016 we added a shared buffer which is allocated at load time in the utils packages. This is problematic as it breaks browser compatibility if Buffer is not polyfilled for every package that imports
@lodestar/utils
which is pretty much all of our packages.Description
Allocate shared buffer at runtime to avoid running into
ReferenceError: Buffer is not defined
when importing utils packages in a browser environment without polyfills.