tools icon indicating copy to clipboard operation
tools copied to clipboard

refactor(js-api): remove the JSON-RPC backend and unimplemented methods

Open leops opened this issue 3 years ago • 1 comments

Summary

This PR aims at improving the usability of the @rometools/js-api package by cleaning up some unfinished features.

I removed the JSON-RPC backend as it's unlikely to be useful in the short term while we don't have a long running development server (since this only leaves the WASM backend, the concept of backend has instead been replaced with "distributions" to let the user choose which of the bundler, nodejs or web versions of @rometools/wasm they want to load).

I also removed the formatFiles and parseContent methods since those were not implemented at the moment. On the other hand I added new lintContent and printDiagnostics methods since those were mostly straightforward to implement and could provide additional value to the JS API. Finally I've added a shutdown method to manually free the WASM Workspace instance, as well as an experimental use of the FinalizationRegistry to automatically free some Workspace instances that are no longer reachable.

Test Plan

I've updated the existing tests for the JS API to remove the daemon-specific tests and cover the new methods.

leops avatar Nov 23 '22 10:11 leops

Deploy Preview for docs-rometools canceled.

Name Link
Latest commit 621ef668be82ddff249c78c44d0f88a6e579a3a5
Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/637fa26f80f4fe0008f4ac68

netlify[bot] avatar Nov 23 '22 10:11 netlify[bot]