Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next major version #43

Open
5 of 15 tasks
Jack-Works opened this issue Mar 12, 2022 · 0 comments
Open
5 of 15 tasks

Next major version #43

Jack-Works opened this issue Mar 12, 2022 · 0 comments

Comments

@Jack-Works
Copy link
Owner

Jack-Works commented Mar 12, 2022

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

  • (internal) Rewrite the build architecture of this repository.
  • 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({ ... })
  • Should be able to stop the instance by an AbortSignal
  • Rename seralization/deseralization to encode/decode
  • 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?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant