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

Avoid calling bind on instances of RpcProperty #140

Merged
merged 1 commit into from
May 28, 2024

Conversation

JacobMarshallPP
Copy link
Contributor

Fixes #139.

This PR inspects the unwrapped value, and if it's constructor is of RpcProperty, it handles binding by returning a different function that calls the RPC property as if it was bound.

I checked, and this sort of introspection is not unlike what Cloudflare do in their own Miniflare project:

https://github.com/cloudflare/workers-sdk/blob/d0754780c6d9a12984f1e4ed9b4f0952ba6b0888/packages/miniflare/src/workers/core/proxy.worker.ts#L223

Copy link
Collaborator

@jahands jahands left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@jahands jahands merged commit 1b9b1c8 into evanderkoogh:main May 28, 2024
1 check 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.

Bug: Calling a Service Binding RPC method throws a DOMException
2 participants