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!

KATT pushed a commit to trpc/trpc that referenced this pull request Oct 25, 2025
Since Fastify v5.5.0, there is the following deprecation warning:
> [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`.

Related fastify/fastify#6282,
fastify/fastify#5985

## 🎯 Changes

Update the Fastify adapter documentation to fix the deprecation warning.

Should we put the 2 possible ways for both v5.4 and prior Fastify
versions, and for v5.5.0 and above, or it's fine to only put the
"latest" way (like how it is done currently in this PR)?

<!--
Note: once you create a Pull request, we will automatically fix
auto-fixable lint issues in your branch
-->

## ✅ Checklist

- [x] I have followed the steps listed in the [Contributing
guide](https://github.com/trpc/trpc/blob/main/CONTRIBUTING.md).
- [x] If necessary, I have added documentation related to the changes
made.
- [x] I have added or updated the tests related to the changes made.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- Documentation
- Updated Fastify adapter docs to show maxParamLength is now configured
under routerOptions (default 5000).
  - Clarified that server initialization and plugin setup are unchanged.
- Confirmed no changes to public APIs and guided users to configure
maximum URL parameter lengths in the new location.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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