-
Notifications
You must be signed in to change notification settings - Fork 257
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
Simplify "named intercept" #1585
Commits on Jan 29, 2024
-
Drive-by Cleanup: Rename serilaizedArgs -> args.
The fact that they are serialized is implied by the type, `JsValue`, which always contains a serialized value.
Configuration menu - View commit details
-
Copy full SHA for 31fb73a - Browse repository at this point
Copy the full SHA 31fb73aView commit details -
Drive-by Cleanup: Remove misleading kj::mv.
`setV8Serialized()` is a capnp data setter. It will always make a copy, it does not take ownership. Also add a comment about avoiding the redundant copy in the future.
Configuration menu - View commit details
-
Copy full SHA for 3b1a813 - Browse repository at this point
Copy the full SHA 3b1a813View commit details -
Delete: Remove ability to enumerate named intercept keys.
This functionality is not used by JS RPC as we have no way to know in advance what methods actually exist at the remote end. Moreover, methods of a class are normally not expected to be enumerable anyway, so even if it could know what methods exist, it'd still be returning an empty list here. Since JS RPC is the only anticipated use case for named intercept at this time, I'd rather remove this unused functionality for now, to simplify further refactoring. We can bring it back in the future if a use case is found.
Configuration menu - View commit details
-
Copy full SHA for eabe13c - Browse repository at this point
Copy the full SHA eabe13cView commit details -
Cleanup: Remove NamedIntercept class.
There's no longer any need to inherit this. JSG_NAMED_INTERCEPT works fine without it, since it always invokes `getNamed()` directly on the particular subclass via templates.
Configuration menu - View commit details
-
Copy full SHA for f3020e0 - Browse repository at this point
Copy the full SHA f3020e0View commit details -
Refactor: Allow JSG_NAMED_INTERCEPT to specify the method name.
This makes the identifier `getNamed` no longer magic. Instead, the caller specifies whatever name they want.
Configuration menu - View commit details
-
Copy full SHA for d689db2 - Browse repository at this point
Copy the full SHA d689db2View commit details -
Refactor: Allow named intercept method to return any type.
The type is wrapped just like the return value of any function would be.
Configuration menu - View commit details
-
Copy full SHA for e93bcfc - Browse repository at this point
Copy the full SHA e93bcfcView commit details -
Cleanup: Use liftKj in NamedInterceptorCallbacks.
The named intercept callback is essentially the same as what `GetterCallback` handles, except with a name passed in. Aside from handling the name, there's no reason this code should be different from `GetterCallback`.
Configuration menu - View commit details
-
Copy full SHA for a5bff51 - Browse repository at this point
Copy the full SHA a5bff51View commit details -
Cleanup: Simplify
WorkerRpc::getRpcMethod()
using new named interce……pt functionality.
Configuration menu - View commit details
-
Copy full SHA for 7bc97fe - Browse repository at this point
Copy the full SHA 7bc97feView commit details -
Rename: "Named intercept" -> "wildcard property"
I think this is a much more intuitive name.
Configuration menu - View commit details
-
Copy full SHA for 3d8789d - Browse repository at this point
Copy the full SHA 3d8789dView commit details