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
Refactor to lodash-es #5294
Comments
I'll be happy to take this on. I think this is blocked on #5291 – I tried to do this now but found errors like this one when running the test suite:
By the way, just switching to importing individual files from Lodash reduces the bundle size from 855 KB to 822 KB (I used the instructions in #5291 (comment) to compare bundle sizes): -const _ = require('lodash');
+const get = require('lodash/get');
+const isEmpty = require('lodash/isEmpty');
+const last = require('lodash/last'); https://github.com/stylelint/stylelint/compare/v14...stephenwade:lodash-slash?expand=1 |
@stephenwade I have some unfinished work (from last year) with stylelint and lodash. Maybe there’s something you can borrow from it? https://github.com/m-allanson/codemod-lodash-requires |
Fantastic.
Yes, that's right. Migrating to lodash-es will likely be one of the last things we do before releasing
I used your codemod yesterday while conducting my own tests 😄. Worked like a charm. I can't find a definitive answer for which module formats is best. It looks to be either:
The latter seems to result in a leaner bundle in benchmarks. Does anyone know the definitive answer? |
Related to #4412? |
Yes, once we've migrated we can pick up that issue to see if any lodash functions can be replaced with native ones. I suspect once |
I just landed eslint/eslint#14287 to remove Lodash from ESLint. I'd be happy to work on the same for Stylelint. |
I searched for a while yesterday but found conflicting opinions online. When we finish #5291, we can see what the module sizes look like for this project. |
@stephenwade That's a fantastic piece of work. If you'd like to work on #4412, then that would be fabulous. I don't think it's blocked by anything and will either:
Please branch off |
Using https://webuild.envato.com/blog/automating-the-migration-of-lodash-to-lodash-es-in-a-large-codebase-with-jscodeshift/
The text was updated successfully, but these errors were encountered: