Skip to content

Investigation on TypeScript structure #4081

@climba03003

Description

@climba03003

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Currently, the typing system of fastify is just good to use.
However, it restricted the usage on certain way and may not be good enough.
I open a new issue here for investigating how can we improve the typing system before fastify@5 lands (around 1 year later).

We have plenty idea of this area but do not have enough effort to push thing forward.
I hope community can put their effort together with us and improve this area.

  1. Unify of using object Generic

We add a lot of Generic in the typings system, it is easy to use without modify the Generic.
However, when we override one of them. It will collide with the others types.
Unify of using object Generic can prevent this problem.

#3642 is the first attempt of refactoring.

  1. Promote chaining fastify types

This approach is similar to Express and Koa which is optimal solution for stacking up decorated instance.
fastify/fastify-type-provider-typebox#5 (comment)

Motivation

No response

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionIssues or PRs with this label will never stalefeature requestNew feature to be addedhelp wantedHelp the community by contributing to this issuesemver-majorIssue or PR that should land as semver majorsemver-minorIssue or PR that should land as semver minortypescriptTypeScript related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions