-
Notifications
You must be signed in to change notification settings - Fork 98
Added per mimetype reload strategies and stylesheet live reloading. #187
base: master
Are you sure you want to change the base?
Conversation
src/require-hook.js
Outdated
img.src = img.src; // trigger an update | ||
} | ||
} | ||
} else {*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the status of this commented out code? Is this related to #188?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to make it so we could hot reload assets like images, but I'm not sure how these are treated by the dependency finder. If it's relatively plug and play I'll finish that up otherwise we can remove it.
} | ||
|
||
export function enableLiveReload(options=defaultOptions) { | ||
let { strategy } = options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotta handle the old syntax here (i.e. { strategy: 'naive' }
) or else it is a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Done in the latest commit.
This is awesome! I'm gonna have a look at this later today |
any news on this? would love hot-reload for css |
Yes please! Hot reloading for CSS (I use Stylus) would make this package even more amazing than it already is! @paulcbetts @malept @mnquintana Can’t wait! |
Any news? |
I could have sworn I reviewed and merged this. I'll have a look soon now that I'm back in the US |
Ok thanks |
Hey @paulcbetts could you merge this? ;) |
Any news? |
This looks like a great change, any reason it hasnt been merged yet? |
Not sure... I'm waiting for this too
… On Sep 14, 2017, at 3:44 PM, shanehyde ***@***.***> wrote:
This looks like a great change, any reason it hasnt been merged yet?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hey, this PR has been opened for a year and it looks like something every body would want. Any reason it never got merged ? |
Per mimeType reload strategies have been added. Now you should be able to call
enableLiveReload()
without any arguments and get something that works very out of the box. Alternatively you can pass in an options object that contains your reload strategy.Additionally, stylesheets can now be hot reloaded. Their link.href will be reset upon the file changing.
This doesn't work for dependencies for stylesheets. I've opened an issue regarding
electron-compile-compiled-file
not being sent for dependencies for stylesheets in #188.