Skip to content

fix(types): Using Express native QUERY method support#3519

Merged
RobinTail merged 5 commits into
make-v29from
native-query-method-types
Jul 7, 2026
Merged

fix(types): Using Express native QUERY method support#3519
RobinTail merged 5 commits into
make-v29from
native-query-method-types

Conversation

@RobinTail

@RobinTail RobinTail commented Jul 7, 2026

Copy link
Copy Markdown
Owner

I added QUERY to the Express types myself, so now I can remove the workaround.

Addresses the "todo" made in #3479

Summary by CodeRabbit

  • Bug Fixes
    • Improved routing registration reliability so supported request methods are handled more safely at runtime.
    • Fixed method handling for query-related routes to better match available request types.
  • Chores
    • Updated workspace release settings to allow a specific dependency version exception.

@RobinTail RobinTail added this to the v29 milestone Jul 7, 2026
@RobinTail RobinTail added dependencies Pull requests that update a dependency file refactoring The better way to achieve the same result labels Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb7b1c95-4b44-4210-9445-55e3d13b8795

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch native-query-method-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RobinTail RobinTail marked this pull request as ready for review July 7, 2026 17:42
@coveralls-official

coveralls-official Bot commented Jul 7, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — native-query-method-types into make-v29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@express-zod-api/src/method.ts`:
- Around line 5-8: The router method union is missing "query", so the
Array<FamiliarMethod> check in FamiliarMethod is rejecting the methods list and
Method no longer includes that value. Update the type definition in method.ts to
explicitly include "query" alongside the existing excluded router members, or
otherwise restore the workaround so the methods array still satisfies the union
and Method retains "query".

In `@express-zod-api/src/routing.ts`:
- Line 84: The dynamic route registration in routing.ts now silently skips
unsupported methods because `app[method]?.(path, ...handlers)` no-ops when
`app[method]` is missing. Update the route setup logic around
`register`/`app[method]` to explicitly validate that the method exists before
invoking it, and surface a clear error or log when it does not. Keep the failure
behavior consistent with the previous `register(...).call(app, ...)` approach so
unsupported methods are not swallowed silently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa0098d4-2071-4e45-9828-0edadcada821

📥 Commits

Reviewing files that changed from the base of the PR and between d794134 and 62a0120.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • express-zod-api/src/method.ts
  • express-zod-api/src/routing.ts
  • pnpm-workspace.yaml

Comment thread express-zod-api/src/method.ts
Comment thread express-zod-api/src/routing.ts

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — removal of the Express QUERY method workaround now that @types/express-serve-static-core@5.1.2 ships the type natively.

  • express-zod-api/src/method.ts — simplifies FamiliarMethod to derive directly from keyof IRouter, dropping the manual "query" union and its @todo.
  • express-zod-api/src/routing.ts — replaces the type-asserted register.call(app, ...) shim with app[method]?.(path, ...handlers).
  • pnpm-lock.yaml — upgrades @types/express-serve-static-core from 5.1.1 to 5.1.2.
  • pnpm-workspace.yaml — adds a temporary minimumReleaseAgeExclude for the new types version with a removal date.

Verified with tsc --noEmit, the full express-zod-api test suite, and pnpm -F express-zod-api build; all pass.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@RobinTail RobinTail merged commit 1b4cbe5 into make-v29 Jul 7, 2026
13 checks passed
@RobinTail RobinTail deleted the native-query-method-types branch July 7, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant