Skip to content

feat(client)!: update standard link interceptors and plugins options#333

Merged
dinwwwh merged 3 commits intomainfrom
feat/client/update-standard-link-interceptors-and-plugins
Apr 6, 2025
Merged

feat(client)!: update standard link interceptors and plugins options#333
dinwwwh merged 3 commits intomainfrom
feat/client/update-standard-link-interceptors-and-plugins

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented Apr 5, 2025

This update change options related to RPCLink and OpenAPILink from receive 3 args like this options, input, path to this { context, input, path }

Summary by CodeRabbit

  • Refactor

    • Consolidated parameters across client calls and interceptors into a unified object structure.
    • Updated options and type definitions to enforce required properties, enhancing clarity and type safety.
    • Streamlined retry operations for clearer error handling and more consistent behavior.
  • Tests

    • Revised test cases to align with the new parameter structure, ensuring a reliable and maintainable validation process.
    • Updated fetch function signatures in test cases to accept a single request parameter, simplifying the interface.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 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 Apr 5, 2025 2:12pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2025

Walkthrough

The changes refactor how options are passed in various client modules. Multiple functions that previously accepted separate parameters (e.g., options, path, input) now receive a single consolidated object. This update affects test cases and implementations in the fetch client, standard link, RPC codec, retry plugin, and type definitions. Interface signatures have been updated to use new interceptor option types, and deprecated parameter structures have been removed, standardizing calls across these modules.

Changes

Files Change Summary
packages/client/src/adapters/fetch/link-fetch-client.test.ts
packages/client/src/adapters/fetch/link-fetch-client.ts
Consolidated separate fetch parameters (options, ['example'], { body: true }) into a single object. Updated interface signatures to use StandardLinkInterceptorOptions.
packages/client/src/adapters/standard/link.test.ts
packages/client/src/adapters/standard/link.ts
Modified interceptor function calls to pass individual properties directly; added new interfaces StandardLinkInterceptorOptions and StandardLinkClientInterceptorOptions for improved type definitions.
packages/client/src/adapters/standard/rpc-link-codec.ts Updated StandardRPCLinkCodecOptions to accept consolidated interceptor options. Refactored parameters for url, maxUrlLength, method, and headers and streamlined the encode method with a combined options object.
packages/client/src/plugins/retry.test.ts
packages/client/src/plugins/retry.ts
Revised retry function calls to use a unified object instead of individual parameters. Updated plugin interfaces (ClientRetryPluginAttemptOptions and ClientRetryPluginContext) to align with the consolidated parameter structure.
packages/client/src/types.ts Restructured the ClientOptions type by introducing a new interface. The changes enforce a mandatory context property and update the FriendlyClientOptions type accordingly.
apps/content/docs/client/rpc-link.md Updated the parameter list of the method function in RPCLink to destructure path directly from the first argument object.
apps/content/docs/plugins/client-retry.md Modified the parameter structure of the retry function in ClientRetryPlugin to destructure path from a single object.
packages/client/src/adapters/fetch/rpc-link.test.ts Changed the fetch function signature in RPCLink to accept a single request parameter instead of separate url and init parameters.
packages/openapi-client/src/adapters/fetch/openapi-link.test.ts Updated the fetch function signature in OpenAPILink to accept a single request parameter instead of separate url and init parameters.

Sequence Diagram(s)

sequenceDiagram
    participant T as Test
    participant LFC as LinkFetchClient
    participant F as fetch API
    T->>LFC: call(request, options, path, input)
    LFC->>F: fetch(request, init, { ...options, path, input })
Loading
sequenceDiagram
    participant T as Test
    participant SL as StandardLink
    participant I as Interceptor
    T->>SL: call(request, options, path, input)
    SL->>I: intercept({ ...options, path, input, request })
Loading

Possibly related PRs

  • unnoq/orpc#304: Modifications to function call parameters and handling of options for the fetch method create parallels with this PR.
  • unnoq/orpc#291: Similar consolidation of parameters into a unified object is addressed, showing a strong code-level connection.
  • unnoq/orpc#202: Adjustments to the fetch function's argument structure align with the updates in the RPCLinkOptions interface.

Poem

I'm a rabbit with a codey beat,
Hopping through changes, swift and neat.
Parameters merge like carrots in a stew,
Each commit a leap, fresh and new.
With my paws, I celebrate refactors so sweet –
A hop to a cleaner code retreat!
🥕🐇


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28806c4 and f567242.

📒 Files selected for processing (1)
  • packages/openapi-client/src/adapters/fetch/openapi-link.test.ts (1 hunks)
🔇 Additional comments (1)
packages/openapi-client/src/adapters/fetch/openapi-link.test.ts (1)

19-19: Good signature simplification.

The change from fetch: async (url, init) => {} to fetch: async (request) => {} aligns with the PR's objective of using a unified object parameter pattern. This simplifies the function signature and makes the code more consistent with the changes across the codebase.

✨ 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 plan to trigger planning for file edits and PR creation.
  • @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 Apr 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 Apr 5, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@333

@orpc/client

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

@orpc/contract

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

@orpc/openapi

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

@orpc/openapi-client

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

@orpc/react

npm i https://pkg.pr.new/@orpc/react@333

@orpc/react-query

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

@orpc/server

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

@orpc/shared

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

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@333

@orpc/standard-server

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

@orpc/standard-server-fetch

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

@orpc/standard-server-node

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

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@333

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@333

@orpc/vue-colada

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

@orpc/vue-query

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

@orpc/zod

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

commit: f567242

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 (1)
packages/client/src/plugins/retry.ts (1)

39-39: Refine return type to avoid confusing void
According to the static analysis hints, using void within a union can be confusing. Consider replacing it with undefined or a more specific type.

Apply this diff to clarify the union type:

- onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | (() => void)
+ onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => undefined | (() => void)
🧰 Tools
🪛 Biome (1.9.4)

[error] 39-39: void is confusing inside a union type.

Unsafe fix: Use undefined instead.

(lint/suspicious/noConfusingVoidType)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between aa59d19 and 195ab04.

📒 Files selected for processing (8)
  • packages/client/src/adapters/fetch/link-fetch-client.test.ts (1 hunks)
  • packages/client/src/adapters/fetch/link-fetch-client.ts (2 hunks)
  • packages/client/src/adapters/standard/link.test.ts (1 hunks)
  • packages/client/src/adapters/standard/link.ts (3 hunks)
  • packages/client/src/adapters/standard/rpc-link-codec.ts (5 hunks)
  • packages/client/src/plugins/retry.test.ts (7 hunks)
  • packages/client/src/plugins/retry.ts (4 hunks)
  • packages/client/src/types.ts (1 hunks)
🧰 Additional context used
🧬 Code Definitions (5)
packages/client/src/adapters/fetch/link-fetch-client.ts (2)
packages/client/src/types.ts (1)
  • ClientContext (6-6)
packages/client/src/adapters/standard/link.ts (1)
  • StandardLinkInterceptorOptions (13-16)
packages/client/src/plugins/retry.ts (2)
packages/client/src/types.ts (1)
  • ClientContext (6-6)
packages/client/src/adapters/standard/link.ts (1)
  • StandardLinkInterceptorOptions (13-16)
packages/client/src/types.ts (2)
packages/server/src/index.ts (1)
  • ClientContext (24-24)
packages/client/tests/helpers.ts (1)
  • ClientContext (130-130)
packages/client/src/adapters/standard/rpc-link-codec.ts (3)
packages/client/src/adapters/standard/link.ts (1)
  • StandardLinkInterceptorOptions (13-16)
packages/client/src/types.ts (1)
  • HTTPMethod (4-4)
packages/standard-server/src/types.ts (1)
  • StandardHeaders (1-3)
packages/client/src/adapters/standard/link.ts (3)
packages/client/src/types.ts (2)
  • ClientContext (6-6)
  • ClientOptions (8-12)
packages/standard-server/src/types.ts (1)
  • StandardRequest (13-24)
packages/shared/src/interceptor.ts (2)
  • Interceptor (14-18)
  • intercept (101-122)
🪛 Biome (1.9.4)
packages/client/src/plugins/retry.ts

[error] 39-39: void is confusing inside a union type.

Unsafe fix: Use undefined instead.

(lint/suspicious/noConfusingVoidType)

🔇 Additional comments (49)
packages/client/src/adapters/fetch/link-fetch-client.test.ts (1)

44-44: LGTM: Parameter consolidation follows new pattern

The test now properly uses the consolidated parameter pattern, combining options, path, and input into a single object. This matches the implementation changes in the link-fetch-client.ts file.

packages/client/src/adapters/standard/link.test.ts (2)

46-49: LGTM: Parameter structure updated correctly

The test now uses individual properties (context, signal, lastEventId) instead of passing them in a single options object. This matches the updated interceptor API pattern.


55-59: LGTM: Required parameters added to clientInterceptor test

The test now correctly includes path and input properties in the clientInterceptor call expectations, along with the expanded individual context properties. This properly reflects the standardized parameter structure.

packages/client/src/plugins/retry.test.ts (12)

61-61: LGTM: Retry function call expectations updated

Test now correctly verifies that the retry function receives a consolidated object containing context, path, and input properties.


103-109: LGTM: shouldRetry function expectations updated

Test now properly verifies that shouldRetry receives an object containing all required properties (attemptIndex, error, context, input, path).


114-121: LGTM: Second shouldRetry call expectations updated

The second call expectations are correctly updated to match the new parameter structure.


137-144: LGTM: onRetry function expectations updated

Test now correctly verifies that onRetry receives the standardized parameter object structure.


147-154: LGTM: Second onRetry call expectations updated

The second onRetry call expectations are properly updated to match the new parameter structure.


157-164: LGTM: Third onRetry call expectations updated

The third onRetry call expectations are properly updated to match the new parameter structure.


281-288: LGTM: shouldRetry expectations in event iterator test updated

Test now properly verifies that shouldRetry in the event iterator context receives the consolidated parameter object with required properties.


386-393: LGTM: shouldRetry expectations in shouldRetry=false test updated

First shouldRetry call verification is properly updated to the new object parameter structure.


396-403: LGTM: Second shouldRetry call in shouldRetry=false test updated

Second shouldRetry call verification is properly updated to the new object parameter structure.


424-432: LGTM: onRetry expectations in event iterator test updated

First onRetry call verification in event iterator context is properly updated to the new parameter structure.


435-443: LGTM: Second onRetry call in event iterator test updated

Second onRetry call verification is properly updated to the new parameter structure.


446-454: LGTM: Third onRetry call in event iterator test updated

Third onRetry call verification is properly updated to the new parameter structure.

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

4-4: LGTM: Added StandardLinkInterceptorOptions import

Correctly imported StandardLinkInterceptorOptions type to support the updated fetch method signature.


11-11: LGTM: Updated fetch method signature

The fetch method signature now correctly uses StandardLinkInterceptorOptions instead of ClientOptions, which includes the additional path and input properties needed for the new parameter structure.


27-27: LGTM: Updated fetch method call

The fetch method call now correctly spreads the options and adds path and input to a single object, matching the updated signature requirements.

packages/client/src/types.ts (2)

14-16: Advanced conditional type usage
This conditional setup for FriendlyClientOptions is clever and appears to fulfill the requirement that context be optional only when T is an empty type. Nicely done!


8-12:

Details

✅ Verification successful

Verify mandatory context usage
Now that ClientOptions requires a context property, please confirm that all consuming code correctly provides this property. Missing or undefined context references may cause runtime errors.

Below is a script to locate all references to ClientOptions and confirm that context is always passed:


🏁 Script executed:

#!/bin/bash
# Scan the entire repository for references to ClientOptions and show surrounding lines

rg -A 5 "ClientOptions<" 

Length of output: 17619


Verification Complete: All Consumers Provide a Valid context

After reviewing the repository, I've confirmed that every use of ClientOptions correctly supplies a defined context. In particular:

  • Default Handling in Utility:
    The function resolveFriendlyClientOptions (in packages/client/src/utils.ts) provides a default (an empty object cast to type T) when context isn’t supplied, ensuring no runtime errors occur.

  • Explicit Context in Tests and Implementations:
    For example, in packages/client/src/dynamic-link.test.ts, context is explicitly provided. Similarly, other consumers in client.ts, various adapter files, and server implementations pass the context either directly or via the utility.

  • Consistent Propagation Across Adapters:
    All adapter and client method calls (including those in the standard, fetch, and openapi modules) forward a valid ClientOptions object that always contains a proper context.

No further action is required regarding the mandatory context property.

packages/client/src/plugins/retry.ts (15)

2-3: Imports updated to reflect new interceptors
The revised import lines correctly reflect the new consolidated options approach.


7-7: Interface extension for consistency
Extending ClientRetryPluginAttemptOptions from StandardLinkInterceptorOptions<T> unifies retry logic with the standard link mechanism. This looks good.


20-20: Refined parameterization
Defining retry? to accept StandardLinkInterceptorOptions<ClientRetryPluginContext> ensures consistent argument passing and simplifies usage.


27-27: Enhanced retryDelay signature
Switching to [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>] gives access to more contextual data (like attemptIndex) for computing delay.


34-34: Aligned shouldRetry signature
Accepting ClientRetryPluginAttemptOptions<ClientRetryPluginContext> parallelizes the approach used in retryDelay for richer context.


66-67: Correct usage of default or context-supplied retry value
The code correctly falls back on this.defaultRetry if context.retry is undefined. This promotes flexible configuration.


70-72: Successfully retrieving other context-based retry settings
Extracting retryDelay, shouldRetry, and onRetry from interceptorOptions.context ensures each property can be overridden individually.


78-78: Local storage of lastEventId
Storing lastEventId in a local variable is a clean approach, avoiding repeated property lookups. Looks good.


87-87: Configuring updated interceptor options
Merging the updated lastEventId back into interceptorOptions is straightforward and ensures consistent usage downstream.


94-95: Constructing attemptOptions
Spreading all updated interceptor options plus additional fields (attemptIndex, error, etc.) creates a cohesive context for retry logic.


100-100: Closing object construction
This line simply concludes the object definition. No issues here.


110-110: Conditional function invocation
Using the optional chaining operator with onRetry is a robust, concise way to handle potential undefined references.


112-112: Awaiting dynamic retryDelay
Awaiting the resolved delay from retryDelay is consistent with the rest of the dynamic value logic. Good approach.


120-120: Returning from interceptor
Forwarding the call to interceptorOptions.next(updatedInterceptorOptions) completes the chain of interceptors neatly.


123-124: Check for signal abort
Throwing the error when the signal is aborted ensures the retry loop stops gracefully.

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

2-2: Updated link import
Importing StandardLinkInterceptorOptions is appropriate for the newly consolidated options pattern.


14-14: Use of StandardLinkInterceptorOptions
Revising the url property to rely on a single argument of StandardLinkInterceptorOptions<T> streamlines method calls.


21-21: Unified approach for maxUrlLength
Adapting maxUrlLength to accept StandardLinkInterceptorOptions<T> aligns well with the rest of the refactoring.


28-28: Consistent HTTPMethod signature
Switching method to use [StandardLinkInterceptorOptions<T>] follows the same consolidated options structure.


41-41: Consolidated headers handling
Applying headers as a Value<StandardHeaders, [StandardLinkInterceptorOptions<T>]> ensures consistent scoping of request customization.


63-63: Forming a single generalOptions object
Merging options, path, and input into generalOptions simplifies subsequent calls to value(). Good approach.


65-67: Leverage dynamic property resolution
Fetching runtime values such as expectedMethod, headers, and baseUrl via value() with the newly combined generalOptions is cleanly implemented.


82-82: Adjusted maxUrlLength usage
Using value(this.maxUrlLength, generalOptions) ensures the correct property is dynamically retrieved during runtime.

packages/client/src/adapters/standard/link.ts (6)

13-16: Good addition of a well-structured interface

This new interface consolidates previously separate parameters into a single type, making the code more maintainable and type-safe. The extension of ClientOptions<T> is appropriate as it builds on the existing type system.


18-20: Proper hierarchical type extension

This interface correctly extends StandardLinkInterceptorOptions<T> to include the request property, providing a clean type hierarchy that reflects the functional relationships between these interceptor options.


23-24: Good refactoring to use the new interfaces

Replacing inline type definitions with the newly created interfaces improves code readability and maintainability. This change makes the code more self-documenting and easier to understand.


46-46: Properly updated parameter structure

The updated parameter structure correctly consolidates the previously separate parameters into a single object, making the function call cleaner and more consistent with modern JavaScript/TypeScript patterns.


58-59: Correctly refactored parameter passing

The consolidation of parameters in this interceptor call matches the pattern established in the rest of the PR. The destructuring in the callback ensures that the parameters are used correctly in the function call.


