5 ms·
I wrote an extension that does both live reload and saving from devtools: http://tin.cr http://tin.cr. To address the comment below with regard to extensions no
by ryanackley 14y ago
I wrote an extension that does both live reload and saving from devtools: http://tin.cr http://tin.cr. To address the comment below with regard to extensions not working, it's Chrome's fault. It will fail to hotswap JavaScript occasionally and it doesn't communicate the reason to the user or extensions built on top of it.
Speaking from experience, hot swapping JS sounds much better than it actually is in practice. First, as mentioned above it randomly fails with no explanation from Chrome. Also, I find a lot of code I want to hotswap runs on DOM ready and assumes that the page has just been loaded.
On the other hand, CSS hotswapping in Chrome works really well.
- ensmotko 14y agoI think your extension was one of the few I tried. Sorry for the slight bashing, I appreciate what you're doing and I'd actually like to help you out in any way I can! Have you tried getting in touch with Chrome developers? Printing out info when hot swapping failed would really make you extension useful. Weirdly, I haven't noticed failures while using the Chrome editor. Might be that I just haven't logged enough hours with it yet, but so far it was working flawlessly.
- rococo 14y agoThat is fantastic, thank you for this.
- wubbfindel 14y ago"I find a lot of code I want to hotswap runs on DOM ready and assumes that the page has just been loaded." Maybe it would be possible to put all your "setup" code into a single myscript.load() function and then when you've edited your js in chrome devtools, then call myscript.load() in the console to reboot all your DOM events and so on. Just an idea, completely not tested. P.S. Just tried your extension using vim to edit a Sass file, while compass watch is running, and your extension is watching my CSS output directory. Awesome to see changes in vim almost immediately appear in my browser! EDIT: Formatting. Adding P.S.
- skrebbel 14y agoIt probably works great for games, though put your render() function in the hotswapped code, and hooray. ctrl+s updates the view.