feat(cli): update a touchfile upon successful (re)build in watch mode #4307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When in
watch
mode with theremix
cli we do incremental rebuilds of changed files, but unfortunately there is no way for external processes (e.g. a dev server) to know that a (re)build has successfully finished other than by watching the build output directories, which is a lot of open file descriptors just to know something that theremix
cli already knows.This PR adds a very simple signal, in the form of a well-known file saved to the configured cache directory, that external processes can use as a simple mechanism to know concretely that Remix is done rebuilding files.
My ideal solution for this use case would be something more like callbacks supplied via the
remix.config.js
, e.g.but that is a bit bigger in scope, so I thought it would be useful to just start small with this 😄