Statiq.Web icon indicating copy to clipboard operation
Statiq.Web copied to clipboard

Hotkeys in --watch mode

Open SilentSin opened this issue 5 years ago • 5 comments

The --watch command is great for automatically rebuilding the site (and doing so faster than a full rebuild), but with issues like https://github.com/Wyamio/Wyam/issues/817 it can be annoying to not have any manual control over it so I was wondering if it would be possible to have it listen for keyboard input?

This could allow a couple of manual controls:

  • R - force rebuild
  • D - stop watching for a bit
  • O - open the preview page in the default web browser

SilentSin avatar May 05 '19 03:05 SilentSin

I love this idea

daveaglick avatar May 08 '19 12:05 daveaglick

I just made a new site and noticed a massive hit to generation time as soon as I pointed it to my project to generate the API pages, so that could also be worth making a hotkey to disable. Just keeping all the old API pages would be ideal, but if that's tricky to implement then simply not having any API pages until you need to do a final build would be fine.

SilentSin avatar Jun 08 '19 02:06 SilentSin

I've started working on one of my larger projects again and did a quick comparison of the generation times:

  • With code: 26 seconds initially, then 12 seconds whenever a watched file changes.
  • Without code: 13 seconds initially, then 3 seconds whenever a watched file changes.

SilentSin avatar Jul 02 '19 11:07 SilentSin

There’s a totally new caching approach in v3 and early indications are that it’ll drastically speed up rebuilds for both API generation and non-API use cases. There may also be some wins in that initial 26 seconds, but a lot of that is probably due to MSBuild and/or Roslyn which we can’t get out of. What we can do is run those operations concurrently with other things to speed up overall generation and that’s another thing v3 does.

daveaglick avatar Jul 02 '19 12:07 daveaglick

Awesome, I'm really looking forward to it.

SilentSin avatar Jul 02 '19 12:07 SilentSin