deltachat-core-rust
deltachat-core-rust copied to clipboard
Package deltachat-rpc-server to npm
Currently there are 3 ways to use JSON-RPC bindings from JavaScript:
- Use legacy node bindings https://github.com/deltachat/deltachat-core-rust/tree/4a0585404a0a5f2e3edb4257a69d63efeb199ef3/node with CFFI calls to submit JSON-RPC requests and receive responses. This is what Delta Chat desktop is currently doing.
- Experimental napi-jsonrpc at https://github.com/deltachat/napi-jsonrpc/, currently not maintained and archived, stuck at v1.115.0, unlikely to be supported in the future.
- Spawn a
deltachat-rpc-server
process and useStdioTransport
to communicate with it without any binary API.
Eventually we would like to deprecate first approach and switch to the third approach. The disadvantage of using the stdio approach currently is that the core distributed in the form of deltachat-rpc-server
cannot be automatically installed as a dependency with npm install
.
To close this issue we need to package deltachat-rpc-server to npm, so a single package can be installed that provide an API to spawn bundled deltachat-rpc-server
for the host architecture and provide a JSON-RPC client that can be used.
This issue is split out of more general #4524.
cc @ralphtheninja @Simon-Laux
do we have a deltachat-rpc-client
equivalent for JavaScript? IIRC the bindings are generated automatically for javascript and that is what DC desktop uses? something similar to deltachat-rpc-server but not over standard IO but web socket or so?
no desktop uses it over deltachat-node, then uses the bindings. the bindings don't care how you run or communicate with core, you just implement an interface for doing so and then you're ready to use the bindings: https://www.npmjs.com/package/@deltachat/jsonrpc-client