JSRocksHQ / harmonic

The next static site generator
http://harmonicjs.com/
MIT License
282 stars 26 forks source link

Remove sync calls #152

Closed jaydson closed 9 years ago

jaydson commented 9 years ago

Attempt to fix #150
There's still some sync calls we need to remove: readFileSync() in src/bin/theme.js The getFileContents() method is being called a lot of times in Harmonic class, and i can't find a way to make it async.

readFileSync() in src/bin/helpers.js We're calling readFileSync in helpers.js file, but consuming it on the constructor (see next).

existsSync() in src/bin/parser.js Kinda complicated because we're calling existsSync() method inside the constructor and we can't make a constructor async. I tried with an async IIFE inside the constructor and it not worked well. Also, the method getConfig() is called inside the constructor.

Travis says it's ok so far. https://travis-ci.org/JSRocksHQ/harmonic/builds/61412823

//cc @UltCombo

UltCombo commented 9 years ago

woah, this is looking very nice! I'll test it when I get home.

UltCombo commented 9 years ago

Found some small style nits, but I can fix them myself so don't worry. LGTM, excellent work @jaydson!

Now we can start adding true parallelism to the build, this should make the build even faster.

UltCombo commented 9 years ago

Some clean up: https://github.com/JSRocksHQ/harmonic/commit/bc17c826f6d946ce6cdff99b939bb53fcbc93680

jaydson commented 9 years ago