Skip to content

Update to TypeScript 5.9; Uint8Array to Uint8Array<ArrayBuffer> #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2025

Conversation

rayokota
Copy link
Member

@rayokota rayokota commented Aug 18, 2025

This PR updates the repository from TypeScript 5.6 to 5.9.

TypeScript 5.9 includes breaking changes to lib.d.ts, forcing us to change some types for some functions from Uint8Array to Uint8Array<ArrayBuffer>.

The rationale for this change in TypeScript is explained in microsoft/TypeScript#59417: Some APIs accept typed arrays backed by a SharedArrayBuffer, while others only accept ArrayBuffer, and the new version of TypeScript checks the types.

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

@Copilot Copilot AI review requested due to automatic review settings August 18, 2025 16:53
@rayokota rayokota requested review from a team as code owners August 18, 2025 16:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates TypeScript from version 5.5.4 to 5.9.2 and changes all Uint8Array type annotations to Uint8Array<ArrayBuffer> throughout the encryption-related modules to improve type specificity and compatibility.

  • TypeScript version upgrade across package configurations
  • Consistent type annotation changes for binary data handling
  • Runtime conversions added to maintain compatibility with existing Buffer usage

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
schemaregistry/rules/encryption/tink/validators.ts Updated function parameter type annotation
schemaregistry/rules/encryption/tink/random.ts Updated return type annotation
schemaregistry/rules/encryption/tink/mac.ts Updated abstract method signatures
schemaregistry/rules/encryption/tink/hmac.ts Updated method signatures and parameter types
schemaregistry/rules/encryption/tink/hkdf.ts Updated function parameter and return types
schemaregistry/rules/encryption/tink/bytes.ts Updated utility function signatures
schemaregistry/rules/encryption/tink/aes_siv.ts Updated class constructor and method signatures
schemaregistry/rules/encryption/tink/aes_gcm.ts Updated method signatures
schemaregistry/rules/encryption/tink/aead.ts Updated abstract method signatures
schemaregistry/rules/encryption/encrypt-executor.ts Updated static property, method signatures, and added runtime conversions
schemaregistry/package.json Upgraded TypeScript version
package.json Upgraded TypeScript version
examples/typescript/package.json Upgraded TypeScript version

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rayokota rayokota changed the title Update to TypeScript 5.9; change from Uint8Array to Uint8Array<ArrayB… Update to TypeScript 5.9; Uint8Array to Uint8Array<ArrayBuffer> Aug 18, 2025
@sonarqube-confluent
Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage 100.00% Coverage (48.00% Estimated after merge)
  • Duplications No duplication information (2.00% Estimated after merge)

Project ID: confluent-kafka-javascript

View in SonarQube

Copy link
Contributor

@emasab emasab left a comment

Choose a reason for hiding this comment

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

LGTM, forced breaking changes because of the Typescript and ES2024 changes

@rayokota rayokota merged commit a78d923 into master Aug 18, 2025
3 checks passed
@rayokota rayokota deleted the ts-5.9 branch August 18, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants