Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): always bind global modules when scan for modules #12880

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

5d-jh
Copy link

@5d-jh 5d-jh commented Dec 4, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #12879

What is the new behavior?

Scanning for modules always bound for global modules,

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This branch is based on 9.4.3. Hence should not be merged into master.

@coveralls
Copy link

coveralls commented Dec 4, 2023

Pull Request Test Coverage Report for Build de00f050-29aa-4a07-94cd-4a5c3beeb9b5

  • 7 of 8 (87.5%) changed or added relevant lines in 1 file are covered.
  • 199 unchanged lines in 30 files lost coverage.
  • Overall coverage increased (+0.7%) to 92.992%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/scanner.ts 7 8 87.5%
Files with Coverage Reduction New Missed Lines %
packages/common/pipes/file/file-type.validator.ts 1 87.5%
packages/common/pipes/parse-enum.pipe.ts 1 94.44%
packages/common/pipes/parse-float.pipe.ts 1 92.31%
packages/common/pipes/parse-int.pipe.ts 1 92.86%
packages/common/pipes/parse-uuid.pipe.ts 1 94.74%
packages/common/pipes/validation.pipe.ts 1 94.34%
packages/core/services/reflector.service.ts 1 95.0%
packages/microservices/server/server-redis.ts 1 97.01%
packages/microservices/client/client-rmq.ts 2 81.42%
packages/platform-express/multer/interceptors/file-fields.interceptor.ts 2 88.24%
Totals Coverage Status
Change from base Build 439f5e56-8568-4500-9046-115a7dca6920: 0.7%
Covered Lines: 6555
Relevant Lines: 7049

💛 - Coveralls

if (this.isForwardReference(moduleDefinition)) {
moduleDefinition = (moduleDefinition as ForwardReference).forwardRef();
const moduleInstance = await this.insertModule(moduleDef, scope);
this.container.bindGlobalsToImports(moduleInstance);
Copy link
Member

@kamilmysliwiec kamilmysliwiec Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bindGlobalsToImports should be called only for lazy modules.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will create parameter whether modules bind to global

@5d-jh
Copy link
Author

5d-jh commented Dec 8, 2023

Could you create release branch for 9.x so this branch merged?

@kamilmysliwiec
Copy link
Member

Just fyi, in case you're blocked by this change you can always use patch-package to fix this up for your project.

mehmetik

This comment was marked as resolved.

@micalevisk
Copy link
Member

@5d-jh can you please rebase your branch

@5d-jh
Copy link
Author

5d-jh commented Jun 30, 2024

@micalevisk Because this pr resolves issue on v9, this pr should be merged into v9 release branch which is currently not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants