Skip to content

Make the grep dependency honest; drop unused requires#217

Merged
bbatsov merged 1 commit into
masterfrom
defer-requires
Jul 8, 2026
Merged

Make the grep dependency honest; drop unused requires#217
bbatsov merged 1 commit into
masterfrom
defer-requires

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 8, 2026

Copy link
Copy Markdown
Owner

This was #2 on the list ("defer the eager requires for startup"), but the investigation changed the conclusion, so the scope is smaller and honestly framed.

Finding: the eager requires can't be deferred for a startup win. helm-projectile builds Helm sources at load (top-level defclass/helm-make-source), so Helm is a hard load-time dependency, and Helm's own module graph transitively loads grep, helm-locate and helm-global-bindings regardless. I verified (featurep 'grep) etc. are all t right after (require 'helm-projectile) even with the explicit requires removed. Deferring would need every source definition restructured to be lazy - too big/risky for the payoff.

What this does instead (dependency hygiene, no perf claim):

  • require 'grep from helm-projectile--ignored-files / -directories, the two helpers that actually read grep-find-ignored-files/-directories, so they're self-sufficient instead of relying on a transitive load that could change. (Also finally retires the years-old TODO: defer this require.)
  • Drop the helm-locate and helm-global-bindings requires - nothing here uses a symbol from either.

Load cost is unchanged; the dependencies are just honest now. Compile (warnings-as-errors), checkdoc and 66 specs all pass.

  • The commits are consistent with our contribution guidelines
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog
  • You've updated the readme (no user-facing change)

helm-projectile reads `grep-find-ignored-files'/`-directories' but only
relied on `grep' being loaded transitively by Helm.  Require `grep'
from the two helpers that use those vars, so they are self-sufficient
if that transitive load ever goes away.  Also drop the `helm-locate'
and `helm-global-bindings' requires - nothing here uses a symbol from
either.

This is dependency hygiene, not a startup-time change: Helm's own module
graph still loads all three, so the load cost is unchanged.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.33%. Comparing base (c4e4ea8) to head (c568ae1).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
+ Coverage   46.14%   46.33%   +0.19%     
==========================================
  Files           1        1              
  Lines         557      559       +2     
==========================================
+ Hits          257      259       +2     
  Misses        300      300              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bbatsov
bbatsov merged commit 56f81f1 into master Jul 8, 2026
10 checks passed
@bbatsov
bbatsov deleted the defer-requires branch July 8, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants