Skip to content

Remove grpc-js and fix types#2153

Merged
LukasDeco merged 1 commit intodrift-labs:masterfrom
DecentralizedDev:grpc-fix
Mar 19, 2026
Merged

Remove grpc-js and fix types#2153
LukasDeco merged 1 commit intodrift-labs:masterfrom
DecentralizedDev:grpc-fix

Conversation

@DecentralizedDev
Copy link
Contributor

@DecentralizedDev DecentralizedDev commented Mar 19, 2026

Summary by CodeRabbit

  • Chores

    • Removed an unused dependency from the SDK package.
  • Refactor

    • Updated internal type definitions in gRPC modules for better compatibility.
    • Consolidated gRPC imports from a single source package.
    • Modified filter data handling to ensure proper type conversion in subscription requests.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

The PR removes the @grpc/grpc-js dependency and sources gRPC types from @triton-one/yellowstone-grpc instead. Internal ClientDuplexStream field types are relaxed, filter offset values are converted to strings, and imports are consolidated in the gRPC isomorphic module.

Changes

Cohort / File(s) Summary
Dependency Update
sdk/package.json
Removed @grpc/grpc-js from dependencies; browser mapping already prevents inclusion in browser builds.
gRPC Stream Type Changes
sdk/src/accounts/grpcAccountSubscriber.ts, sdk/src/accounts/grpcMultiAccountSubscriber.ts
Updated internal stream field type from parameterized ClientDuplexStream<SubscribeRequest, SubscribeUpdate> to unparameterized ClientDuplexStream, preserving runtime behavior via type casting where applicable.
Program Account Filter Logic
sdk/src/accounts/grpcProgramAccountSubscriber.ts
Converted filters[].memcmp.offset values to strings via .toString() and added explicit SubscribeRequest type annotation for request variable.
gRPC Import Consolidation
sdk/src/isomorphic/grpc.node.ts
Consolidated imports from @triton-one/yellowstone-grpc, removing @grpc/grpc-js type-only import and sourcing ClientDuplexStream and ChannelOptions from Yellowstone package.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hopping past old gRPC chains,
Yellowstone now holds the reins,
Types relax, offsets stringify,
Dependencies simplify—oh my!
Cleaner imports, lighter way,
Better build in every day! 🌾

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove grpc-js and fix types' clearly captures both main changes: removing the @grpc/grpc-js dependency and updating type annotations across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

@LukasDeco LukasDeco merged commit e8ae22b into drift-labs:master Mar 19, 2026
6 of 10 checks passed
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