[Suggestion] Remove Lodash
See original GitHub issueFirst of all, the work that you guys are doing is amazing. Very well maintained. Being a library maintainer. One of the major things that is of concern is the library size, specially when it is for a frontend related.
Currently there are 3 places in your entire library, which is using Lodash
1- Checkbox https://github.com/contiamo/operational-ui/blob/67ab23ed89f16e8e92286d0bfeba5cb7b713ed2a/src/Checkbox/Checkbox.tsx#L1 https://github.com/contiamo/operational-ui/blob/67ab23ed89f16e8e92286d0bfeba5cb7b713ed2a/src/Checkbox/Checkbox.tsx#L98
We can generate a unique id, e.g, timestamp.
I think the id, prop behavior shouldn’t be hard coded like this. The use should be exposed to this prop. As to he/she can add the id
.
2- Code https://github.com/contiamo/operational-ui/blob/67ab23ed89f16e8e92286d0bfeba5cb7b713ed2a/src/Code/Code.tsx#L1 https://github.com/contiamo/operational-ui/blob/67ab23ed89f16e8e92286d0bfeba5cb7b713ed2a/src/Code/Code.tsx#L175
We can use Array.filter
instead of omit.
3- OperationalUI
https://github.com/contiamo/operational-ui/blob/67ab23ed89f16e8e92286d0bfeba5cb7b713ed2a/src/OperationalUI/OperationalUI.tsx#L3 https://github.com/contiamo/operational-ui/blob/67ab23ed89f16e8e92286d0bfeba5cb7b713ed2a/src/OperationalUI/OperationalUI.tsx#L154
Wouldn’t this include the entire library import { Cancelable } from "lodash"
?
Again just 2 cents on my opinion. Going through your code base was fun. Typescript is new to me 😅 Did an hour crash course with .ts
before coming to this repo.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
@peterszerzo can I make a PR to replace
lodash
omit with the spread syntax?Yes, @adeelibr. PRs are always welcome!