Repository navigation
feat(container): 新增构造器注入 make() - #4
Merged
Merged
Conversation
- Container::make() 按构造参数类型递归解析依赖 - 支持已注册服务、接口绑定、默认值与 nullable 参数 - 检测循环依赖并提示依赖链 - 新增 DI / 接口绑定 / 循环依赖测试
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.
变更
新增
Container::make()构造器注入:支持:
不包含
scoped():在 FastD 还没有请求级生命周期集成前,它容易成为没有实际调用方的假抽象,后续单独设计。验证
后续
make()要真正发挥作用,下一步需要在RouteMatcher/RouteMiddleware增加 resolver,并由 FastD Application 注入容器 resolver;该集成单独跟进。本 PR 不发版本。