Skip to content

v1.0.0-beta.4

Compare
Choose a tag to compare
@github-actions github-actions released this 25 Mar 15:01
· 40 commits to main since this release

🚨 Breaking Changes 🚨

Event Iterator Keep Alive

We move configs for Event Iterator Keep Alive from .handle to handler options (define when creating handler)

Rename internal APIs

  • HandlerPlugin -> StandardHandlerPlugin
  • ClientOptions -> FriendlyClientOptions
  • ClientOptionsOut -> ClientOptions
  • ClientPlugin -> StandardLinkPlugin
  • StandardHandleOptions -> FriendlyStandardHandleOptions

πŸš€ Features πŸš€

Body Limit Plugin

The Body Limit Plugin restricts the size of the request body.

const handler = new RPCHandler(router, {
  plugins: [
    new BodyLimitPlugin({
      maxBodySize: 1024 * 1024, // 1MB
    }),
  ],
})

No need manually check prefix

export async function fetch(request: Request): Promise<Response> {
-  const url = new URL(request.url)
-
-  if (url.pathname.startsWith('/rpc')) {
    const { response } = await handler.handle(request, {
      prefix: '/rpc',
      context: {} // Provide initial context if needed
    })

    if (response)
      return response
-  }

  return new Response('Not found', { status: 404 })
}

No significant changes

Β Β Β Β View changes on GitHub