oasislabs / oasis.js

🕸A web client for the Oasis platform
Apache License 2.0
33 stars 11 forks source link

Uniform node and browser module imports with rollup #25

Open armaniferrante opened 5 years ago

armaniferrante commented 5 years ago

Currently, we have some utility modules that dispatch based based upon whether we're in a browser environment or not. We should be able to remove these by configuring Rollup to import the modules correctly.

For example, we we import tweetnacl like this with this file.

Also our EventEmitter imports need fixing (e.g., see https://github.com/oasislabs/oasis.js/issues/25), as they are causing us to use any types.

armaniferrante commented 5 years ago

Mostly done by https://github.com/oasislabs/oasis-client/pull/73.

The last thing we should do here is replace this file with an import: https://github.com/oasislabs/oasis-client/blob/master/packages/confidential/src/tweetnacl.ts

armaniferrante commented 5 years ago

Another one https://github.com/oasislabs/oasis.js/commit/de69353865ee98247f11dc28b829ec52ee1f6896#diff-81ec44e2202d86803f3d36efd4d65ddbR3.