-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix miss MultiInstance proper qualifiers (#241)
<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md 感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md --> ##### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [ ] `npm test` passes - [ ] tests and/or benchmarks are included - [ ] documentation is changed or added - [ ] commit message follows commit guidelines ##### Affected core subsystem(s) <!-- Provide affected core subsystem(s). --> ##### Description of change <!-- Provide a description of the change below this comment. --> <!-- - any feature? - close https://github.com/eggjs/egg/ISSUE_URL --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced handling of qualifiers for prototype instances, improving the prototype resolution process. - Updated configuration for the `BizManager` module to include distinct secret values for clients. - **Bug Fixes** - Improved logic for managing qualifiers in `ClazzMap` and `ModuleNode` classes. - **Documentation** - Updated comments and documentation to reflect changes in qualifier handling and prototype management. - **Refactor** - Simplified the prototype handling logic by consolidating multi-instance prototype management into the `ModuleGraph` class. - **Style** - Cleaned up code formatting and organization for better readability. - **Tests** - Adjusted tests to accommodate changes in the `BizManager` and qualifier handling logic. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
11 changed files
with
130 additions
and
121 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
6 changes: 4 additions & 2 deletions
6
core/metadata/test/fixtures/modules/app-multi-inject-multi/app/modules/app/module.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
BizManager: | ||
clients: | ||
foo: {} | ||
bar: {} | ||
foo: | ||
secret: '1' | ||
bar: | ||
secret: '2' | ||
|
||
secret: | ||
keys: | ||
|
5 changes: 3 additions & 2 deletions
5
core/metadata/test/fixtures/modules/app-multi-inject-multi/app/modules/app2/App.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import { Inject, SingletonProto } from '@eggjs/core-decorator'; | ||
import { Inject, ModuleQualifier, SingletonProto } from '@eggjs/core-decorator'; | ||
import { Secret, SecretQualifier } from '../foo/Secret'; | ||
|
||
@SingletonProto() | ||
export class App2 { | ||
@Inject() | ||
@SecretQualifier('app2') | ||
@ModuleQualifier('app2') | ||
@SecretQualifier('1') | ||
secret: Secret; | ||
} |
This file contains 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
Oops, something went wrong.