-
Notifications
You must be signed in to change notification settings - Fork 300
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
Durable Object RPC stub (name interceptor) #1311
Conversation
98fbb3d
to
ac94f6b
Compare
200cb2a
to
01ba722
Compare
ac94f6b
to
63e79db
Compare
a884a43
to
b8e3cf9
Compare
63e79db
to
970dbe8
Compare
5115f50
to
a9c0fd5
Compare
ba7c284
to
e8bf535
Compare
e859098
to
d3eee51
Compare
Ah, almost forgot we want to prevent calling certain registered names (like |
e8bf535
to
a3d7ead
Compare
6cd20c9
to
1715a12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impl seems reasonable, most of my comments are around structuring this PR to land incrementally!
a0a489b
to
afa9230
Compare
src/workerd/api/actor.h
Outdated
return kj::none; | ||
} | ||
|
||
// WARNING: Adding a new method to the Durable Object stub can conflict with RPC method names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning applies to adding methods to Fetcher
too, right? Since it is inherited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it will apply to any type that uses JSG_NAMED_INTERCEPT
. But as mentioned in the other comment, we can tweak how this works by changing the flags we use to register the intercept callbacks. The current choice was made in an attempt to make it possible for existing jsg objects to continue to use the other macros easily (JSG_METHOD, JSG_*_PROPERTY, etc) while also supporting interception. But we have the freedom to change how the intercept works right now.
5a24d78
to
9b3c93b
Compare
f804960
to
2e76dbf
Compare
Looks like you'll need approval from @cloudflare/wrangler as well fyi |
Is there a way to replace this group? I wouldn't expect them to review this and I seem to be unable to remove the review request. |
Looks like Wrangler's review request came from |
2e76dbf
to
54b85d2
Compare
This is the client-side work that modifies DO client stubs, enabling them to intercept dynamic method names (those which are not defined on the C++ class). The server-side PR will fill in the RPC branch of getNamed(), this commit just provides an interface and ensures "legacy" DO stub usage isn't broken.
54b85d2
to
244f921
Compare
https://github.com/cloudflare/workerd/compare/54b85d24528f9013d34a864f241c8e771fd8358d..244f9216b7c892d4227312e5cd42abb9956b3a0e is a rebase. I also dropped an |
This is the client-side work that modifies DO client stubs, enabling them to intercept dynamic method names (those which are not defined on the C++ class).
The server-side PR will fill in the RPC branch of getNamed(), this commit just provides an interface and ensures "legacy" DO stub usage isn't broken.
This is currently pointing to the
jsg-named-intercept
branch so the diff isn't annoying to look at. My plan is to rebase #1028 on this branch and delete most of the client side (actor.h/c++
) stuff from that PR. Really, the only client side changes in that PR should be moving the body ofgetRpcAndCallRemote()
intogetNamed()
.I'll be adding an internal test to confirm we can call
stub.foo()
if the compat flag is present, and perhaps more importantly, we can't without it (current stub behavior retained by default).