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

feat(common)!: narrow getInstance return type for http adapters #10630

Conversation

micalevisk
Copy link
Member

@micalevisk micalevisk commented Dec 4, 2022

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?

The return type of HttpServer#getInstance is always any even when we explicitly supply the adapter type (NestExpressApplication/NestFastifyApplication) to NestFactory.create

image

What is the new behavior?

Depending on which HTTP adapter is being used, we have a type-strong return on getInstance(). Now one don't need to find out what's that returned object

image

Does this PR introduce a breaking change?

  • Yes
  • No

@micalevisk micalevisk force-pushed the feat/narrowing-http-adapter-instance-type branch from a04a9ce to 3440821 Compare December 4, 2022 02:08
@coveralls
Copy link

coveralls commented Dec 4, 2022

Pull Request Test Coverage Report for Build 20f5ce29-a2a2-48d9-8a72-11fe13dacc5d

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.656%

Totals Coverage Status
Change from base Build f5bc18da-315b-421d-974d-331e8f0b5f71: 0.0%
Covered Lines: 6498
Relevant Lines: 7013

💛 - Coveralls

@micalevisk
Copy link
Member Author

@kamilmysliwiec does this introduces a breaking change? I just notice that I have checked the wrong box lol

@kamilmysliwiec
Copy link
Member

Well actually I might be the one who flagged this PR as breaking 😄 Since it no longer returns any, this PR should be considered as a (minor but still) breaking change

@micalevisk micalevisk changed the title feat(common): narrow getInstance return type for http adapters feat(common)!: narrow getInstance return type for http adapters Feb 1, 2023
@micalevisk micalevisk force-pushed the feat/narrowing-http-adapter-instance-type branch 2 times, most recently from 23abc80 to eaff999 Compare February 1, 2023 13:41
@micalevisk micalevisk force-pushed the feat/narrowing-http-adapter-instance-type branch from eaff999 to 701f7e8 Compare April 1, 2023 23:38
@kamilmysliwiec kamilmysliwiec added this to the 10.0.0 milestone Apr 5, 2023
@kamilmysliwiec kamilmysliwiec changed the base branch from master to 10.0.0 April 5, 2023 11:11
@kamilmysliwiec
Copy link
Member

Could you resolve merge conflicts @micalevisk 🙏 ?

@micalevisk micalevisk force-pushed the feat/narrowing-http-adapter-instance-type branch from 701f7e8 to 3b6b66b Compare April 5, 2023 13:32
@kamilmysliwiec kamilmysliwiec merged commit 4765b46 into nestjs:10.0.0 Apr 6, 2023
2 of 3 checks passed
@micalevisk micalevisk deleted the feat/narrowing-http-adapter-instance-type branch April 6, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants