Skip to content

Figure out what to do with typed decorators #4110

@wyozi

Description

@wyozi

Prerequisites

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

Issue

When this PR was merged to main in this commit, it also removed all the changes made in this PR

Ideally AFAIC PR 2981 would be re-added. This might be a bit problematic since #3203 hijacked the first generic slot for all decorate* functions, so re-adding it would be a breaking change. Also this means that since typed decorators wasn't actually added in v4, the feature isn't and cannot be used by anyone.

There's few options I can think of:

  1. Re-add typed decorators as a supplement to 'this types' even if it's a (very small) breaking change
  2. Add typed decorators to decorate* functions in fastify v5
  3. Introduce typedDecorate* functions that do the same as decorate* but with type checking
  4. Forget that typed decorators can even exist and ignore this issue

There's also this tiny documentation change that should probably be removed now: https://github.com/fastify/fastify/pull/2981/files#diff-c2db295d2a99e431bb24ac08c3953353dbb702f62b48587aa2cd76a0b78e0dbf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions