-
Notifications
You must be signed in to change notification settings - Fork 5
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
use main lodash instead of separate packages per function #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.json
Outdated
@@ -22,8 +22,7 @@ | |||
"license": "MIT", | |||
"dependencies": { | |||
"jsonml.js": "^0.1.0", | |||
"lodash.camelcase": "^4.1.1", | |||
"lodash.isfunction": "^3.0.8" | |||
"lodash": "^4.17.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably fine, though we could just specify ^4
to allow maximum deduping downstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i've done a search, and the lowest common version is 4.14.1
https://github.com/search?l=JSON&p=2&q=org%3ACondeNast+jsonmltoreact&type=Code
cc @dcolucci
So one of the nice things about this lib is the small size. You're probably juicing it by 15kB or something with this change. Is the assumption that brand apps will always be using the full lodash? |
@giles-v right - the trouble is we either need to always use only the exact lodash packages needed, or we need to always use the full, everywhere, so that we can dedupe in the bundle. If we have a combination, the result will always be larger. I think there's another thread somewhere about this |
@giles-v this would only increase the build size for brand apps that didn't use lodash at all or were only using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really like to see a before/after bundle size comparison from a couple of existing brands before making this switch.
Marking this as "requesting changes" because we can get this data, it's not something we have to guess about. I haven't looked into the code and I'll dismiss this when we know the numbers.
could this could result in two versions of the same method for some apps? |
@rufus2021 it could, but even if it isn't resolved by npm, you can force a single version of lodash with webpack |
Aside from James' timing question, would |
Yeah, I've considered peerDependencies as a solution as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great improvement which I think we should take at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, 👍 too.
Still blocked on the bundle size change? |
This got lost a long time ago, but really it should have landed. Let's make it land! |
👍 Looks like I'm still part of some team. Which is good, I'm planning on using this in a project coming up here. |
Good to know this is still being used! 👍 |
💪
…On Wed, Feb 26, 2020 at 2:59 PM Diogo Cunha ***@***.***> wrote:
Good to know this is still being used! 👍
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#7?email_source=notifications&email_token=ABNRY5344Q3BHBQIH2GRXN3RE3CYRA5CNFSM4D5RVOQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENBVF6I#issuecomment-591614713>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNRY53ZSMQZIPS2OOW33J3RE3CYRANCNFSM4D5RVOQA>
.
|
💯 |
I see I'm not the only one who was mildly surprised to see a Conde email
from Github. I applaud your efforts, Phil!
…On Wed, Feb 26, 2020 at 3:06 PM Michelle Austria Fernandez < ***@***.***> wrote:
💯
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#7?email_source=notifications&email_token=AFL55PL2QOST7GAAZERTQL3RE3DVLA5CNFSM4D5RVOQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENBV65Q#issuecomment-591617910>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFL55PJ3GOLJOSVAFG27W6DRE3DVLANCNFSM4D5RVOQA>
.
|
Nothing like a Conde reunion inside a PR!!! |
Good lad Phil 💪 |
I thought more lodash was always better. E.g. at Condé I made a brute force object property extractor leveraging lodash! https://gist.github.com/brokentone/9639f8e0a073aec66ae3b3c67cdf5d9a |
👏 👏 |
Wait for me!!! |
👋 |
GeGe was here. |
✅ Well done sir! @pgoldrbx |
Well done, everyone. |
One of our low-hanging fruits is the duplication of lodash imports. Our codebase currently has 4 ways and I'm trying to get it down to 2 (see https://github.com/conde-nast-international/voguede-autopilot/pull/823 ). This is an attempt to fix the upstream instead of trying to rewrite everything on our end.