v0.10.0
A service can be wrapped without being replaced (#1), which was the last
open issue and the gap most often felt next to uber/fx. go doc -all
against 0.9.1 adds Scope.Wrap and changes no signature; an upgrade cannot
break a caller, since every new rejection involves a wrapper.
Added
Scope.Wrap[T](fn)composes over whatever servesTwhen it is called,
the latest registration in this scope or the one an ancestor provides
(#1).fntakes the wrapped value first and its other dependencies after
it, read with reflection asWirereads a constructor, and returnsTor
(T, error). What is wrapped keeps its registration, hooks and lifetime, is
built first and stopped after the wrapper; wrappers chain in registration
order; a wrapper takes the wrapped lifetime, andScoped()on it makes one
per resolving scope over a shared inner. A wrapper in a child scope applies
to that scope and its descendants only, which is what uber/fx calls
Decorate. Nothing to wrap, a group, and theGroup()orOverride()
markers on a wrapper are rejected. A registration some wrapper composes
over can no longer be overridden, in its scope or a descendant's, until an
Override()replaces the wrapper itself.Explainnames a wrapper and
draws what it wraps beneath it;Validatewalks the chain.