Commit Graph

25 Commits

Author SHA1 Message Date
Caleb Kniffen
38b385969b feat: remove Buffer support and bundle polyfill (#2526)
- 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>
2024-02-01 13:53:41 -06:00
Nicholas Dudfield
217b111ef2 feat: use @noble and @scure libraries for cryptography (#2273)
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>
2024-02-01 13:50:19 -06:00
Caleb Kniffen
1a83997e49 feat: add xrpl-secret-numbers to the monorepo (#2445)
- 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.
2024-02-01 13:45:11 -06:00
Greg Weisbrod
2b42427634 convert existing xrpl library into a lerna monorepo 2021-11-04 23:18:23 -04:00
ledhed2222
bd154fd6e8 lint filenames (#1757)
* build: update @xrplf/typescript-style

* fix filename casing

* fix webpack setup

* add missing eslint plugin

Co-authored-by: Nathan Nichols <natenichols@cox.net>
2021-10-19 16:08:46 -04:00
Mayukha Vadari
6bbd593ed7 build: webpack bn.js only once instead of many times (#1750)
* stop webpacking bn multiple times

* add to test webpacking

* fix webpacking issues, make sure tests work

* remove debugging leftovers

* add link to github issue

* revert package-lock changes

* uncomment dev mode webpacking

* increase browser test timeout
2021-10-19 10:26:00 -04:00
Mayukha Vadari
61b2cb7fb6 build: reduce webpack size of bip39 (#1747)
* remove non-english wordlists from bip39

* add webpack change to tests

* add bundlephobia badge
2021-10-18 18:10:14 -04:00
Nathan Nichols
5b9e3dbdc4 refactor: separate out webpacking for tests (#1678) 2021-10-04 14:11:26 -04:00
Nathan Nichols
0996dc13b7 fix: adds mode to webpack to stop warning (#1666) 2021-10-04 14:11:26 -04:00
Mayukha Vadari
564001515d test: add integration tests for Account requests (#1643) 2021-10-04 14:10:14 -04:00
Mayukha Vadari
57a6586898 fix: run browser tests on all integration tests (#1649)
* attempt to webpack all tests

* fix browser tests

* remove console.log
2021-10-04 14:10:13 -04:00
Nathan Nichols
c5f47cbffc rename browser library (#1637)
* rename browser library
2021-10-04 14:10:13 -04:00
Nathan Nichols
33f83947f1 build: rename ripple-lib to xrpl.js (#1608)
* build: rename ripple-lib to xrpl.js
2021-10-04 14:10:12 -04:00
Omar Khan
e0f4d99d86 Refactor generateFaucetWallet to return a Wallet (#1564)
* add Wallet.generate() and 

* return Wallet in generateFaucetWallet

* refactor Wallet tests

* rename wallet-generation.ts to generateFaucetWallet.ts

* rename and move Wallet.ts to src/wallet/index.ts and update webpack config
2021-10-04 14:10:11 -04:00
Nathan Nichols
8b95ee5fab build: Initial linting setup (#1560)
* sets up linting config and runs `yarn lint --fix` once, so that all changes will show up correctly in future PRs.

* Note that there are still a lot of linter errors.
2021-10-04 14:10:10 -04:00
Mayukha Vadari
12cfed5c17 refactor: clean up Client and associated files (#1556)
* remove _PRIVATE

* make requestAll public

* un-type connection.request

* fix lodash imports

* add comments

* Rename files to camelCase
2021-10-04 14:10:10 -04:00
Mayukha Vadari
f9fe5936b1 refactor: rename all test files to camelCase (#1562)
* rename files to camelCase

* fix imports

* more renames

* pull all client tests out of individual folders

* fix imports

* fix tests
2021-10-04 14:10:10 -04:00
Mayukha Vadari
73109295b4 Rename RippleAPI client to Client (#1520)
* rename RippleAPI -> XrplClient

* more renames

* move API stuff to client folder

* rename all api -> client

* fix tests

* make tests run

* fix integ tests

* fix urls

* fix merge issues

* XrplClient -> Client

* fix merge issues

* rename xrpl-client npm symlink to xrpl-local
2021-10-04 14:10:08 -04:00
Nathan Nichols
5f0c38531c build: include lodash in webpack build (#1500)
* build: include lodash in webpack build
2021-08-10 07:43:52 -07:00
Florent
69113de552 Generate faucet wallet Testnet and Devnet (#1497)
* generate faucet wallet

* updated comments

* added example in documentation

* updated documentation

* Added xprl.org link in docs

* updated code snippet

* Made changes from comments

* new changes from comments

* yarn.lock

* removed axios and use https.request

* updated webpack to include http and https fallback

* fixed files formatting

* small fixes

* Fix typo for Testnet

Co-authored-by: Elliot Lee <github.public@intelliot.com>

Co-authored-by: Elliot Lee <github.public@intelliot.com>
2021-08-10 15:20:43 +08:00
Nathan Nichols
76780c8a8e Run Integration Tests in Browser (#1468)
* ci: Adds github actions testing for webpacked integration test
2021-08-02 16:29:35 -05:00
Nathan Nichols
e8817d9e0b build(webpack): update to webpack 5 (#1336)
Co-authored-by: Elliot Lee <github.public@intelliot.com>
2020-12-07 10:00:57 -08:00
Elliot Lee
96605a57d4 Fix CDNs (#1142)
* Rename browser build output file to ripple-latest-min.js (the name prior to #1061)
* Add unpkg and jsdelivr
2019-12-28 11:46:52 -08:00
Fred K. Schott
4c41b7f8df revert name change 2019-11-05 08:13:27 -08:00
Fred K. Schott
c5d0c24237 update webpack flow 2019-11-04 21:33:39 -08:00