-
Notifications
You must be signed in to change notification settings - Fork 399
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
Add option to restart Application on Asset change #2626
Comments
doesn't typing |
If running on the local machine, yes (with the caveat that you have to manually do it). |
+1 |
Or better we should use --watchAssets an array of files to watch, instead of boolean field. |
+1 |
1 similar comment
+1 |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
The problem I'm facing is similar to these two already existing closed issues:
I have definition / configuration files that are read by the application during its bootstrap phase which configures certain features of the application. Using the
watchAssets
option as described here does update the files in the distribution folder when they're changed, but since they're only picked up during the application bootstrap phase, this effectively does nothing (as the application requires a restart for the changes to take effect). I have to resort to manually restarting the server, or if the application is running inside a mounted docker container, changing a random bit of code so thatnest start --watch
restarts the application.Describe the solution you'd like
Changing the behavior of
watchAssets
to do this would be nice, but I understand that this sort of change is not something others developers may want.Since this is the case, introducing a new option to handle the restart could be a viable solution to the problem that does not break existing workflows.
An option along the lines of
restartApplicationOnChange
could be added whereverwatchAssets
is currently possible to be specified. When this option is set totrue
, the application will restart if the asset is changed.This would also give the developer the ability to more finely control when the application requires a restart should they need it.
Something that would fall out with this change would be the inconsistency of "watch" options :
--watch
will restart on code changes,watchAssets
will not restart on asset changes,restartApplicationOnChange
alongsidewatchAssets
will restart on asset changesPerhaps
restartApplicationOnChange
could be considered as being false by default, and later changed totrue
by default with a major release. This would resolve the inconsistency of "watch" options while still providing a method for developers to go back to using their old workflows (no restarts on asset changes).Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Already explained in the first section, but in short:
I have configuration files that are read during bootstrap and only during bootstrap. A restart of the application is required in order to actually apply the changes that were made.
The text was updated successfully, but these errors were encountered: