Comments (7)
i think the eslint plugin is a good idea; is that the only feature request from this issue? if so, let's rename this issue and use it to track this?
from remeda.
Hello, and thanks for the kind words. I'll jump right in:
- Being compared to lodash is both a blessing and a curse. One thing that constantly creates strong opinions is how we name stuff: If we choose to name everything like Lodash, we lose out on making the function names better, when possible, e.g., Lodash's toPairs and fromPairs when ECMAScript has chosen entries instead, or Lodash's choice of abbreviating function names instead of calling them by their full name (
cond
vsconditionally
). Looking at the future and wanting to be the next lodash and not just a reimplementation of Lodash we need to make a choice here. - As for eslint, I don't know what the lodash lint plugin does (but planning on checking it out!), but it's probably overkill for us to build a Remeda plugin as other eslint plugins already do a great job (we can highly recommend unicorn as a supplement to the typescript plugin, and there is the functional programming one, although it's extremely FP 😉).
- A note about migration: I think that once you remove lodash from your project your team would more likely adopt the replacement (they don't have a choice), so it's more about getting lodash out. For that, I've considered a "codemod" tool to help people convert existing projects from lodash to remeda, but those sorts of tools are not trivial to get right (but we'd be happy to get help building them!).
- We don't benchmark remeda against other utilities but never get any feedback about performance issues. On the contrary, our lazy pipes are probably a perf benefit users get "for free" without needing to think about it, and they also help greatly with memory problems which aren't reflected in these sort of benchmark tests. We've introduced a lot of changes over the years and the benchmark from ts-belt doesn't mention what version it was tested against, so it's hard to know if they are reflected in those benchmarks. In v2 we continue to improve our runtime implementations, and we have plans to introduce more "iterator"-style improvements to make almost all functions run lazily where possible. TL;DR - this is not top of mind, but it's also not obviously a problem.
- I'm totally for the Discussions tab, I don't know though how to structure the project to facilitate it, and the current rate of traffic is such that we can handle it with only issues and PRs. We will consider organizing the project with discussions (and maybe projects) in the near future if we find it useful.
from remeda.
The point is not the Lodash > Remeda migration. That's the easy part, because most utils overlap, even by names.
The point is minimum feature parity between Lodash and Remeda.
The Lodash ESLint plugin is fundamental for me, because without that, overtime, my team-mates would turn our codebase in a mess. This is an important code-quality consideration that i'm sure many lead-devs would make.
Without such a feature i cannot see myself comparing Lodash and Remeda on fair grounds. The utils themselves are just a part of the story, the ecosystem is equally important too.
from remeda.
Thank you for clarifying the perf concerns, it totally makes sense.
About ESLint, let me clarify what i wanted to express.
Unicorn and ts-eslint have nothing to do with it.
The main benefit of eslint-plugin-lodash is the following.
If any of my team-mates write code like this:
const t = x === undefined || x === null;
ESLint will auto-fix it (in-editor) with:
const t = isNil(x);
Another example:
array.length > 0
becomes
!isEmpty(array)
It's very powerful, ESLint will warn your developers whenever they are doing something with Vanilla JS where is could be better expressed with Remeda utils, and then it actually autofix it in-editor!
Then, with time, developers of the team will start to reach for Remeda utils themselves.
A note about migration: I think that once you remove lodash from your project your team would more likely adopt the replacement (they don't have a choice), so it's more about getting lodash out. For that, I've considered a "codemod" tool to help people convert existing projects from lodash to remeda, but those sorts of tools are not trivial to get right (but we'd be happy to get help building them!).
See? Here you would just be reimplementing the ESLint CLI functionality: eslint --fix
. Link.
Once the plugin is developed, adopters of Remeda could migrate just by running eslint --fix
from their command-line.
from remeda.
Even Ramda has one.
Not a coincidence. Lodash and Ramda are the 2 most popular JS util libs out there.
from remeda.
Your examples are from vanilla JS to lodash/ramda, not from one library to the other. If your project is already using Lodash, the vanilla -> Remeda is not the main hurdle to adoption, the lint rule wouldn't help in those cases.
from remeda.
Yes, fine by me 👍
from remeda.
Related Issues (20)
- Allow `conditional.defaultCase` to infer its return type HOT 3
- Incorrect type assertion for isIncludedIn HOT 5
- Add optional `obj` parameter to `Evolver`? HOT 4
- Add `invariant` HOT 2
- Add `some` and `every`? HOT 16
- [Feature Request]: Support Maps in isDeepEqual HOT 6
- Add `sortedUniq` HOT 6
- Further improve `stringToPath` types; consolidate `setPath` and `pathOr`? HOT 5
- isDeepEqual and negation in guard can break type HOT 6
- Typing issue when using `isDeepEqual` in `differenceWith` function HOT 2
- Why is fromKeys typed with Partial<>? HOT 3
- `groupBy` has broken types HOT 3
- Test against Typescript nightlies HOT 2
- Add mergeAndConcat function HOT 1
- add transposeObject function HOT 8
- Add "R" or "Remeda" globally to the docs website for easy experiments HOT 4
- Add `mapAccum` HOT 5
- Unexpected types when using isNullish/isNonNullish in conditional HOT 3
- Incorrect type assertion in negative case for hasSubObject HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remeda.