async-call-rpc icon indicating copy to clipboard operation
async-call-rpc copied to clipboard

Next major version

Open Jack-Works opened this issue 3 years ago • 0 comments

This will be a breaking change, but you don't have to upgrade. The current version is stable enough.

I learned from the mistakes in the current design, it's time to consider what the next step is.

Architecture changes

  • [x] (internal) Rewrite the build architecture of this repository.
  • [x] Support Node package exports
  • [ ] Be able to tree shake unused contents (? may not, this library is small enough)
  • [ ] A documentation website. Mention common practice (including integration with Zod).

API changes

  • [ ] Should be able to create the client and the server separately.
  • [ ] Still allows creating isomorphic client & server.
const client = createClient({ ... })
const { client, server } = create({ ... })
  • [x] Should be able to stop the instance by an AbortSignal
  • [x] Rename seralization/deseralization to encode/decode
  • [x] batch should have multiple queue
  • [ ] Remove CallbackBasedChannel (this is the biggest mistake in the current design).
  • [ ] Call context, the function be called can receive an extra object. By this? Or an extra wrapper?
    • Progress report
    • AbortSignal from remote/local
    • custom object provided by the channel
    • Bind to the request
    • Logger!
  • [ ] Logger
    • Get the raw message (send/receive)
    • Get the decoded message (send/receive)
    • Get call context
    • Get the replay function
    • Get progress report
    • Get cancellation
    • Get result
    • Get metrics of encode/decode, execution
  • [ ] Handle JSON RPC internal methods better
  • [ ] Rewrite common channels and encoder-decoders
  • [ ] AsyncGeneratorCall should be able to create based on the existing AsyncCall instance (or explicitly list generator names/functions?)

Jack-Works avatar Mar 12 '22 14:03 Jack-Works