Closed csteeg closed 1 year ago
I'm not a fan of this change. The watcher can't be an external calls because we have no control over building in that case. The right way to do this is to integrate watch with tye (the way it is done today).
I somewhat get that, but hot-reload is so much faster then a rebuild and thus a restart. Also, ,the watch from dotnet feels a little more stable (eg I never get dll's that are locked with dotnet watch where I do get that in the tye builder)
But, now with the start-/stop feature from my other PR, we're able to stop the service in tye and start it in hot-reload mode from visual studio. The ingress from tye keeps working to proxy the requests, so that's cool. We could live without this feature now.
Just out of curiosity since I don't see the need at our development environment: Why do we want control over building?
Tye is the orchestrator. It has to be the thing building and launching the app. It makes it easy to do things like:
This is why we need to use watch like a library instead of s launcher
Point 1: The file locking issues are with tye only for us... perhaps I should take a look at that someday. Point 2: yes, understood. We don't use replica's in our dev-environment but I see that you'd need to be in control here
Based on #1013 but now optional I added a 'hotReload' property to project-info (see samples/frontend-backend/tye.yaml where front-end is now using hotReload) It only starts when combined with --watch. All projects that don't have this property set, still use DotnetFileWatcher.
Although I don't see when you'd prefer DotnetFileWatcher is preferred over dotnet watch, it still is backwards compatible since you must explicitly tell that a project should use dotnet watch.