Skip to content
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

Add babel-plugin-lodash if in dependencies #57

Open
hzoo opened this issue Mar 22, 2018 · 4 comments
Open

Add babel-plugin-lodash if in dependencies #57

hzoo opened this issue Mar 22, 2018 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hzoo
Copy link
Member

hzoo commented Mar 22, 2018

https://twitter.com/kentcdodds/status/976808822307094528

Should be easy to do. Detect if lodash is used as a direct dependency and then add a new plugin? Not sure about the version or if we need to use the "latest version" package on npm to do that.

@hzoo hzoo added enhancement New feature or request good first issue Good for newcomers labels Mar 22, 2018
@noahlemen
Copy link
Member

a cursory idea at what might be involved, in case any first-time contributor needs some direction:

  1. in updateDeps.js, check for dependencies['lodash'] (reference flow, babel-loader portions for potentially similar logic)
  2. add babel-plugin-lodash to deps with appropriate version
    • version determination might be the most complex part of this -- perhaps we need to use the npm registry api?
  3. update tests to make sure regressions in this functionality will be caught!

@ghost
Copy link

ghost commented Apr 14, 2018

Looks like there was a similar issue open on the create-react-app project about a year ago.

Use of the _.chain API (supported in all current versions of lodash) breaks babel-plugin-lodash.

The good news is that chain is soon-to-be-deprecated with the release of lodash v.5.0.0 sometime this year.

It isn't clear how many projects would be affected by this, but maybe it is best to provide a warning or simply wait until chain is officially deprecated before moving forward?

@noahlemen
Copy link
Member

bummer. nice find though!

looks like some process has been made towards supporting this? lodash/babel-plugin-lodash#176 -- sounds like it's not completely supported still

I'd vote towards holding off on this until it can be done safely for anyone using lodash. perhaps, as a compromise, we could detect if the user depends on lodash and is not using babel-plugin-lodash, and then log a suggestion to add it?

@hipstersmoothie
Copy link

hipstersmoothie commented May 29, 2018

@kedromelon Nah the maintainer of lodash decided to revert that for some unknown reason lodash/babel-plugin-lodash#210
lodash/babel-plugin-lodash#219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants