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

Create browser build for @arkecosystem/crypto #3784

Closed
faustbrian opened this issue Jun 9, 2020 · 2 comments
Closed

Create browser build for @arkecosystem/crypto #3784

faustbrian opened this issue Jun 9, 2020 · 2 comments

Comments

@faustbrian
Copy link
Contributor

faustbrian commented Jun 9, 2020

The primary issue is the usage of native BigInt that cause issues in browsers like Safari. This should be polyfilled if the native BigInt is not available.

Replacing the native BigInt altogether is not a solution because the performance loss on node.js is too big with some of our new transaction types from AIP11.

https://github.com/ArkEcosystem/mobile-wallet/blob/develop/webpack.config.js#L44-L53

@faustbrian faustbrian added this to the 3.0.0 milestone Jun 9, 2020
@RoukePouw
Copy link

RoukePouw commented Jun 17, 2020

This webpack config did not work for me. I was successful shimming bigint by using

  new webpack.ProvidePlugin({
    BigInt: "big-integer"
  }),

note the use of ProvidePlugin instead of DefinePlugin (and a different shim, using npm i big-integer)

I also solved an issue with f.promisify by shimming util_1 which was used in dist/sleep.js

This way I was succesful in building for Safari as well

@faustbrian
Copy link
Contributor Author

#3830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants