JSRocksHQ / harmonic

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

Browser-sync initial implementation, fixes #49 #118

Closed UltCombo closed 9 years ago

UltCombo commented 9 years ago

There's a lot to improve here before merging, but it is (kinda) working.

@jaydson review this when you have time please. By review I mean:

Fixes #49

gpedro commented 9 years ago

:+1:

UltCombo commented 9 years ago

There are a few things that I would like to take a second look at before merging: https://github.com/JSRocksHQ/harmonic/pull/118/files#diff-ee0925ececb911520a6d1f9488156db5R202

I'll be rather busy until sunday though.

UltCombo commented 9 years ago

@jaydson can you try out harmonic run in this branch and check if it works as expected? It should rebuild the site and reload the page when you edit files in the src dir.

jaydson commented 9 years ago

It's working awesomely!

WARNING: The themes feature is not ready in this PR, right? Because i noted the templates folder still lives in the generated project.

UltCombo commented 9 years ago

@jaydson I'm not sure what you mean -- this branch is ahead of master. Delete your local branch and pull it again if you're having trouble.

jaydson commented 9 years ago

It was my out-of-date branch. Now, it's working like a charm.

Awesome job @UltCombo !

UltCombo commented 9 years ago

I've added a few more improvements to make the user experience smoother.

When a build completes, Harmonic will not reload the browser if there's a pending build -- it will execute the queued build immediately. Note that this is a recursive strategy, so if the user edits a src file during a build, Harmonic will skip the browser reload and start a new build once the current one completes.

Also, now you should never get a 404 page nor run into permission issues when reloading a page during a build (or, rather, starting a build while loading a page).

There are still a few edge cases which are not covered, but they should affect less than 1% of the use cases -- they are not a blocker. I'll open another issue to track these.