Chrome live code reloading from source changes

1,049 views
Skip to first unread message

Yang Zhang

unread,
Feb 28, 2014, 4:47:13 PM2/28/14
to google-chrome-...@googlegroups.com
I know the Sources panel supports live code editing / hot code
swapping. It would be convenient to be able to make changes to the
source JS and live-reload those changes into the VM (without
refreshing the full page) rather than have to apply edits in the
Sources panel. Are there any DevTools extensions for this? If not,
is this something that's possible to implement as a DevTools
extension? Thanks!

Yang Zhang

unread,
Mar 7, 2014, 11:29:16 PM3/7/14
to google-chrome-...@googlegroups.com
Retrying in case anyone has seen this. My current approach is to
actually copy the compiled JS and paste it into the Source tab, which
works surprisingly well so long as your changes affect exactly one
resulting JS file.
--
Yang Zhang
http://yz.mit.edu/

John J Barton

unread,
Mar 8, 2014, 11:20:50 AM3/8/14
to Google Chrome Developer Tools
I wasn't able to understand your first post. Maybe you meant that you want changes in the filesystem to cause updates to the JS runtime without either reloading or operating on the devtools sources panel?

Anyway, the live edit feature is quite limited. It works for simple chains of global function calls, but not for any thing involving function pointers, including objects with function properties. Its biggest plus comes if you edit while stopped on a breakpoint. In this case, live-edit will recompile your code and re-run the current call stack with the new code. That gives you full syntax checking and run time reference checking for your edit, within the context of the current stack.  This can be a great productivity enhancement. I typically hit control + S to save, see that the live edit passed, hit control + R to reload, then the app runs again to the breakpoint.

jjb



--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/CAKxBDU9URaN6a4m57Gpogh4W%2Bd21ucVQzSoxOiox%2BtgEN0BRPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Yang Zhang

unread,
Mar 8, 2014, 2:19:52 PM3/8/14
to google-chrome-...@googlegroups.com
Right, that is what I meant--I understand full well that the hot code
patching is limited in what it can do. In practice, for quick bug fix
iterations it is extremely useful to experiment while running with
your current application state. I'm currently achieving this by
copy-pasting my generated JS into the Sources panel, and it would be
really neat if there were some automation around that, so as to get a
similar experience as (say) Live Reload for CSS.
> https://groups.google.com/d/msgid/google-chrome-developer-tools/CAFAtnWypxQ2FLJ2zOPrnG4B1rS-SEdjtimESD8RF3v3a8OhsCg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
0 new messages