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

JS bindings #55

Merged
merged 55 commits into from
Apr 5, 2019
Merged

JS bindings #55

merged 55 commits into from
Apr 5, 2019

Conversation

antouhou
Copy link
Contributor

Hi! My name is Anton. I'm a JavaScript developer at Dash. As you may know, we are using the bls-signatures library in our core project. We also support BitPay's JS stack, which means that we have a set of wallet JS libraries.

I've ported bls-signatures lib to JavaScript and created bindings. This port uses Emscripten to compile C++ to WASM bytecode. It also includes TypeScript bindings, so the port can be used with typescript and has IntelliSense support in all major IDEs.

… Added some bindings and tests for the bindings
…avoid raw memory views, as they can lead to a data corruption; Modify CMake bindings config to make CMake working properly;
…avoid raw memory views, as they can lead to a data corruption; Modify CMake bindings config to make CMake working properly;
…o class; Separated helpers to header and implementation
… js tests to the build dir; Make CMake install npm dependencies after the build; Make tests to require lib from the parent dir
Copy link
Contributor

@mariano54 mariano54 left a comment

Choose a reason for hiding this comment

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

Thank you for all your work Anton!

```

Run the build after any changes to the library, including readme and tests, as the library will be deployed from the build directory, and the build system copies all the files from the source dir.
### Run tests
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the browser compatibility like? We should add a note on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will work in all browsers that support WASM, meaning Chrome, Firefox, Safari, Edge (Not IE, unfortunately). It is ~85% of currently existing devices: https://caniuse.com/#feat=wasm. Browsers support can be extended further by including asm.js build as well. asm.js has broader support among older browsers (it's supported by all major browsers since the middle of 2013, except Safari, which is WASM-only). I'm not sure what is the best way to include both builds at the same time in one package, so I've added only WASM build. WASM has wider adoption (because of Safari), and has about 10x faster execution times.

@mariano54 mariano54 merged commit 683a148 into Chia-Network:master Apr 5, 2019
PastaPastaPasta pushed a commit to PastaPastaPasta/bls-signatures that referenced this pull request Feb 22, 2023
…d as vendored dependency (Chia-Network#55)

* build: drop minialloc from build system

* depends: drop minialloc from source tree

* Squashed 'depends/mimalloc/' content from commit 91ba1f374

git-subtree-dir: depends/mimalloc
git-subtree-split: 91ba1f374da66e624841f53f6659da3a8f8f93ea

* build: add mimalloc to build system, set as default (de)allocator
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

Successfully merging this pull request may close these issues.

2 participants