Closed mattdesl closed 6 years ago
I have a lot of npm scripts with --live
will they break?
@fibo Nope, it would not break. Also, you should use budo as a devDependency in your npm scripts, so that if/when I push a major breaking change, your scripts will still run fine since they depended on an earlier (major) version of budo.
I run regl tests oftentimes, which are really expensive, and enabling --live
would just unnecessarily hang browser at any times any file is saved. That would also hang bad/unfinished scripts on occasional save. Practically speaking, thanked budo for not having --live
enabled many times. The cost is high for long scripts, hope there is stats proving that the profit covers the need to every time enable budo with live reload disabled.
Enabling ENV
settings from #218 would be really convenient and solve this problem too btw.
I do not think I am going to end up implementing this after all.
Yes, it's a bit annoying to type out --live
all the time, but introducing live reload by default will cause a of lot of subtle changes, including some new API changes and breakages which I do not want to introduce. Honestly, budo is pretty stable at this point, and I'd rather not go breaking it or forcing users to change their way of working with it. :smile:
There are also some good reasons to keep it off by default, as @dy points out. Basically, budo is a browserify server by default, and optionally also a dev/LiveReload server with the --live
flag.
The response is positive, so I think I will turn on LiveReload by default so that you won't need to specify
--live
. Most of the time when using budo, you will want a LiveReload server.So the below will be all you need to start:
Since this is a major version bump, I am also going to remove (or deprecate) the
live()
andwatch()
functions in favour of passing options to budo's constructor, and adding a new function calledsetLiveReload
in the rare case that somebody needs to change the options after connection. The reason thelive()
andwatch()
functions are currently separate, is so that you can set up a LiveReload server without a file watcher, and vice versa, but I've found the added complexity is not worth the hassle for the vast majority of users.So it could look like this:
This will also resolve the #219 issue.