Skip to content

Comments

WIP chore: upgrade @types/node to v25.2.0 and fix type compatibility#3078

Open
lahirumaramba wants to merge 3 commits intomainfrom
lm-update-types-node
Open

WIP chore: upgrade @types/node to v25.2.0 and fix type compatibility#3078
lahirumaramba wants to merge 3 commits intomainfrom
lm-update-types-node

Conversation

@lahirumaramba
Copy link
Member

Description

This PR bumps the @types/node development dependency from ^22.8.7 to ^25.2.0 to keep type definitions up to date.

As a result of stricter type definitions in newer @types/node versions, this PR also addresses the resulting TypeScript compilation errors by:

  • Refactoring header assignments in AsyncHttpCall and AsyncHttp2Call constructors to use a local variable, allowing TypeScript's control flow analysis to properly resolve the array check and narrow the header types to http.OutgoingHttpHeaders.
  • Explicitly typing the error parameter as any in the http2Session.on('error', ...) handler to prevent implicit typing errors.

@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Feb 24, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @lahirumaramba, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on maintaining the project's type definition currency by upgrading the @types/node development dependency. This upgrade necessitated several targeted type compatibility fixes within the codebase, primarily involving refactoring header handling logic in HTTP call classes and explicitly typing an error parameter, ensuring the application remains robust and type-safe with the latest Node.js type definitions.

Highlights

  • Dependency Upgrade: Upgraded the @types/node development dependency from ^22.8.7 to ^25.2.0 to ensure up-to-date type definitions.
  • Type Compatibility Fixes: Addressed TypeScript compilation errors that arose from stricter type definitions in the newer @types/node version.
  • Header Assignment Refactoring: Refactored header assignments in AsyncHttpCall and AsyncHttp2Call constructors to use local variables, improving TypeScript's control flow analysis and correctly narrowing header types to http.OutgoingHttpHeaders.
  • Error Parameter Typing: Explicitly typed the error parameter as any in the http2Session.on('error', ...) handler to resolve implicit typing issues.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package-lock.json
    • Updated @types/node from version 22.10.2 to 25.2.0.
    • Updated undici-types from version 6.20.0 to 7.16.0.
    • Removed @types/node from the top-level dependencies section.
  • package.json
    • Updated the @types/node development dependency from ^22.8.7 to ^25.2.0.
    • Removed @types/node from the regular dependencies section.
  • src/utils/api-request.ts
    • Refactored header assignment logic in AsyncHttpCall and AsyncHttp2Call constructors to use a local variable and explicitly cast to http.OutgoingHttpHeaders.
    • Added an Array.isArray check to header validation in AsyncHttpCall and AsyncHttp2Call.
    • Explicitly typed the error parameter as any in the http2Session.on('error', ...) handler.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the @types/node dependency and addresses the resulting TypeScript compilation errors. The changes correctly handle stricter type definitions for HTTP headers and fix an implicit any error in an event handler. The logic is sound. I have one suggestion to improve code maintainability by reducing duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant