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

Browser Bundle Improvements #200

Merged
merged 9 commits into from
Jan 26, 2023
Merged

Browser Bundle Improvements #200

merged 9 commits into from
Jan 26, 2023

Conversation

mistermoe
Copy link
Member

Addresses #199

* include safari and firefox as targets
* run headless browser tests in safari and firefox
* use non-abandoned polyfill lib
@mistermoe mistermoe changed the title bump ed25519 and secp256k1 libs Browser Bundle Improvements Jan 24, 2023
@mistermoe
Copy link
Member Author

halved the bundle size by importing the 1 lodash function we're using instead of the entire lib
image

@mistermoe
Copy link
Member Author

included firefox108 and safari16 as build targets for browser bundle.

@mistermoe
Copy link
Member Author

configured karma to run tests in WebkitHeadless and FirefoxHeadless

@mistermoe
Copy link
Member Author

switched node stdlib polyfill lib from @esbuild-plugins/node-globals-polyfill to node-stdlib-browser.

node-globals-polyfill had us stuck on esbuild version 0.14.39. esbuild is on 0.17.4 now with some relatively large improvements including support for hermes as a build target. this is particularly useful for us as hermes is on its way to becoming the defacto JS engine for react native.

Still blocked on bumping all the way up to 0.17.4 as it's not supported by karma-esbuild yet which we use to test our browser bundle in headless browsers. karma-esbuild PR to support esbuild 0.17 is up though and approved. just waiting to be merged.

additionally, node-globals-polyfill seems largely unmaintained. relevant issue here

up to date, audited 633 packages in 1s

118 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
@mistermoe
Copy link
Member Author

published v0.0.18-unstable.2c05feb-2023.1.24-11-24-27 to npm so that we can test. need to test the following environments:

  • cjs (node)
  • esm (node)
  • browser
  • react-native

@thehenrytsai can you pull this branch down and run npm run test:browser to make sure it works on your end?

@mistermoe
Copy link
Member Author

fixed an issue. new unstable version is 0.0.18-unstable.c04518c-2023.1.24-11-57-22

@thehenrytsai
Copy link
Member

thehenrytsai commented Jan 24, 2023

@thehenrytsai can you pull this branch down and run npm run test:browser to make sure it works on your end?

@mistermoe all tests passed on my end, with a nit that only the last batch of WebkitHeadless test results seemed to have printed out to console.

thehenrytsai
thehenrytsai previously approved these changes Jan 24, 2023
shamilovtim
shamilovtim previously approved these changes Jan 25, 2023
Copy link
Member

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

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

Seriously, what do we do without you! 🥇

@mistermoe mistermoe merged commit a59d519 into main Jan 26, 2023
@mistermoe mistermoe deleted the bump-noble-libs branch January 26, 2023 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants