-
Notifications
You must be signed in to change notification settings - Fork 253
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
Reduce direct dependencies/devDependencies #598
Comments
@XhmikosR if 2.0 release of resvgjs will be landed we can drop |
Nice! I think our biggest dep at least in regard to the number of installed files is lodash. We'll get there eventually :) |
I'd like to recommend Author's post: https://dev.to/thecodrr/how-i-wrote-the-fastest-directory-crawler-ever-3p9c |
Seems like a good solution. It is lightweight, dependency-free, I'm down with that. |
One thing to keep in mind is that if one dep is very popular, there's a higher chance it's already in people's deps tree. I'm not saying we shouldn't replace a dependency if it's not popular, but it's something we should keep in mind too. Anyway, after the lodash removal, installing svg-sprite v2.0.0-beta7 leads to ~1700 files while in v2.0.0-beta5 it was ~2700 files. See also:
|
Drop lodash.trim: #742 |
A note here that with the lodash.trim removal a small documentation bug is introduced: // Add SVG source files — the manual way ...
spriter.add('assets/svg-1.svg', null, fs.readFileSync('assets/svg-1.svg', 'utf-8')); this line will throw an error because there's no null check on name = trimStart(name.trim(), `${path.sep}.`) || path.basename(file); Possible solutions are
name = trimStart(name ? name.trim() : '', `${path.sep}.`) || path.basename(file);
name = trimStart((name || '').trim(), `${path.sep}.`) || path.basename(file);
|
I've opened #819 to remove lodash.trimstart, happy to make changes if that approach doesn't suit you or you find issues |
With jest, we might be able to remove the following devDependencies:
As for dependencies, we might be able to remove and/or replace this with smaller/better maintained packages:
lodash.trim
dependency #749)The text was updated successfully, but these errors were encountered: