feat(ts): emit protobuf-es client as standalone tree-shakeable functions - #242
Merged
Conversation
Each RPC as top-level export async function instead of class method. Shared client.ts module with RequestOptions interface. Service-specific RequestOptions extends base when typed headers are declared. const vs let optimization for non-mutated path variables. Docs bug fix: apiKey header snippet was sending literal "apiKey" key instead of "X-API-Key". Original work from PR #211 by @hishamank. Co-Authored-By: Hicham <53556927+hishamank@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #242 +/- ##
==========================================
+ Coverage 28.64% 28.76% +0.11%
==========================================
Files 74 75 +1
Lines 13048 13146 +98
==========================================
+ Hits 3738 3781 +43
- Misses 9119 9166 +47
- Partials 191 199 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔍 CI Pipeline Status✅ Lint: success 📊 Coverage Report: Available in checks above |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This is @hishamank's work from #211, rebased cleanly onto main after the stacked PRs (#207, #210) were squash-merged.
All code authored by @hishamank — original PR: #211. Previously approved by @SebastienMelki.
Changes
export async functioninstead of class method (tree-shakeable)client.tsmodule withRequestOptionsinterfaceRequestOptionsextends base when typed headers are declaredrecv()method centralizesthis.vs local variable accessconstvsletoptimization for non-mutated path variables (hand-rolled goldens)apiKeyheader snippet was sending literalapiKeykey instead ofX-API-KeybaseURLreuse pattern documentedTest plan
go test ./internal/tsclientgen/... ./internal/tscommon/...all pass🤖 Generated with Claude Code