-
Notifications
You must be signed in to change notification settings - Fork 373
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
Get rid of lodash and swap it out for lodash-es #2311
Comments
Hello @fabis94 , thanks for suggesting this improvement.
Do you have concrete problems that you cannot get it to work at all or is your "only" problem that you do not want to bundle lodash to save on bundle size? As I understand it, there would be no need (for you) to replace lodash with lodash-es if there were not calls to lodash/fp? |
@lucas-koehler lodash-es does not have these fp functions, at least under those imports so my previous method of just aliasing all I suppose you're right, this is only caused because of trying to optimize on lodash's size, but I would argue that its an important concern. Nowadays you have to care about things like that (ESM support, tree-shaking etc.) to ensure good UX for users. And I think you may be right that if calls to |
@fabis94 It seems that the fp part of lodash is not available in the Generally, it seems reasonable to me to remove the usage of lodash/fp and, thus, facilitate aliasing lodash with lodash-es in a first step. Later we could then change this dependency from Currently lodash/fp seems to be used only in:
@sdirix Do you see a reason why we could not get rid of using lodash/fp or move to lodash-es longer term. |
@lucas-koehler I'm not very knowledgeable about jsonforms and lodash/fp, so I'd prefer not to, but if there's no other way I supposed I could try taking a look at some point |
@fabis94 Alright. I'll discuss the priority of this with the team. However, as this is merely an optimization I cannot promise if/when we will work on this. If you start to work on this, please leave a comment here :) |
Current usageThe reason we are using Of course we could get rid of this as long as we can use/implement a similar alternative. The use in Lodash usage / Tree shaking etc.To improve bundle size we are already using deep imports, e.g. In client projects we observed that using deep imports already made sure that most of lodash was not included in the end. Using lodash-es
While users purposefully using My thoughts
|
Is your feature request related to a problem? Please describe.
The CJS build of lodash is old and not very well optimized for web use cases (hard to tree-shake). So far I've been able to alias
lodash
tolodash-es
in my build config, but then you recently introduced calls tolodash/fp
which basically broke all of that.That was a bad call IMO and just made it more of a chore to get your library working in web environments, especially if you don't want to bundle in all of lodash.
Describe the solution you'd like
Get rid of lodash usages and swap them all out for lodash-es
Describe alternatives you've considered
Doesn't have to be lodash-es necessarily, just something new that has a proper tree-shakeable ESM build
Framework
Vue
RendererSet
Vanilla
Additional context
No response
The text was updated successfully, but these errors were encountered: