This repository was archived by the owner on Dec 27, 2025. It is now read-only.
BREAKING: Convert getter methods to properties for cleaner API#65
Merged
lambdalisue merged 1 commit intomainfrom Dec 23, 2025
Merged
BREAKING: Convert getter methods to properties for cleaner API#65lambdalisue merged 1 commit intomainfrom
lambdalisue merged 1 commit intomainfrom
Conversation
…ent-connectrpc): convert getter methods to properties Response body accessor methods are now properties for cleaner API: - HTTP: text(), json(), arrayBuffer(), blob() → getter properties - HTTP: raw() → readonly property - GraphQL: data(), raw() → readonly properties - ConnectRPC: data(), raw() → readonly properties The json property returns 'unknown' instead of generic T, requiring explicit type assertions where needed. This change eliminates unnecessary function call syntax while preserving the same lazy evaluation behavior. Migration: - response.json<User>() → response.json as User | null - response.text() → response.text - response.data<T>() → response.data as T | null - All other accessors: remove () parentheses
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
lambdalisue
added a commit
to probitas-test/probitas-test.github.io
that referenced
this pull request
Dec 23, 2025
Updated code examples to reflect the breaking change in probitas-client where response body accessors changed from methods to properties. Changed accessor calls: - res.json() → res.json (HTTP client) - res.data() → res.data (gRPC/GraphQL clients) This aligns with probitas-client PR #65 which converted getter methods to properties for cleaner API. The json property now returns 'unknown' requiring explicit type assertions where needed. Ref: probitas-test/probitas-client#65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
text(),json(),arrayBuffer(),blob(),raw()) from methods to propertiesdata(),raw()) from methods to propertiesdata(),raw()) from methods to propertiesjsonproperty to returnunknowninstead of generic typeWhy
The method syntax
response.json()was unnecessary for simple accessors that just return cached values. Converting to properties (response.json) provides:arr.lengthnotarr.length())jsonproperty returningunknownforces explicit type assertions, improving type safetyThis is a breaking change but improves the developer experience and code readability across all client packages.
Migration Guide
Test Plan
deno task check)deno task verifypasses (format, lint, type-check, tests)