Don't wait for nix show-derivation when deciding whether to provide UI feedback - #835
Merged
Merged
Conversation
…rovide UI feedback
…ic-responsiveness
Member
Author
|
Currently experimenting with using hnix to parse and evaluate the static asset derivation, with the hope of only watching the files that the evaluation cares about. That'll get rid of all this |
Member
Author
|
Related: haskell-nix/hnix#804 Once that PR is done, we can try to use that functionality to implement a more nuanced nix watcher. |
6 tasks
ali-abrar
force-pushed
the
aa/static-responsiveness
branch
from
December 20, 2022 20:11
5861c58 to
c254893
Compare
Member
Author
Not doing this. |
cgibbard
approved these changes
Dec 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before this patch, we diffed the output of
nix show-derivationto determine whether to attempt to rebuild thestaticFilesderivation. Unfortunately,show-derivationoften takes a significant amount of time and seems to do much of the same work involved in building the derivation. While we're waiting for the results ofshow-derivationto decide whether to embark upon and notify the user of an asset rebuild, the user gets no indication that we've noticed their change.The tradeoff with this patch is that we'll be a little noisier: changes that don't actually impact the derivation but are within the project directory will cause no-op rebuilds for which the user will receive notifications. However, this is probably superior to a long, brooding silence while we determine whether to rebuild or not. To mitigate the problem, we ignore some common temp files that editors leave lying around, and limit our file-watching to the frontend, common, backend, and static folders.
I have:
developbranchhlint .(lint found code you did not write can be left alone)$(nix-build -A selftest --no-out-link)nix-build release.nix -A build.x86_64-linux --no-out-link(orx86_64-darwinon macOS)