Skip to content

Migrate devboost's default zsh plugin manager from znap to zinit #6

Description

@rolfsormo

Motivation

Discovered while debugging a slow real-machine zsh startup: the machine had both
devboost's own znap (loading zsh-users/zsh-autosuggestions and
zsh-users/zsh-syntax-highlighting) and a separately pre-existing zinit setup
(loading zdharma-continuum/fast-syntax-highlighting, zsh-users/zsh-autosuggestions,
zsh-users/zsh-completions, plus several zinit annexes) active at the same time.

zprof showed zinit-related plugin loading at ~55% of total (already-fast, ~60ms)
shell init time, with znap's own loading on top of that — clearly redundant, and a
plausible contributor to the user's still-not-instant shell startup.

Decision from conversation: zinit is the more feature-complete option (the user's
own hand-tuned setup already relies on it, including zsh-completions and multiple
annexes that znap doesn't have equivalents for) — so rather than just detecting the
conflict and asking the user to pick one, devboost should migrate its own default to
zinit, matching what real users are already reaching for.

Scope

This is a real default-behavior change, not a quick swap:

  • Rewrite modules/module_znap.shmodules/module_zinit.sh (different install
    method: zinit self-installs via its own bootstrap, not a plain git clone like
    znap).
  • Update modules/module_zsh.sh's generated .zshrc.devboost content — zinit's
    config style (zinit light, ice-modifiers like zinit ice wait lucid, etc.) is
    meaningfully different from znap's simpler znap source API. Need to decide how
    much of zinit's turbo-mode/lazy-loading features devboost should turn on by default
    (could itself reduce startup time further, e.g. wait lucid deferred loading).
  • Update .devboost.yaml.example (currently has znap_path, znap_git config keys
    under zsh:).
  • Update README's tool list and ARCHITECTURE.md.
  • Update/add tests (currently tests/test-macos.sh etc. don't specifically assert on
    which plugin manager is used, but any config-content assertions may need updates).
  • Decide: does devboost detect an existing znap install on a user's machine (from a
    previous devboost version) and migrate it, or is this a clean cutover with a
    migration note in CHANGELOG/README for existing users?
  • Add a doctor check (in the health-check module, once it exists — see related issue)
    that warns if another zsh plugin manager (oh-my-zsh, antidote, zplug, or a stray
    znap left over from before this migration) is active alongside zinit, same pattern
    as the oh-my-zsh detection.

Relates to

  • module_health.sh environment health checks issue
  • zsh startup slowness investigation issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions