altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

Support for RPC in webview scope #2242

Open aventez opened 7 months ago

aventez commented 7 months ago

Description of the problem

The current solution forces developers to implement their own webview RPC's flow abstraction layer.

Desired solution for the problem

It can be great to extend the RPC feature support communication web<>client|server as well.

webview.emitRpc(name: string, callback: () => any)

Alternatives you considered

The current solution forces developers to implement their own webview RPC's flow abstraction layer

Additional context

image

Yiin commented 7 months ago

RPC route from webview to client/server would be super useful. Route from client/server to webview is not needed, as it's both complicated (multiple webviews in multiple resources) and highly unnecessary (there is no good reason to call webview, or at least I haven't found one).