Skip to content

Conversation

@thecrypticace
Copy link
Contributor

We broke this at some point — probably when we tried to optimize rebuilds in PostCSS by not performing a full auto-source detection scan.

This PR addresses this problem by:

  1. Storing a list of found directories
  2. Comparing their mod times on every scan
  3. If the mod time has changed we scan the directory for new files which we then store and scan

@thecrypticace thecrypticace requested a review from a team as a code owner October 30, 2024 13:22
@thecrypticace thecrypticace force-pushed the fix/v4-new-file-detection branch from 5e9a595 to 8bd9176 Compare October 30, 2024 13:24
@thecrypticace thecrypticace enabled auto-merge (squash) October 30, 2024 14:23
Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small changes, but I like it.

.filter_map(Result::ok)
}

#[tracing::instrument(skip(root))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[tracing::instrument(skip(root))]
#[tracing::instrument(skip_all)]

read_dir(root, None)
}

#[tracing::instrument(skip(root))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[tracing::instrument(skip(root))]
#[tracing::instrument(skip_all)]

.filter(|path| !known.contains(path))
.collect::<Vec<_>>();

modified_dirs.clear();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit cursed, I love it.

static IGNORED_CONTENT_DIRS: sync::LazyLock<Vec<&'static str>> =
sync::LazyLock::new(|| vec![".git"]);

#[tracing::instrument(skip(root))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[tracing::instrument(skip(root))]
#[tracing::instrument(skip_all)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants