-
Notifications
You must be signed in to change notification settings - Fork 512
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
Remove lodash
from the xrpl package
#2118
Comments
@develoQ I am up for removing lodash all together if the methods used can be done in modern js. |
@ckniffen Exactly, most things are very easy with some map/reduce/filter/... these days. |
I believe I tried to remove as much lodash as possible at some point, but in some places there were really nice functions like |
Ugly piece of code, idea is clear, reducer could be a more generic fn of course. const people = [
{ name: 'Nienke', gender: 'F' },
{ name: 'Wietse', gender: 'M' },
{ name: 'Arwen', gender: 'F' },
{ name: 'Quinn', gender: 'M' },
]
const sortedPeople = people.reduce((a, b) => {
if (!a[b.gender]) {
Object.assign(a, { [b.gender]: [] })
}
a[b.gender].push(b)
return a
}, {}) |
@develoQ @intelliot is it done. I am keen in learning xrp and want to pick this |
@aruns05 when working on this the solution should reduce the webpack bundle size. |
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
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
Done as part of 3.0 |
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
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
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
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
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
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
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
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
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
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
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
When connecting to XRPL with Metamask Snap, due to a Hardend Javascript (SES) limitation, xrpl.js cannot be used (resulting in an error).
This is due to the
lodash
package.After replacing the
lodash
package withjust
, the error no longer occurs, but I am not sure if this package can be included in xrpl.js.https://github.com/angus-c/just
The text was updated successfully, but these errors were encountered: