gulp-community / gulp-livereload

gulp plugin for livereload
768 stars 67 forks source link

Inject new JavaScript without page refresh #77

Closed bkolobara closed 9 years ago

bkolobara commented 9 years ago

Right now when I change a CSS files the changes are automatically injected into the browser without a refresh. I would like to have the same behavior for JavaScript. This means reevaluate the JavaScript file again but don't refresh the page to preserve state.

itsthatguy commented 9 years ago

I am seeing the entire page page refresh when changing CSS.

roelvanhintum commented 9 years ago

@bkolobara Is it even possible to do that? JS code is instantiated and has states, which makes it really difficult to just change it.

@itsthatguy I'm having the same issue, but it's a different one than @bkolobara is referring to.

bkolobara commented 9 years ago

@roelvanhintum Yes, if you use appropriate JS libraries. It will not work if you don't plan upfront for it. I was hoping to archive the react-hot-loader experience (https://vimeo.com/100010922).

In the meantime I switched to webpack and didn't look deeper into livereload.

@itsthatguy I don't think the entire page was refreshing, but maybe I'm wrong and it was ultra fast.

roelvanhintum commented 9 years ago

@bkolobara Thanks, i completely missed this.