fix: Type inference breaking when Reply generic is not passed#4875
Merged
mcollina merged 25 commits intofastify:mainfrom Jul 3, 2023
aadito123:main
Merged
fix: Type inference breaking when Reply generic is not passed#4875mcollina merged 25 commits intofastify:mainfrom aadito123:main
mcollina merged 25 commits intofastify:mainfrom
aadito123:main
Conversation
Co-authored-by: Uzlopak <aras.abbasi@googlemail.com>
Member
|
cc @voxpelli |
climba03003
approved these changes
Jul 3, 2023
renovate bot
referenced
this pull request
in tomacheese/telcheck
Jul 3, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastify](https://www.fastify.io/) ([source](https://togithub.com/fastify/fastify)) | [`4.19.1` -> `4.19.2`](https://renovatebot.com/diffs/npm/fastify/4.19.1/4.19.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify (fastify)</summary> ### [`v4.19.2`](https://togithub.com/fastify/fastify/releases/tag/v4.19.2) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.1...v4.19.2) #### What's Changed - fix(typescript): route config should not pass url and method by [@​climba03003](https://togithub.com/climba03003) in [https://github.com/fastify/fastify/pull/4872](https://togithub.com/fastify/fastify/pull/4872) - Overload `DecorationMethod` to fix [#​4870](https://togithub.com/fastify/fastify/issues/4870) by [@​voxpelli](https://togithub.com/voxpelli) in [https://github.com/fastify/fastify/pull/4874](https://togithub.com/fastify/fastify/pull/4874) - fix: Type inference breaking when Reply generic is not passed by [@​aadito123](https://togithub.com/aadito123) in [https://github.com/fastify/fastify/pull/4875](https://togithub.com/fastify/fastify/pull/4875) - fix: regression with close and serverFactory by [@​mcollina](https://togithub.com/mcollina) in [https://github.com/fastify/fastify/pull/4876](https://togithub.com/fastify/fastify/pull/4876) **Full Changelog**: fastify/fastify@v4.19.1...v4.19.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/tomacheese/telcheck). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jtoar
referenced
this pull request
in redwoodjs/graphql
Jul 4, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastify](https://www.fastify.io/) ([source](https://togithub.com/fastify/fastify)) | [`4.19.0` -> `4.19.2`](https://renovatebot.com/diffs/npm/fastify/4.19.0/4.19.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify (fastify)</summary> ### [`v4.19.2`](https://togithub.com/fastify/fastify/releases/tag/v4.19.2) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.1...v4.19.2) #### What's Changed - fix(typescript): route config should not pass url and method by [@​climba03003](https://togithub.com/climba03003) in [https://github.com/fastify/fastify/pull/4872](https://togithub.com/fastify/fastify/pull/4872) - Overload `DecorationMethod` to fix [#​4870](https://togithub.com/fastify/fastify/issues/4870) by [@​voxpelli](https://togithub.com/voxpelli) in [https://github.com/fastify/fastify/pull/4874](https://togithub.com/fastify/fastify/pull/4874) - fix: Type inference breaking when Reply generic is not passed by [@​aadito123](https://togithub.com/aadito123) in [https://github.com/fastify/fastify/pull/4875](https://togithub.com/fastify/fastify/pull/4875) - fix: regression with close and serverFactory by [@​mcollina](https://togithub.com/mcollina) in [https://github.com/fastify/fastify/pull/4876](https://togithub.com/fastify/fastify/pull/4876) **Full Changelog**: fastify/fastify@v4.19.1...v4.19.2 ### [`v4.19.1`](https://togithub.com/fastify/fastify/releases/tag/v4.19.1) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.0...v4.19.1) #### What's Changed - docs(typescript): fix typo by [@​jon-codes](https://togithub.com/jon-codes) in [https://github.com/fastify/fastify/pull/4861](https://togithub.com/fastify/fastify/pull/4861) - docs(testing): add plugin testing guide by [@​Ekott2006](https://togithub.com/Ekott2006) in [https://github.com/fastify/fastify/pull/4849](https://togithub.com/fastify/fastify/pull/4849) - docs: fix platformatic-cloud anchor id by [@​sher](https://togithub.com/sher) in [https://github.com/fastify/fastify/pull/4863](https://togithub.com/fastify/fastify/pull/4863) - fix: Type narrow fix issue from PR [#​4823](https://togithub.com/fastify/fastify/issues/4823) by [@​aadito123](https://togithub.com/aadito123) in [https://github.com/fastify/fastify/pull/4869](https://togithub.com/fastify/fastify/pull/4869) #### New Contributors - [@​jon-codes](https://togithub.com/jon-codes) made their first contribution in [https://github.com/fastify/fastify/pull/4861](https://togithub.com/fastify/fastify/pull/4861) - [@​sher](https://togithub.com/sher) made their first contribution in [https://github.com/fastify/fastify/pull/4863](https://togithub.com/fastify/fastify/pull/4863) **Full Changelog**: fastify/fastify@v4.19.0...v4.19.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/redwoodjs/redwood). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jtoar
referenced
this pull request
in redwoodjs/graphql
Jul 5, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastify](https://www.fastify.io/) ([source](https://togithub.com/fastify/fastify)) | [`4.19.0` -> `4.19.2`](https://renovatebot.com/diffs/npm/fastify/4.19.0/4.19.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify (fastify)</summary> ### [`v4.19.2`](https://togithub.com/fastify/fastify/releases/tag/v4.19.2) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.1...v4.19.2) #### What's Changed - fix(typescript): route config should not pass url and method by [@​climba03003](https://togithub.com/climba03003) in [https://github.com/fastify/fastify/pull/4872](https://togithub.com/fastify/fastify/pull/4872) - Overload `DecorationMethod` to fix [#​4870](https://togithub.com/fastify/fastify/issues/4870) by [@​voxpelli](https://togithub.com/voxpelli) in [https://github.com/fastify/fastify/pull/4874](https://togithub.com/fastify/fastify/pull/4874) - fix: Type inference breaking when Reply generic is not passed by [@​aadito123](https://togithub.com/aadito123) in [https://github.com/fastify/fastify/pull/4875](https://togithub.com/fastify/fastify/pull/4875) - fix: regression with close and serverFactory by [@​mcollina](https://togithub.com/mcollina) in [https://github.com/fastify/fastify/pull/4876](https://togithub.com/fastify/fastify/pull/4876) **Full Changelog**: fastify/fastify@v4.19.1...v4.19.2 ### [`v4.19.1`](https://togithub.com/fastify/fastify/releases/tag/v4.19.1) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.0...v4.19.1) #### What's Changed - docs(typescript): fix typo by [@​jon-codes](https://togithub.com/jon-codes) in [https://github.com/fastify/fastify/pull/4861](https://togithub.com/fastify/fastify/pull/4861) - docs(testing): add plugin testing guide by [@​Ekott2006](https://togithub.com/Ekott2006) in [https://github.com/fastify/fastify/pull/4849](https://togithub.com/fastify/fastify/pull/4849) - docs: fix platformatic-cloud anchor id by [@​sher](https://togithub.com/sher) in [https://github.com/fastify/fastify/pull/4863](https://togithub.com/fastify/fastify/pull/4863) - fix: Type narrow fix issue from PR [#​4823](https://togithub.com/fastify/fastify/issues/4823) by [@​aadito123](https://togithub.com/aadito123) in [https://github.com/fastify/fastify/pull/4869](https://togithub.com/fastify/fastify/pull/4869) #### New Contributors - [@​jon-codes](https://togithub.com/jon-codes) made their first contribution in [https://github.com/fastify/fastify/pull/4861](https://togithub.com/fastify/fastify/pull/4861) - [@​sher](https://togithub.com/sher) made their first contribution in [https://github.com/fastify/fastify/pull/4863](https://togithub.com/fastify/fastify/pull/4863) **Full Changelog**: fastify/fastify@v4.19.0...v4.19.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/redwoodjs/redwood). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
still getting this issue where .send({}) isn't typed despite correct generic args with v4.19.2. it works on v4.12.0 |
Member
Please provide an reproducible code snippets and open a dedicated issue for your problem. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Checklist
npm run testandnpm run benchmarkand the Code of conduct
There was an error caused by #4823 that broke inference in a special case where the schema is provided, Reply generic is not provided and .code().send() is chained.
This would cause the type of .send to default to (payload?: unknown) => FastifyReply, even though a response type could be inferred from the schema. Fixed!