Skip to content

refactor(shim): implement lite ShimProvider interface#75

Merged
CalvinAllen merged 3 commits into
mainfrom
refactor/74-shim-lite-provider
Dec 10, 2025
Merged

refactor(shim): implement lite ShimProvider interface#75
CalvinAllen merged 3 commits into
mainfrom
refactor/74-shim-lite-provider

Conversation

@CalvinAllen

Copy link
Copy Markdown
Contributor

Summary

Introduce ShimProvider interface with minimal methods needed by the shim binary, allowing Go's linker to eliminate unused code (net/http, progressbar, etc).

Changes

  • Add ShimProvider interface with 6 methods: Name, DisplayName, Shims, ExecutablePath, IsInstalled, ShouldReshimAfter
  • Provider interface now embeds ShimProvider
  • Shim uses ShimProvider instead of full Provider
  • Remove auto-install prompt from shim (now shows install command instead)
  • Add GetShimProvider() and GetAllShimProviders() registry functions
  • Update README and CONTRIBUTING documentation

Impact

Metric Before After Change
Shim binary size ~10.3MB ~4.5MB -56%
net/http in shim Yes No Removed
progressbar in shim Yes No Removed

Behavior Change

When a configured version is not installed, the shim now shows:

✗ Python 3.11.0 is configured but not installed
→ To install, run: dtvem install python 3.11.0

Instead of prompting to install interactively.

Test plan

  • Build compiles successfully
  • All tests pass
  • Manual testing confirms improved startup time
  • CI passes

Fixes #74

Introduce ShimProvider interface with minimal methods needed by the shim,
allowing Go's linker to eliminate unused code (net/http, progressbar, etc).

Changes:
- Add ShimProvider interface (Name, DisplayName, Shims, ExecutablePath,
  IsInstalled, ShouldReshimAfter)
- Provider now embeds ShimProvider
- Shim uses ShimProvider instead of full Provider
- Remove auto-install from shim (show install command instead)
- Add GetShimProvider/GetAllShimProviders registry functions
- Update README and CONTRIBUTING docs

Result: Shim binary reduced from ~10MB to ~4.5MB (56% smaller)

Fixes #74
@CalvinAllen

CalvinAllen commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

/release-note Shim binary dropped 56% in this release, and it is much faster!

@CalvinAllen CalvinAllen merged commit 7dde060 into main Dec 10, 2025
9 checks passed
@CalvinAllen CalvinAllen deleted the refactor/74-shim-lite-provider branch December 10, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

refactor(shim): implement lite provider interface

1 participant