Working on gulp

I’m basically new to Sage. I used an early version of Roots ages ago, but haven’t done any WordPress work recently. I’m still getting a feel for the project’s workflows and patterns, but I’ve had good experiences with the toolset you’re using.

After having some trouble with Sass source maps, I patched in some of my existing gulp tasks as a workaround. But I wanted to get a feel for where you’re at (especially @austin) before starting to work on any pull requests.

Are you open to refactoring the pathways through some of the tasks? I see a few places where gulp’s native constructs can probably save time and simplify code. The Gulp ecosystem also moves crazy-fast, and there are some evolving patterns which could be brought in as well. This could be fun!

Definitely open to it! I would definitely say let’s work on any non-breaking enhancements first and then assess breaking changes.

1 Like

Moving this over here from github… :blush:

Does anyone have an opinion about migrating the gulpfile more towards the npm standard of explicitly including modules at the top of the file?

I’d also like to move away from gulp-load-plugins, which saves a few keystrokes but ends up creating a lot of cognitive overhead in tracing through the code and understanding how the file works. I think readability would be increased quite a bit by dropping this.

Space-aligning the require statements also feels very foreign to JavaScript.

Remember gulp.js is spelled with a lower case g :wink:

I have no opposition to this. The less deps the better. Feel free to open a PR for this.

I know you saw #1445 already, but this should be good to go now. I pounded on this for a while, output is identical.

The one thing I wasn’t expecting was a nearly 20% speedup… I thought we might get a little bit, but I’m repeatedly seeing builds saving 2+ seconds vs. the previous gulpfile in a fresh clone.

Care to pop open excel? Steps of the Scientific Method

Did some benchmarks: Gulpfile Speedup 2015-04-30 - Google Sheets

Not seeing much of a difference. What does your setup look like?

edit:

ok here’s what I got

https://www.dropbox.com/s/bhk8mlxpe1xq3rg/Screenshot%202015-04-30%2012.20.40.png?dl=0

So not much difference on 0.12 but 4% speedup on iojs and 1% speedup on 0.10 on my side.

My setup: Retina MBP, a few years old. SSD, lots of RAM. node v0.12.2, gulp 3.8.11

Starting from a fresh clone of Sage, this was my extra-scientific process:

  1. git checkout master (uses gulp-load-plugins)
  2. Run gulp
  3. git checkout gulp-plugins (no gulp-load-plugins)
  4. Run gulp
  5. Repeat until bored.

master: 11-13 seconds
gulp-plugins: 8-9.5 seconds

Not especially rigorous, but it’s been faster every single time.