Repository navigation
Conversation
fortuna
force-pushed
the
feat/smart-configurl-registry
branch
from
October 21, 2026 19:28
c6213d5 to
e47f2ac
Compare
fortuna
changed the base branch from
main
to
revert/configurl-registry-rename
October 21, 2026 19:28
fortuna
force-pushed
the
feat/smart-configurl-registry
branch
from
October 21, 2026 22:00
e47f2ac to
41218bc
Compare
Introduce Registry and MutableRegistry with typed construction and registration helpers. Share built-in parsers with the original provider APIs through a private adapter while preserving existing provider behavior.
Use New for config URL strings and NewFromConfig for parsed configs. Update built-in dependency construction, tests, and Go documentation.
fortuna
force-pushed
the
feat/smart-configurl-registry
branch
from
October 22, 2026 09:54
06f1d98 to
d7d15e0
Compare
fortuna
force-pushed
the
feat/smart-configurl-registry
branch
from
October 23, 2026 18:08
5ac5fa1 to
65a79ee
Compare
fortuna
marked this pull request as ready for review
October 23, 2026 18:15
Contributor
Author
|
The deprecation warnings are breaking the CI, but they are fixed in #652. The idea is to merge the two stacked PRs together. |
[Medium impact] The PR appears safe to merge; no actionable compatibility or behavior failures were found. SummaryAdds typed registries for constructing components from config URLs while keeping the released provider API available.
|
angelodlfrtr
approved these changes
Oct 26, 2026
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.
Configurl's shared provider container is limited to a fixed set of dialer and listener result types. Add typed registries so applications and component libraries can register and construct arbitrary Go result types, while preserving compatibility with the existing provider API.
Key benefits of supporting arbitrary types are:
transport.StreamEndpointandtransport.PacketEndpoint, allowing a config URL to describe both the transport and its destination. The existing provider container cannot express endpoints, which limits composition when a component needs a connection to a specific destination.This PR targets
main, which includes rollback #648. It adds the registry API and migrates SDK tools, examples, and existing SmartDialer/Mobileproxy construction to it. SmartDialer/Mobileproxy extension options remain in #649, stacked directly on this PR.RegistryexposesLookup;MutableRegistryaddsRegister. Both methods useanyto holdParser[T]values. A component config parser receives(ctx, registry, config)and uses that registry for dependencies. GenericRegister[T]checks signatures at compile time, andLookup[T]returns the exact parser type. Low-level registration derives signature validation fromParser[any], substituting the component result type.New[T]constructs from a config URL string;NewFromConfig[T]accepts a parsed*Config.NewFromConfigpasses its registry to the parser, so lookup wrappers apply throughout nested component chains. Built-ins are named config parsers, registered directly asRegister(registry, "disorder", parseDisorderDialer). Context remains available for cancellable initialization, including HTTP/3 packet-listener setup.RegisterBaseis a convenience equivalent toRegister(r, "", newInstance). To inject an existing component, register a function that returns it.errors.ErrUnsupported, including nested dependency failures. Invalid syntax/options retain parsing errors, and parser/construction errors propagate unchanged. The legacy provider API uses the same classification while preserving existing error messages.ProviderContainer,TypeRegistry,ExtensibleProvider, and their constructors, fields, and methods are deprecated with links to the replacement registry APIs. They remain source compatible. The released two-argumentBuildFuncsignature is unchanged; a private adapter binds the built-in parsers to the legacy providers. The package documentation preserves the component-network overview and key features, then introducesNewDefaultRegistryandNew[T], and custom component documentation uses the registry throughout. A private adapter preserves live changes to original provider bases and registrations.NewDefaultRegistry,New[T], andRegisterBase. The connectivity tool preserves its tracing dialer lifetimes and per-operation tracing. Migrating these callers resolves the deprecation errors caused by introducing the deprecated provider APIs.Validation: the full
xmodule race suite and staticcheck pass, including dedicated compatibility tests for the original provider API. No lint rules or source suppressions are added. Tests cover arbitrary and exact result types, external registry implementations, named function preservation, explicit low-level conversions, invalid signatures and lookup types, nil functions/results, partial results with errors, captured versus live lookup, concurrent construction, and original provider compatibility. New regressions verify concurrent registry wrappers with distinct bases, nested dependency construction, and cancellation during initialization. The new package documentation example was executed successfully, and Go doc displays the deprecation notices. No module dependencies change.Developer documentation follow-ups remain held until the final API is released in the
xmodule.