Closed austinm911 closed 7 months ago
Hello @austinm911,
Thanks for opening that feature request.
I thought about it in the past so I'm glad you're requesting it now, it confirms that this could be a useful feature.
I just to think a little bit about the specs that is to settle on what changes should trigger a restart, either it's only modifying files that are already part of the graph or also taking into account files that can be added outside of the scope of the initial graph.
I would say that given skott can use multiple types of entrypoints, probably the most reliable way would be to watch everything around skott's cwd (that can be configured) taking into account specified "fileExtensions", "ignorePattern" and ".gitignore" that should discard all the entries from skott's detection zone.
Also, do you expect other types of displayMode to restart on code change? Or only the webapp?
Hello @austinm911,
Thanks for opening that feature request.
I thought about it in the past so I'm glad you're requesting it now, it confirms that this could be a useful feature.
I just to think a little bit about the specs that is to settle on what changes should trigger a restart, either it's only modifying files that are already part of the graph or also taking into account files that can be added outside of the scope of the initial graph.
I would say that given skott can use multiple types of entrypoints, probably the most reliable way would be to watch everything around skott's cwd (that can be configured) taking into account specified "fileExtensions", "ignorePattern" and ".gitignore" that should discard all the entries from skott's detection zone.
Also, do you expect other types of displayMode to restart on code change? Or only the webapp?
Perhaps a simple improvement would be to add a refresh button to the webapp. Not sure if you can hot-reload the page or if it needs to fully stop and start. I'm thinking of this feature because I found this package after having circular dependencies and skott really helped me debug and get rid of them, but I found myself changing one file, exiting in terminal, restarting skott, making a change, exiting, restarting, etc.
I haven't used the CLI enough to understand all the ways skott could run with commands so i'll leave that to others.
@austinm911 glad to know it helps you resolving circular dependencies problem. Note that this is not related to that issue, but I'm also planning to improve and add a lot more features around circular dependencies to help work with them :)
Going back to the initial issue, I can see how fast it can become harmful for the DX to have to restart everything when resolving circular dependencies or even when updating files. I'll think of a solution whether it's through auto-refresh or a manual action button and I'll let you know in that thread.
Hello @austinm911,
I have been working on a universal watch mode lately, you can see the changes in the opened PR.
For the first version, watch mode will be available for all types of display modes (webapp, file-tree, graph and raw) and it will work transparently and automatically under the hood (no user action needed). For the webapp, I'm implementing Server-Sent Events to provide real time notifications and automatically update the graph rendering.
I will keep you updated :)
Hello @austinm911, a --watch
flag was introduced in 0.32.0
I just published. When used in combination with --displayMode=webapp
, it will automatically refresh the graph using real-time events (no page reload). Let me know how it goes for you!
Summary
Would be nice to have a way to refresh the application or set a --watch flag, instead of having to restart the ap.