13-59:

Details

❓ Verification inconclusive

Verify that all consumers are updated for this breaking change

These interface changes and parameter consolidation constitute a breaking change (as noted by the ! in the PR title). While the changes themselves are well-structured, it's important to ensure all consumers of these APIs are updated.


🏁 Script executed:

#!/bin/bash
# Search for direct imports and usages of StandardLink
echo "Searching for direct imports and usages of StandardLink"
rg -t ts -A 5 "import.*StandardLink" --exclude="link.ts"

# Search for usages of call method
echo "Searching for calls to 'call' method that might need updating"
rg -t ts "\.call\(\s*[^{].*path.*input.*options" --exclude="link.ts"

Length of output: 1209


Below is a revised review comment that reflects your concerns and the difficulties encountered with our automated search. Note that while we attempted to verify consumer updates using automated searches, the original flags caused errors. A revised script using the correct flags is suggested below. However, please manually verify that all consumers have updated their usage of the new StandardLink APIs.

Action: Confirm Consumer Updates for Breaking Change

The modifications to the StandardLink interfaces and consolidation of parameters introduce a breaking change (as indicated by the ! in the PR title). While automated searches using rg were attempted, initial runs encountered flag errors. A revised verification script is provided below that uses the correct flag (--glob '!**/link.ts') instead of --exclude. Please confirm manually that:

  • No outdated imports or direct usages of StandardLink exist in TypeScript files (other than in link.ts).
  • All calls to the call method throughout the codebase have been updated to meet the new parameter structure.

Suggested revised verification script:

#!/bin/bash
echo "Searching for direct imports and usages of StandardLink"
rg -t ts --glob '!**/link.ts' "import.*StandardLink" || true

echo "Searching for calls to 'call' method that might need updating"
rg -t ts --glob '!**/link.ts' "\.call\(" || true

Please rerun these commands and perform a manual review to ensure that all consumers have been updated accordingly.

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 (2)
apps/content/docs/plugins/client-retry.md (2)

27-36: Refined Parameter Destructuring in the Default retry Option
The updated function signature now uses object destructuring ({ path }), which streamlines parameter handling. Please ensure that all callers guarantee that path is provided in the expected format (typically an array) so that the use of .join('.') does not lead to runtime errors. Consider adding a brief inline comment or update the documentation to clarify the expected type for path.


52-60: Clarify Consistency Between Default Options and Client Context in Usage Example
In the default options (lines 27–36), retry is specified as a function, while in the usage snippet (lines 52–60) the retry value is provided as a number. Make sure the documentation clearly explains the dual nature of this property—i.e. when it is used as a callable function versus a numeric override. This clarification will help prevent any confusion for clients integrating with the plugin.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 195ab04 and 28806c4.

📒 Files selected for processing (3)
  • apps/content/docs/client/rpc-link.md (1 hunks)
  • apps/content/docs/plugins/client-retry.md (1 hunks)
  • packages/client/src/adapters/fetch/rpc-link.test.ts (2 hunks)
🔇 Additional comments (2)
apps/content/docs/client/rpc-link.md (1)

74-74: Refactored Parameter Destructuring in Custom Request Method
The updated function now destructures both context and path from a single parameter object, which aligns with the PR objectives of consolidating options and standardizing parameter handling. This change simplifies the function signature while maintaining clarity. Ensure that all downstream calls and references to this function have been updated accordingly.

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

21-21: Updated fetch signature aligned with the PR objectives.

The change from fetch: async (url, init) => {...} to fetch: async (request) => {...} consolidates parameters into a single object, which aligns with the PR objective to standardize how options are passed in client modules. This is consistent with modern fetch API patterns and makes the code more maintainable.

Also applies to: 53-53

@dinwwwh dinwwwh merged commit 6b06c96 into main Apr 6, 2025
8 checks passed
dinwwwh added a commit that referenced this pull request Apr 8, 2025
revert some options from "feat(client)!: update standard link interceptors and plugins options (#333)"
dinwwwh added a commit that referenced this pull request Apr 8, 2025
revert some options from "feat(client)!: update standard link
interceptors and plugins options (#333)"

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Improved the ordering and handling of request parameters in the client
API.
- Enhanced overall consistency in how communication options are
processed, ensuring smoother API interactions without affecting the
end-user experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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