-
Notifications
You must be signed in to change notification settings - Fork 440
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
Convert to lodash-es #1649
Convert to lodash-es #1649
Conversation
@samselikoff - To be honest, I'm not sure about size reduction. I know that without the switch to lodash-es, we're not able to use mirage in our environment because we have issues with default exports (we've had to turn them off in loader.js because of our legacy test structure). If this conflicts with other things, I understand, and can probably just end up using a fork, but thought I'd send this through for you to take a look at. This is the conflicting code in our environment that causes issues with the standard lodash that this update fixes for me:
|
f6aefda
to
168c61a
Compare
168c61a
to
c7c4053
Compare
@ef4 I know you're busy so feel free to ignore, but wanted to see if you had any thoughts on default exports vs. named exports, and if a change like this would change the effect of #1561. Alternatively, is there any way for us to shim the lodash default exports here so apps with |
Instead of: -import _assign from 'lodash/assign';
+import { assign as _assign } from 'lodash-es'; Try this: -import _assign from 'lodash/assign';
+import _assign from 'lodash-es/assign'; I think that solves your problem.
|
Gotcha 👍 So |
Ah, there is actually another gotcha now that you mention it. One that I happen to be working on fixing today. At the moment we don't apply babel to things that are auto imported. That means that if there's any modern language features other than modules present in lodash-es, they would get served directly to browsers, which might not be what app authors want. |
#1666 supersedes |
Simple conversion from lodash to lodash-es. I did as little as possible to convert, leaving code in tact wherever possible by using imports to keep variable names the same.