How about cross-platform Edit and Continue / Hot Swap baked into the SDK tooling?
See original GitHub issueThe code, compile, reload cycle isn’t necessary, it’s just the way things are. We can make coding more interactive. Imagine a default workflow where coding is manipulating the code in a running application! That could extend beyond development, but for now at least in development.
In working on projects that use both backend builds (.NET Core) and front end builds (Webpack), I wish we could have a better development experience on the backend.
Webpack’s HMR allows me to change code and webpack’s dev server pushes those changes into the running application by replacing code, styles, html, etc. Net effect, I can make changes and instantly see the impact without losing application state, and without waiting 10+ seconds for a compilation and reload.
On the backend, as the code and dependencies grow, the time to recompile grows. Add to that: time to restart the app and possibly reload state. This becomes a huge time sink for making simple changes.
We have Edit and Continue functionality in Visual Studio, would it be possible to extract that out and put it into the SDK tooling? Maybe a dotnet edit-and-continue
or dotnet hot
or dotnet watch --hot
?
This would then work cross-platform and with any IDE. And best of all, I can spin up a Docker container with the SDK and my web app and that’s all I need to develop anywhere.
I know work is being done to improve the build times in general, but some of that build time wouldn’t be a big deal if we had hot swap for development because then slow build times are just on initial build and on build servers.
Behavior wise, here are a few thoughts:
- Tooling watches for changes, compiles and injects into the running app if possible.
- If hot swap isn’t possible, then fall back to reloading the app. For example, if you change your startup code (side effecting code) that starts a web app on a given port, then that is probably not hot swappable.
- I assume many of these things have been figured out in Visual Studio’s Edit and Continue functionality. Some sort of inspection of the changes to determine if hot swap will work.
- IntelliJ has HotSwap, with a nice update/reload fallback. This might be a source of inspiration too https://www.jetbrains.com/help/idea/hotswap.html.
- I would like this to work outside of debugging. I shouldn’t have to hit a breakpoint to make code changes. That might mean the debugger is always running and that’s fine if it isn’t adding too much overhead to obviate the benefits of hot swap.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top GitHub Comments
+100 for this
It would be nice to have this kind of feature. It’s indeed a huge undertaking. I’d recommend to file a feature request in VS user voice.