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

Reduce dependencies initiative #18

Open
1 of 8 tasks
EvanLovely opened this issue Oct 6, 2016 · 2 comments
Open
1 of 8 tasks

Reduce dependencies initiative #18

EvanLovely opened this issue Oct 6, 2016 · 2 comments

Comments

@EvanLovely
Copy link
Contributor

EvanLovely commented Oct 6, 2016

I'd like to get less dependencies in so we can have quicker npm installs. We can look for tasks that can be done with vanilla JS that don't need a plugin and also look for dependencies that our dependencies pull in that can be used. Here's a few ideas:

  • del - Used for clean tasks; couldn't we just rm -rf?
  • gulp-cached - Used for only validating files that have changed. Gulp 4 now let's use a since option in gulp.src that can be coupled with gulp.lastRun that should be able to do this.
  • gulp-flatten - We should be able to use this approach.
  • gulp-if - Could we just use if? I know this helps mid-pipe, but still...
  • Using both gulp-sass and gulp-postcss - Could we get just PostCSS?
  • js-yaml - Used just for our config parsing; I already want to move our config over to js files. Nevermind: we need it for parsing the Pattern Lab config file.
  • lodash - Used to help us in pre-ES6 land when we supported node v0.12. We should be able to get rid of all of our uses of it. I know that our icons templates use lodash as a templating, so we couldn't completely drop it until the next major version, but we could get everything else out.
  • Using both node-notifier and gulp-notifier? Let's consolidate.

Additionally, I'd like to move more towards plain node & JS and less gulp. I still think gulp is fantastic for the command line execution of tasks and all of it's watches, but those commands just fire functions, so we shouldn't need to abstract them away unless there's a benefit. One benefit is the use of in-memory streams via .pipe() for multiple transformation of files; like CSS and JS.

@grayside
Copy link

grayside commented Oct 9, 2016

Avoid she'll commands for filesystem, node.js fs package helps with portability.

You could potentially use vinyl directly for memory filesystem, but at that point you're creating your own lightweight task runner.

@RedLucas
Copy link

RedLucas commented Jun 6, 2017

Regarding removing lodash... You could always just include a subset of this dependency such as https://www.npmjs.com/package/lodash.templatesettings.

I'm personally a fan of including something like lodash, because while you can always write stuff yourself, it can make your own code cleaner to use something like lodash instead.

Having said that, I'm just trying to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants