doseofted / prim-rpc

Easy-to-understand, type-safe, transport-agnostic RPC/IPC for JavaScript, supporting callbacks, batching, file handling, custom serialization, and more.
https://prim.doseofted.me
Apache License 2.0
98 stars 1 forks source link

Web Worker Exports Change #25

Closed doseofted closed 1 year ago

doseofted commented 1 year ago

JSON handler is no longer returned for all plugins (it was repetitive and unnecessary). New exports:

import {
  createMethodHandler, createCallbackHandler,
  createMethodPlugin, createCallbackPlugin,
  jsonHandler
} from "@doseofted/prim-rpc-plugins/web-worker"

const methodHandler = createMethodHandler({ ...options })
const callbackHandler = createCallbackHandler({ ...options })
createPrimServer({ methodHandler, callbackHandler, jsonHandler })

const methodPlugin = createMethodPlugin({ ...options })
const callbackPlugin = createCallbackPlugin({ ...options })
const client = createPrimClient({ methodPlugin, callbackPlugin, jsonHandler })
changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 3741aaae7a1fd5c54e0a503607b25254c01c45db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | ------------------------------------- | ----- | | @doseofted/prim-rpc-plugins | Minor | | @doseofted/prim-example-server | Patch | | @doseofted/prim-documentation-website | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
prim-rpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2023 6:44pm