- Removes need for bundlers to polyfill the `Buffer` class. `UInt8Array` are used instead which are native to the browser and node.
- Reduces bundle size 7.1kb gzipped and eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
BREAKING CHANGE: All methods that previously took a `Buffer` now accept a `UInt8Array`.
---------
Co-authored-by: Jackson Mills <jmills@ripple.com>
Reduces filesize by 3kb minified and gzipped or 2.8% and reduces bundler
config steps.
- Move `WSWrapper` to `@xrpl/isomorphic` to remove the need to add
mapping of `ws` to `WSWrapper` file in bundler configs
- Switch to `eventemitter3` which is smaller than `events` by almost
1kb and will not require a mapping to node's `events` in `vite`
bundling. `webpack` always automatically maps it.
- max listeners is not a thing for `eventemitter3` so we do not
need to set it to `Infinity`. `ws` uses the native event emitter which
does still need that to be set.
- Remove `eventemitter2` which was only used in tests and was replaced
with `eventemitter3`
BREAKING CHANGE: Config for frontend bundlers has changed for `ws`.
Switch to using `@noble/hashes`, `@noble/curves`, `@scure/base`,
`@scure/bip32`, and `@scure/bip39`. This replaces `crypto` polyfills
(such as `crypto-browserify`), `create-hash`, `elliptic`, `hash.js`,
`bn.js` (both versions), and their many dependencies. This also means
there are 33 less dependencies downloaded when running a fresh
`npm install` and will make the project much easier to maintain.
This reduces the bundle size by 44% (82kb minified and gzipped) over
the current 3.0 branch as well as reducing the amount of configuration
required to bundle.
Closes#1814, #1817, #2272, and #2306
Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
This is done by properly deleting all build files.
Package-lock was due to it not reflecting the license of
@xrplf/secret-numbers. This was fixed by running `npm i`.
- Add `xrpl-secret-numbers` by @WietseWind to the mono repo.
- `unpkg` and `jsdelivr` support was simplified by adding fields to package.json.
- Unit tests run in a browser and node.
BREAKING CHANGES:
- `xrpl-secret-numbers` is now `@xrplf/secret-numbers`.
- Changed the bundled file produced changed from `dist/browerified.js` to `build/xrplf-secret-numbers-latest.js`.
- Bundle variable is `xrplf_secret_numbers` instead of using browserify's loader.
- If using CDN instructions in README will need to update to `https://cdn.jsdelivr.net/npm/@xrplf/secret-numbers`
Making this library part of the monorepo was discussed in #1788. This solves several problems with the upcoming `xrpl.js@3.0`.
`xrpl-secret-numbers` has a dependency of `ripple-keypairs` and `xrpl` has a depenendecy on `xrpl-secret-numbers`. This means that any change would require a separate release of `ripple-keypairs`, then a release of `xrpl-secret-numbers`, followed by `xrpl`. Now they can be released all at once
In 3.0 we eliminated the need for many polyfills like `util`, `assert`, and soon to be `buffer` (after noble libs PR is merged). `xrpl-secret-numbers` still needs those. This will also eliminate them and anytime similar changes in the future will be much easier. This further reduces the bundle size of 3.0 branch by over 10% as well as reducing bundler setup.
* fix: make docs not output confusing information in xrpl client
---------
Co-authored-by: Jackson Mills <jmills@ripple.com>
Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
Removes the testing polyfills by using jasmine and not jest in the
browser. We were already using jasmine but where overriding those
methods with jest versions which was not needed.
The previous karma setup also used a single entrypoint which meant that
not all integration tests were running because all files were not
imported in integrations/index.ts.
This also eliminates 79 dev dependencies.
Switch to using fetch for browser and `node-fetch` for node for the faucet calls. This reduces the webpack bundle by 3.2% or 16.5kb gzipped.
The fundWallet code has been refactored to be much more straight forward due to not having to do such low level operations.
This improves the frontend setup process by no longer requiring several polyfills such as `url`, `stream-http`, and `https-browserify`.
Bump https-proxy-agent to v7 and a dev dependency. This makes
configuring bundlers easier to configure and removes a direct
dependency of `https-proxy-agent`.
BREAKING CHANGE: Configuring a proxy is done by specifying the
`agent` parameter on the ConnectionOptions config. This can use be
created by libraries such as `https-proxy-agent` or any that
implements `http.Agent`.
Reduces the bundle size by 8% (41kb)
BigInteger is now well supported so the library is no longer needed.
BigNumber was already being used by xrpl and they had almost identical
interfaces as they are both based on Java.
This will reduce the bundle size by ~23%(117kb).
Only 4 methods were used `flatten`, `flatMap`, `omitBy`, and `groupBy`.
`omitBy and `groupBy` were recreated while the es2019 implementations of
`flatten` and `flatMap` are used.
`lodash` is still used in the tests which is fine because it makes the
tests cleaner.
Closes#2118