Skip to content

refactor(client, server): reduce link and handler options#202

Merged
dinwwwh merged 1 commit intomainfrom
refactor/codec-client-options
Mar 5, 2025
Merged

refactor(client, server): reduce link and handler options#202
dinwwwh merged 1 commit intomainfrom
refactor/codec-client-options

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented Mar 5, 2025

Summary by CodeRabbit

  • Refactor
    • Streamlined component initialization across application adapters and handlers by enforcing explicit dependency injection and simplifying configuration.
  • Tests
    • Removed redundant test cases and updated existing ones to align with the new instantiation patterns.
  • Chores
    • Cleaned up export statements by removing obsolete re-exports, reducing internal clutter.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:28am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2025

Walkthrough

The changes standardize dependency injection and initialization across various adapter modules. Constructors now require explicit serializer instances rather than using optional parameters. Interfaces and options types have been simplified by removing redundant or legacy properties, and some export statements and test cases have been removed. Both the RPC and OpenAPI handlers now directly instantiate their respective codec, matcher, and serializer dependencies using updated signatures, streamlining the module APIs across the client, openapi, and server packages.

Changes

File(s) Change Summary
packages/client/src/adapters/fetch/index.ts Added export * from './link-fetch-client' to re-export all from the link-fetch-client module.
packages/client/src/adapters/fetch/rpc-link.ts Removed optional properties (linkCodec, linkClient) from RPCLinkOptions and updated the constructor to instantiate RPCSerializer and LinkFetchClient directly.
packages/client/src/adapters/standard/rpc-link-codec.ts
packages/client/src/adapters/standard/rpc-link-codec.test.ts
Updated StandardRPCLinkCodec to require a serializer explicitly; modified tests accordingly.
packages/openapi/src/adapters/fetch/openapi-handler.ts
packages/openapi/src/adapters/node/openapi-handler.ts
Updated constructors to accept StandardHandlerOptions instead of the old options; instantiated OpenAPISerializer, OpenAPIMatcher, and OpenAPICodec (with serializer) directly; removed constructor test cases.
packages/openapi/src/adapters/standard/index.ts
packages/openapi/src/adapters/standard/openapi-codec.ts
packages/openapi/src/adapters/standard/openapi-codec.test.ts
packages/openapi/src/adapters/standard/openapi-handler.ts
Removed export for openapi-handler; updated OpenAPICodec to require an explicit serializer; deleted the interface for OpenAPIHandlerOptions.
packages/server/src/adapters/fetch/rpc-handler.ts
packages/server/src/adapters/node/rpc-handler.ts
Changed constructor signatures to require StandardHandlerOptions; instantiated RPCMatcher and RPCCodec using a new RPCSerializer directly; updated tests to reflect these changes.
packages/server/src/adapters/standard/handler.ts
packages/server/src/adapters/standard/handler.test.ts
Modified the StandardHandler constructor to remove the default empty options and require an explicit options parameter; corresponding test instantiations now include an empty object as the fourth argument.
packages/server/src/adapters/standard/index.ts Removed export for rpc-handler.
packages/server/src/adapters/standard/rpc-codec.ts
packages/server/src/adapters/standard/rpc-codec.test.ts
Revised RPCCodec to require an explicit RPCSerializer in its constructor; removed the StandardCodecOptions interface.
packages/server/src/adapters/standard/rpc-handler.ts Removed the interface definition for RPCHandlerOptions.

Sequence Diagram(s)

sequenceDiagram
  participant Router
  participant OpenAPIHandler
  participant OpenAPISerializer
  participant OpenAPIMatcher
  participant OpenAPICodec
  participant StandardHandler
  
  Router->>OpenAPIHandler: Instantiate with router and StandardHandlerOptions
  OpenAPIHandler->>OpenAPISerializer: Create serializer instance
  OpenAPIHandler->>OpenAPIMatcher: Instantiate matcher
  OpenAPIHandler->>OpenAPICodec: Instantiate codec with serializer
  OpenAPIHandler->>StandardHandler: Construct handler with matcher, codec, and options
Loading
sequenceDiagram
  participant Router
  participant RPCHandler
  participant RPCSerializer
  participant RPCMatcher
  participant RPCCodec
  participant StandardHandler
  
  Router->>RPCHandler: Instantiate with router and StandardHandlerOptions
  RPCHandler->>RPCSerializer: Create serializer instance
  RPCHandler->>RPCMatcher: Instantiate matcher
  RPCHandler->>RPCCodec: Instantiate codec with serializer
  RPCHandler->>StandardHandler: Construct handler with matcher, codec, and options
Loading

Poem

I’m a rabbit, hopping with glee,
New constructors make my API free.
Dependencies clear, no more mystery,
Exports trimmed down with a bit of history.
Code flows smoother, bugs set free—
A joyful leap in tech, as happy as can be!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 5, 2025

Open in Stackblitz

More templates

@orpc/client

npm i https://pkg.pr.new/@orpc/client@202

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@202

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@202

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@202

@orpc/server

npm i https://pkg.pr.new/@orpc/server@202

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@202

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@202

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@202

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@202

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@202

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@202

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@202

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@202

commit: 3ca49bf

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/openapi/src/adapters/fetch/openapi-handler.ts (1)

14-20: Architecture change: Enforce standard component initialization

The refactoring enforces a standardized way of initializing components across the library, ensuring consistent behavior but at the cost of flexibility. This architectural decision aligns with reducing options as mentioned in the PR title.

Consider documenting this architectural change in the CHANGELOG.md to help users understand the trade-offs made and how to adapt their code accordingly.

packages/server/src/adapters/fetch/rpc-handler.ts (1)

14-18: Consistent dependency instantiation pattern applied

The fetch adapter's RPCHandler now follows the same pattern as the node version, directly instantiating its dependencies (serializer, matcher, codec) rather than allowing them to be optionally passed through options. This consistent approach across adapters improves maintainability.

Note that the line 18 has an extra trailing newline that could be removed for consistency with the node adapter implementation, but this is very minor.

     const matcher = new RPCMatcher()
     const codec = new RPCCodec(serializer)
-

     this.standardHandler = new StandardHandler(router, matcher, codec, options)
packages/client/src/adapters/fetch/rpc-link.ts (1)

14-17: Direct instantiation of dependencies improves initialization consistency.

Instead of using optional properties from options, the constructor now explicitly instantiates:

  1. A new RPCSerializer
  2. StandardRPCLinkCodec with the serializer and options
  3. LinkFetchClient with the options

This change eliminates conditional instantiation logic and ensures consistent initialization, which reduces the risk of undefined dependencies.

Consider adding test coverage for this new initialization pattern to verify the components are properly connected.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df024bb and 3ca49bf.

📒 Files selected for processing (22)
  • packages/client/src/adapters/fetch/index.ts (1 hunks)
  • packages/client/src/adapters/fetch/rpc-link.ts (1 hunks)
  • packages/client/src/adapters/standard/rpc-link-codec.test.ts (3 hunks)
  • packages/client/src/adapters/standard/rpc-link-codec.ts (4 hunks)
  • packages/openapi/src/adapters/fetch/openapi-handler.test.ts (0 hunks)
  • packages/openapi/src/adapters/fetch/openapi-handler.ts (1 hunks)
  • packages/openapi/src/adapters/node/openapi-handler.test.ts (0 hunks)
  • packages/openapi/src/adapters/node/openapi-handler.ts (1 hunks)
  • packages/openapi/src/adapters/standard/index.ts (0 hunks)
  • packages/openapi/src/adapters/standard/openapi-codec.test.ts (0 hunks)
  • packages/openapi/src/adapters/standard/openapi-codec.ts (1 hunks)
  • packages/openapi/src/adapters/standard/openapi-handler.ts (0 hunks)
  • packages/server/src/adapters/fetch/rpc-handler.test.ts (2 hunks)
  • packages/server/src/adapters/fetch/rpc-handler.ts (1 hunks)
  • packages/server/src/adapters/node/rpc-handler.test.ts (2 hunks)
  • packages/server/src/adapters/node/rpc-handler.ts (1 hunks)
  • packages/server/src/adapters/standard/handler.test.ts (3 hunks)
  • packages/server/src/adapters/standard/handler.ts (1 hunks)
  • packages/server/src/adapters/standard/index.ts (0 hunks)
  • packages/server/src/adapters/standard/rpc-codec.test.ts (1 hunks)
  • packages/server/src/adapters/standard/rpc-codec.ts (1 hunks)
  • packages/server/src/adapters/standard/rpc-handler.ts (0 hunks)
💤 Files with no reviewable changes (7)
  • packages/server/src/adapters/standard/index.ts
  • packages/openapi/src/adapters/node/openapi-handler.test.ts
  • packages/server/src/adapters/standard/rpc-handler.ts
  • packages/openapi/src/adapters/standard/openapi-codec.test.ts
  • packages/openapi/src/adapters/standard/openapi-handler.ts
  • packages/openapi/src/adapters/fetch/openapi-handler.test.ts
  • packages/openapi/src/adapters/standard/index.ts
🔇 Additional comments (30)
packages/client/src/adapters/fetch/index.ts (1)

1-1: Adding export for link-fetch-client is a helpful enhancement.

This export makes functionality from the 'link-fetch-client' module directly accessible to consumers of the fetch adapter, improving the module's API surface.

packages/server/src/adapters/node/rpc-handler.test.ts (2)

1-1: LGTM: RPCSerializer import added.

The import statement for RPCSerializer has been correctly added to support the updated codec instantiation pattern.


116-116: Updated codec instantiation to use explicit serializer dependency.

The test now correctly reflects the standardized dependency injection pattern by explicitly providing a RPCSerializer instance to the RPCCodec constructor rather than relying on default parameters.

packages/server/src/adapters/fetch/rpc-handler.test.ts (2)

1-1: LGTM: RPCSerializer import added.

The import statement for RPCSerializer has been correctly added to support the updated codec instantiation pattern.


95-95: Updated codec instantiation to use explicit serializer dependency.

The test now correctly reflects the standardized dependency injection pattern by explicitly providing a RPCSerializer instance to the RPCCodec constructor rather than relying on default parameters.

packages/server/src/adapters/standard/handler.ts (1)

55-55:

Details

✅ Verification successful

Removed default empty object from options parameter.

This change enforces explicit dependency injection by requiring consumers to provide options when creating a StandardHandler. This is consistent with the project's move toward standardized initialization across adapter modules.

Consider verifying that all existing StandardHandler instantiations in the codebase have been updated to explicitly provide options.


🏁 Script executed:

#!/bin/bash
# Search for StandardHandler instantiations to verify they all provide options
rg "new StandardHandler\(" --type ts -A 5 -B 5

Length of output: 9448


Verification: Explicit Options Injection Enforced for StandardHandler

The changes in packages/server/src/adapters/standard/handler.ts that remove the default empty object for options have been verified. All StandardHandler instantiations in the codebase—both in production files (e.g., in the fetch, node, and rpc adapters) and in tests—now explicitly provide the options parameter. This ensures that dependency injection is enforced and that missing options result in expected TypeScript errors (as confirmed by the tests).

  • Verified instantiations in:
    • packages/server/src/adapters/fetch/rpc-handler.ts
    • packages/openapi/src/adapters/node/openapi-handler.ts
    • packages/server/src/adapters/standard/handler.test.ts and handler.test-d.ts

No instances were found where the StandardHandler was instantiated without an explicit options argument.

packages/openapi/src/adapters/standard/openapi-codec.ts (2)

2-2: Import type updated to match constructor changes

The import type for OpenAPISerializer has been updated to match the change in dependency injection pattern.


10-12:

Details

✅ Verification successful

Breaking change: Constructor now requires explicit serializer parameter

The constructor has been modified to require an explicit OpenAPISerializer instance instead of providing a default one. This is a breaking change that enforces explicit dependency injection, which improves testability and makes dependencies clearer, but requires updating all existing instantiations of this class.


🏁 Script executed:

#!/bin/bash
# Find all instantiations of OpenAPICodec that might need updating
echo "Searching for OpenAPICodec instantiations..."
rg "new OpenAPICodec\(" --type ts

Length of output: 443


Explicit Serializer Dependency Injection Confirmed

The change requiring an explicit OpenAPISerializer parameter in the OpenAPICodec constructor has been fully implemented. All instantiations in the repository now pass the serializer explicitly:

  • packages/openapi/src/adapters/node/openapi-handler.ts
  • packages/openapi/src/adapters/fetch/openapi-handler.ts
  • packages/openapi/src/adapters/standard/openapi-codec.test.ts

This confirms the breaking change has been correctly applied and no further updates are necessary.

packages/server/src/adapters/standard/rpc-codec.test.ts (1)

15-15:

Details

✅ Verification successful

Constructor signature change reflected in tests

The test has been updated to use the new constructor signature which now accepts the serializer directly instead of as part of an options object. This matches the pattern of explicit dependency injection implemented across the codebase.


🏁 Script executed:

#!/bin/bash
# Check if RPCCodec constructor has been updated accordingly in the implementation
echo "Checking RPCCodec implementation for constructor changes..."
rg "constructor.*RPCCodec" --type ts

Length of output: 167


🏁 Script executed:

#!/bin/bash
# Check for RPCCodec class implementation and its constructor signature in the codebase.
echo "Searching for class RPCCodec with its constructor in TypeScript files..."
rg -A 10 "class RPCCodec" --type ts

Length of output: 1202


Constructor Signature Update Verified

The test in packages/server/src/adapters/standard/rpc-codec.test.ts now correctly instantiates RPCCodec with a direct serializer injection, reflecting the intended constructor change. The implementation in packages/server/src/adapters/standard/rpc-codec.ts confirms that the constructor now accepts serializer as a direct dependency rather than as part of an options object.

  • Verified in rpc-codec.ts: The constructor accepts private readonly serializer: RPCSerializer.
  • The test’s instantiation new RPCCodec(serializer) is consistent with this updated signature.
packages/client/src/adapters/standard/rpc-link-codec.test.ts (3)

80-85: Constructor signature change consistently applied

The constructor change has been properly applied to the second instantiation of StandardRPCLinkCodec in the test suite, maintaining consistency.


102-104: Constructor signature change consistently applied

The constructor change has been properly applied to the third instantiation of StandardRPCLinkCodec in the test suite, maintaining consistency across all test cases.


17-21:

Details

❓ Verification inconclusive

Constructor signature simplified with direct serializer parameter

The constructor now accepts the serializer as a direct parameter instead of nested within options. The rpcSerializer option appears to have been removed, suggesting a simplification of the API by eliminating redundant parameters.


🏁 Script executed:

#!/bin/bash
# Check the StandardRPCLinkCodec implementation to confirm signature changes
echo "Checking StandardRPCLinkCodec implementation..."
rg "constructor.*StandardRPCLinkCodec" --type ts

Length of output: 155


Review Comment Verification: Constructor Simplification
The test snippet now reflects the intended API change where the serializer is passed directly into the constructor. However, our automated search for the constructor signature in the implementation did not yield definitive results, so please manually verify that the implementation (expected in packages/client/src/adapters/standard/rpc-link-codec.ts) has been updated accordingly—specifically, that it now accepts the serializer as a direct parameter and that any legacy use of the rpcSerializer option has been removed.

  • Verify that the constructor signature is updated as described.
  • Confirm that all usages of the previous rpcSerializer option have been eliminated.
packages/openapi/src/adapters/fetch/openapi-handler.ts (3)

3-3: Updated imports to include StandardHandlerOptions

The import statement has been updated to include StandardHandlerOptions, reflecting the changes to the constructor signature.


6-6: Added import for OpenAPISerializer

A new import for OpenAPISerializer has been added to support the direct instantiation of the serializer in the constructor.


14-18:

Details

❓ Verification inconclusive

Breaking change: Constructor now directly instantiates dependencies

The constructor has been significantly refactored to:

  1. Accept StandardHandlerOptions<T> instead of OpenAPIHandlerOptions<T>
  2. Directly instantiate the serializer, matcher, and codec instead of accepting them as options
  3. Pass the serializer to the codec, enforcing the dependency injection pattern

This is a breaking change that removes the ability to customize the matcher and codec through options, standardizing how these components are created and used.


🏁 Script executed:

#!/bin/bash
# Search for code that might be using the OpenAPIHandler with custom matcher or codec
echo "Searching for potential instances of OpenAPIHandler being created with custom matcher or codec options..."
rg "new OpenAPIHandler\(.*\{.*codec" --type ts
rg "new OpenAPIHandler\(.*\{.*matcher" --type ts

Length of output: 320


Breaking Change Notice: OpenAPIHandler Constructor Refactored

The constructor in packages/openapi/src/adapters/fetch/openapi-handler.ts (lines 14–18) now directly instantiates its dependencies. This refactoring:

  • Changes the constructor to accept StandardHandlerOptions<T> instead of OpenAPIHandlerOptions<T>.
  • Directly creates an OpenAPISerializer, OpenAPIMatcher, and an OpenAPICodec (with the serializer injected), thereby removing the option to supply custom matcher or codec configurations.
  • Enforces a set dependency injection pattern that may break any code relying on custom matcher or codec injection.

Initial repository searches did not reveal any usage where custom dependencies were passed to OpenAPIHandler, but please manually verify that no indirect dependencies or assumptions exist.

packages/server/src/adapters/standard/rpc-codec.ts (1)

9-11: LGTM: Constructor now requires explicit serializer dependency

The constructor signature change improves code clarity by making the RPCSerializer dependency explicit rather than optional. This change aligns with dependency injection best practices by avoiding implicit instantiation of dependencies.

packages/server/src/adapters/standard/handler.test.ts (3)

56-56: Updated constructor call to match new signature

This change correctly updates the test to match the revised StandardHandler constructor signature that now requires an explicit options object. The empty object satisfies the requirement while maintaining the test's original behavior.


322-322: Correctly updated test to use explicit empty options object

The test now properly instantiates StandardHandler with all required parameters, including the now-mandatory options object.


340-340: Successfully adapted test to use explicit options parameter

This change maintains consistent usage of the updated StandardHandler constructor across all test cases.

packages/server/src/adapters/node/rpc-handler.ts (1)

14-18: Improved dependency management through direct instantiation

This refactoring simplifies the handler's initialization by directly creating its dependencies (serializer, matcher, codec) rather than allowing them to be optionally injected through options. This approach:

  1. Makes the code more predictable by removing conditional dependency creation
  2. Eliminates potential bugs from incorrectly configured dependencies
  3. Creates a clear, consistent initialization pattern

The explicit creation of dependencies with proper constructor arguments is a good practice.

packages/client/src/adapters/fetch/rpc-link.ts (2)

4-4: Expanded imports to explicitly include RPCSerializer.

The import statement now includes RPCSerializer, which aligns with the new approach of explicit instantiation rather than optional dependency injection.


7-8: Interface simplification enhances API clarity.

The RPCLinkOptions interface has been simplified by removing the optional properties linkCodec and linkClient. This change streamlines the interface and makes the API more predictable since these dependencies are now managed internally.

packages/openapi/src/adapters/node/openapi-handler.ts (4)

3-3: Import statement updated to include StandardHandlerOptions type.

The import now correctly includes StandardHandlerOptions which is used in the constructor signature.


6-6: Explicitly importing OpenAPISerializer for direct instantiation.

This new import supports the direct instantiation approach in the constructor.


14-18: Constructor signature simplified with explicit dependency instantiation.

The constructor has been updated to:

  1. Accept a non-optional StandardHandlerOptions parameter with a default empty object value
  2. Directly instantiate dependencies (serializer, matcher, codec) rather than conditionally using options
  3. Establish a clear initialization flow with explicit object creation

This approach provides better predictability and removes ambiguity about how components are initialized.


19-19: Simplified StandardHandler initialization.

The StandardHandler is now initialized with the options parameter directly instead of spreading it into a new object. This simplification makes the code more readable while maintaining the same functionality.

packages/client/src/adapters/standard/rpc-link-codec.ts (4)

3-3: Modified import for RPCSerializer type.

The import has been updated to specifically import the RPCSerializer type, which aligns with its usage as an explicit constructor parameter.


84-84: Updated serializer reference in encode method.

The code now correctly uses this.serializer instead of the previous this.rpcSerializer property.


128-128: Updated serializer reference in decode method.

Similarly, the deserialize method now uses the renamed this.serializer property.


67-70:

Details

❓ Verification inconclusive

Constructor signature changed to require explicit serializer dependency.

The constructor now:

  1. Requires a RPCSerializer instance as the first parameter
  2. Stores it in a private readonly field
  3. Enforces explicit dependency injection of the serializer

This change improves type safety and makes the dependency requirements clear at instantiation time rather than through optional interface properties.

Ensure all consumers of this class have been updated to provide a serializer instance. Run:


🏁 Script executed:

#!/bin/bash
# Find all instantiations of StandardRPCLinkCodec to verify they provide a serializer
rg -A 2 "new StandardRPCLinkCodec" --type typescript

Length of output: 89


Ensure Serializer Dependency Injection is Verified in All Instantiations

The updated constructor signature now explicitly requires a serializer dependency, which improves type safety as noted. However, the initial verification command failed due to an incorrect file type specification. Please re-run the search using a proper glob pattern for TypeScript files to ensure all instantiations of StandardRPCLinkCodec provide a serializer. For example, try:

#!/bin/bash
# Find all instantiations of StandardRPCLinkCodec to verify they provide a serializer
rg -A 2 "new StandardRPCLinkCodec" --glob "*.ts"

Once this output is manually verified to show that all instantiations conform to the updated constructor signature, the changes can be approved.

@dinwwwh dinwwwh changed the title refactor(client, server)!: reduce link and handler options refactor(client, server): reduce link and handler options Mar 5, 2025
@dinwwwh dinwwwh merged commit 68378b4 into main Mar 5, 2025
8 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.

1 participant