Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(httptransport): injected fetcher #330

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

maurerbot
Copy link
Contributor

@maurerbot maurerbot commented Dec 16, 2022

Adds the ability to inject a customer fetcher

Purpose:

To. be able to inject binded fetchers in cloudflare workers

new HTTPTransport('/jsonrpc', { fetcher: env.Address.fetch } )

https://developers.cloudflare.com/workers/platform/bindings/about-service-bindings/

@openrpc/generator will need a version bump for this dep and change the template to accept options: https://github.com/open-rpc/generator/blob/40f6a9c7f0b264f6498b32bb4648e3b246e3c093/src/components/client.ts#L50

@maurerbot
Copy link
Contributor Author

prettier applied most changes.

Copy link
Member

@zcstarr zcstarr left a comment

Choose a reason for hiding this comment

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

This is great, looks good to me. The only thing missing here is just a test in HttpTransport.test.js to add a mock injected fetcher and verify it gets called. Then we're golden good to land this. Thanks for the PR. and just ping me when the test case is in

@maurerbot
Copy link
Contributor Author

This is great, looks good to me. The only thing missing here is just a test in HttpTransport.test.js to add a mock injected fetcher and verify it gets called. Then we're golden good to land this. Thanks for the PR. and just ping me when the test case is in

@zcstarr All done 💪

image

@maurerbot
Copy link
Contributor Author

maurerbot commented Dec 17, 2022

Let me know when tagged/published and I will make the upgrade to the generator

Copy link
Member

@zcstarr zcstarr left a comment

Choose a reason for hiding this comment

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

Let's go 🚢

@maurerbot
Copy link
Contributor Author

who can merge?

@zcstarr
Copy link
Member

zcstarr commented Dec 21, 2022

@BelfordZ hey ping here we need a permissions reset here, CI has expired

@BelfordZ BelfordZ mentioned this pull request Jan 4, 2023
@BelfordZ BelfordZ closed this Jan 4, 2023
@BelfordZ BelfordZ reopened this Jan 4, 2023
@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Base: 99.26% // Head: 99.27% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (a4f15d8) compared to base (99d89cc).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #330      +/-   ##
==========================================
+ Coverage   99.26%   99.27%   +0.01%     
==========================================
  Files          11       11              
  Lines         410      416       +6     
  Branches       62       65       +3     
==========================================
+ Hits          407      413       +6     
  Misses          3        3              
Impacted Files Coverage Δ
src/transports/HTTPTransport.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@BelfordZ
Copy link
Member

BelfordZ commented Jan 4, 2023

Thanks for the PR, good stuff!

@BelfordZ BelfordZ merged commit 84c96c5 into open-rpc:master Jan 4, 2023
@BelfordZ
Copy link
Member

BelfordZ commented Jan 4, 2023

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@BelfordZ
Copy link
Member

BelfordZ commented Jan 4, 2023

@maurerbot sry for the delay in responding and thanks again for the contrib! Feel free to make open-rpc projects your own, and contribute whereever you'd like!

@maurerbot
Copy link
Contributor Author

@maurerbot sry for the delay in responding and thanks again for the contrib! Feel free to make open-rpc projects your own, and contribute whereever you'd like!

No problemo. Just want to relink this related PR: open-rpc/generator#700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants