flarelabs-net / vite-plugin-cloudflare

0 stars 0 forks source link

Support RPC in service bindings #4

Closed jamesopstad closed 2 days ago

jamesopstad commented 2 days ago

resolves #1, resolves #2

This PR adds support for RPC via service bindings and workers defined as classes. It does this by using a class that extends WorkerEntrypoint as the wrapping worker that contains the module runner. The class constructor returns a Proxy that wraps the class and intercepts any method calls. These are then forwarded to the user code.

jamesopstad commented 2 days ago

Going to merge this for now and add a separate issue for supporting getters.