Repository navigation
docs: explain GoForj Wire features and performance - #29
Merged
Merged
Conversation
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.
What
Replace the disconnected Greeter snippets with an orders API and background worker wired by hand, then wired with the full provider list. Show how adding an audit-log dependency changes generated calls, how shared services are preserved, and what happens when a provider is missing. Explain when hand wiring is enough.
Explain what this fork adds to Google Wire: faster repeat runs, watch mode, a Wire version pinned in go.mod, workspace fixes, and cache and profiling tools. Show how to switch generators while keeping Google Wire imports, state the Go 1.25 requirement, and simplify the setup instructions.
Lead with measured generation gains in projects with hundreds of dependencies: 84-109x on unchanged runs and 18-19x after function body edits. Add a full performance report and all 932 timing samples, including comparisons with v1.2.0, cold caches, and generation from a separate tools module.
Why
Readers need to understand why they would use Wire at all, as well as why they would choose this maintained fork. The examples show the maintenance work Wire takes over without hiding provider registration or implying that every small app needs it. The old “8-10x+ faster compile times” claim did not explain what was measured. The README now shows the large gains where they apply, while keeping first-run costs and the workspace fix's extra file checks visible.
The audit included 164 successful generation/compilation checks, full tests on Go 1.25.0, 1.26.3, and 1.27.2, the race detector on Go 1.25, go vet, and workspace checks using the published v1.3.0 tool. The migration commands were also checked with both import paths, go generate, and no local Wire replacement.
The README examples were generated and compiled using published Wire v1.3.0 with no local replacement. Both versions produced equivalent dependency graphs, shared the order service between the handler and worker, and preserved the shared database after the constructor change. The missing-provider diagnostic and repeat-generation output were checked too.