Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving The Hot Reload Feature #57724

Closed
sangeethnandakumar opened this issue Nov 11, 2021 · 6 comments
Closed

Improving The Hot Reload Feature #57724

sangeethnandakumar opened this issue Nov 11, 2021 · 6 comments
Assignees
Labels
Area-IDE Concept-Continuous Improvement Need More Info The issue needs more information to proceed.

Comments

@sangeethnandakumar
Copy link

I was trying to write a huge REST API project and I thought hot reload could make me so much more productive.

As an evolving API requires lot of DTO changes, Model changes, Property modifications, Request/Response changes etc.. dotnet hot reload isn't good for any of these code evolving change scenarios.

I certainly know and understand the underlying issues for not be able to use hot reload for everything but without these I believe most uses cases aren't covered.

It would be awesome to be able to change models, properties & function attributes on the go with hot reload.

To my use case dotnet hot reload is simply an extended version of "changing code while debugging line by line", That already on dotnet for years. Would love to see it became more useful.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@DamianEdwards
Copy link
Member

Thanks for the issue. Hot Reload is based on the same underlying infrastructure as Edit and Continue, relying on the compiler and the runtime to support producing and consuming the desired code changes. We're continuing to work on increasing the scope of changes supported and feedback really helps us prioritize that. Can you give some specific examples of the kinds of edits you'd like to see supported? Visual Studio will show you the reason why an edit is not supported by Hot Reload in the Errors list and/or Output window "Hot Reload" source. If using dotnet watch you can run it with the --verbose argument to have it emit the reasons for unsupported edits.

@sangeethnandakumar
Copy link
Author

@DamianEdwards Thank you Damian. I've been using dotnet for the past 6 years professionally. From my perspective these are the most often scenarios I came across which requires me to rebuild and wait. Usually enterprise apps are huge, Rebuilding for a simple change is a real pain.

  1. Unable to hot-reload when Lambda expression changes
  2. If there's an unused variable which was already on a fun argument, And if we write a new statement inside the fun which uses that variable (while prog is running) hot-reload fails
  3. Request/Response classes, DTOs, Model classes often requires addition/removal of properties as they evolve or while testing with tools like Postman/Swagger etc.. That always need a rebuild
  4. Adding attributes to class or functions (although is not an often change) is a no no to hot-reload

@DamianEdwards
Copy link
Member

I'm going to move this issue to the dotnet/roslyn repo as that's where work RE supporting more EnC changes is tracked.

@DamianEdwards DamianEdwards transferred this issue from dotnet/sdk Nov 12, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Language Design untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 12, 2021
@DamianEdwards DamianEdwards changed the title Improvising The HotReload Feature Improving The Hot Reload Feature Nov 12, 2021
@jinujoseph jinujoseph added Concept-Continuous Improvement and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 1, 2021
@jinujoseph jinujoseph added this to the 17.1 milestone Dec 1, 2021
@davidwengier
Copy link
Contributor

Thanks for logging the issue @sangeethnandakumar, I wonder if you could provide some more specifics of the issues you're seeing.

  1. Unable to hot-reload when Lambda expression changes

In general changing lambdas should be allowed, though there are certainly limitations (like changing the return type for example) and some extra things we could allow (eg. #54672). Can you give a code example of your before/after to help identify the exact issue?

  1. If there's an unused variable which was already on a fun argument, And if we write a new statement inside the fun which uses that variable (while prog is running) hot-reload fails

This is surprising. Again, could you provide a before/after of the change you're making here?

  1. Request/Response classes, DTOs, Model classes often requires addition/removal of properties as they evolve or while testing with tools like Postman/Swagger etc.. That always need a rebuild

Adding properties should be allowed, but deleting members is definitely a limitation at the moment.

  1. Adding attributes to class or functions (although is not an often change) is a no no to hot-reload

Adding attributes should be allowed. What runtime are you using, and what .NET version are you targetting? .NET 6 running on Core CLR should support this, but the Mono runtime is not currently able to alter attributes.

@davidwengier davidwengier modified the milestones: 17.1, 17.2 Jan 6, 2022
@jinujoseph jinujoseph added the Need More Info The issue needs more information to proceed. label Mar 21, 2022
@ghost ghost closed this as completed Mar 31, 2022
@ghost
Copy link

ghost commented Mar 31, 2022

Closing this issue as we've seen no reply to the request for more information. If you are able to get the requested information, please add it to the issue and we will retriage it.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement Need More Info The issue needs more information to proceed.
Projects
None yet
Development

No branches or pull requests

6 participants