Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dancastillo
Copy link
Member

Checklist

types for #5985

@github-actions github-actions bot added the typescript TypeScript related label Aug 9, 2025
Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

lgtm

@jean-michelet
Copy link
Member

Because typing is used in two files, maybe we can export a type from fastify.d.ts:

export interface RouterOptions {
  allowUnsafeRegex?: boolean,
  buildPrettyMeta?: (route: { [k: string]: unknown, store: { [k: string]: unknown } }) => object,
  caseSensitive?: boolean,
  constraints?: {
    [name: string]: ConstraintStrategy<FindMyWayVersion<RawServer>, unknown>,
  },
  defaultRoute?: (req: FastifyRequest, res: FastifyReply) => void,
  ignoreDuplicateSlashes?: boolean,
  ignoreTrailingSlash?: boolean,
  maxParamLength?: number,
  onBadUrl?: (path: string, req: FastifyRequest, res: FastifyReply) => void,
  querystringParser?: (str: string) => { [key: string]: unknown },
  useSemicolonDelimiter?: boolean,
}

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

The typescript tests are failing

@dancastillo
Copy link
Member Author

Looks like typescript tests are failing because [email protected] introduced msgPrefix in this PR pinojs/pino#2232

Should we update fastify to use [email protected]?

@gurgunday
Copy link
Member

@dancastillo can you fix the problem in a separate PR if you're free? 🙏

@dancastillo
Copy link
Member Author

@gurgunday of course here is PR #6286

@steveatkoan

This comment was marked as off-topic.

@dancastillo
Copy link
Member Author

@mcollina @gurgunday the typescripts tests are now passing

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

LGTM

@Uzlopak Uzlopak merged commit 7d7f065 into fastify:main Aug 15, 2025
30 checks passed
@theoludwig
Copy link
Contributor

Is it possible to release a new version including this change? This should have been included in v5.5.0, as for now we get this deprecation message:

[FSTDPE022] FastifyWarning: The router options for maxParamLength property access is deprecated. Please use "options.routerOptions" instead for acce
ssing router options. The router options will be removed in fastify@6.

And we can't do nothing about it, as TypeScript will get mad.

Thanks!

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

Successfully merging this pull request may close these issues.

7 participants