dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
34.87k stars 9.84k forks source link

More fine grained settings for hot reloading #54949

Open StringEpsilon opened 3 months ago

StringEpsilon commented 3 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

I am working on an MVC app with some peculiar requirements regarding page reloads and resubmitting forms. I do like developing with dotnet watch run for the hot reloading, but sometimes the restrictions my app enforces clashes with automatic reloads caused by the hot reload browser integration.

Describe the solution you'd like

I would like to selectively disable certain auto-reload scenarios in the browser script, preferably without also having to restart the entire application.

  1. Option to not reload the current page if (and only if) is the result of a POST request.
  2. Option to not automatically refresh the current page (but to still reload assets, scripts and css)

Additional context

The POST response reload is particularly frustrating sometimes, as my browser of choice also asks me to confirm the reload, causing further development friction.

Also note that this is not about disabling the integration entirely (https://github.com/dotnet/aspnetcore/issues/54107), though having that option would also help.

lonix1 commented 2 months ago

@StringEpsilon Unsure if it helps you, but here's a workaround to my related issue.