Commit activity
Last 12 weeks · 1 commit
Community health
3 of 6 standards met
Recent PRs & issues
Closes #37 The in cleared the timer and removed the pending call as soon as returned. A hook that calls without awaiting it (the type allows ) lost the response, and never fired, so the call hung. Now the pending call and its timer are only cleaned up when the response arrives, when the timeout fires, or when throws. The existing cache test (a hook that awaits or calls ) still passes. Tests in : a hook with gets the result, and with no response the call rejects with the timeout error. Both fail (hang) before the fix. Assisted by an AI coding assistant (Claude Code).
Closes #36 If a function throws , , , or , or returns with no reason, the call resolved with . Both sides checked whether the error was truthy. The receiver now tracks the failure with a flag, so it sends an error response and calls for any thrown value. The caller rejects when the response has the key (), not when is truthy. A success response has no key, so nothing changes for it. Tests in throw each falsy value and check that the call rejects with it, and that is called. Both fail before the fix. Assisted by an AI coding assistant (Claude Code).
Describe the bug The type allows a hook that returns . In , the after clears the timer and removes the pending call as soon as the hook returns. If the hook calls without awaiting it, the reply comes back later, finds no pending call and is dropped. The timer is gone too, so never rejects. The caller hangs. Reproduction output , hook . Output on birpc 4.2.0, Node.js 24: Possible fix Clear the timer and the pending entry only when the reply arrives or the timeout fires, not in the after the hook. Or change the type so the hook must return the promise from . I'm happy to send a PR with a failing test and the fix. An AI coding assistant (Claude Code) found this fault, wrote the repro and wrote this text. Reproduction https://github.com/mark1russell7/wirelab/blob/main/repros/birpc/F0187/repro.ts System Info Used Package Manager pnpm Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead. [x] The provided reproduction is a minimal reproducible of the bug. Contributions [x] I am willing to submit a PR to fix this issue [x] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Recent fixes
Please be aware that vibe-coding contributions are 🚫 STRICTLY PROHIBITED. We are humans behind these open source projects, trying hard to maintain good quality and a healthy community. Not only do vibe-coding contributions pollute the code, but they also drain A LOT of unnecessary energy and time from maintainers and toxify the community and collaboration. All vibe-coded, AI-generated PRs will be rejected and closed without further notice. In severe cases, your account might be banned organization-wide and reported to GitHub. PLEASE SHOW SOME RESPECT and do not do so. Before submitting the PR, please make sure you do the following: Read the Contributing Guide. Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate. Provide a description in this PR that addresses what the PR is solving and WHY**, or reference the issue that it solves (e.g. ). Ideally, include relevant tests that fail without this PR but pass with it. [x] Add wrapper functions for window and iframes, and update the README with usage instructions. Linked Issues fixes # Additional context This change will slightly increase the size of the package.
Description Currently, birpc can only handle result of rpc calling once, that make it hard to handle streaming multiple results (e.g. ReadableStream, Async Generator). This pr check if fn result has , if ture, post the result sequencially and consume it on the other side. Linked Issues Additional context
Description This PR resolves a TypeScript issue that occurred when developers called or with only one type parameter. Previously, this would cause a TypeScript error: It is now possible to provide only one type parameter without error. This change does not affect the developer experience (DX) unless typed access to is required. In that scenario, providing both type parameters will still enable full type checking for . Linked Issues https://github.com/antfu-collective/birpc/issues/32 Additional Context This fix resolves the main example in the README.md, which was previously broken:
Repository: made-in-common/birpc. Description: Message-based two-way remote procedure call. Stars: 584, Forks: 33. Primary language: TypeScript. Languages: TypeScript (99.1%), JavaScript (0.9%). License: MIT. Latest release: v4.2.0 (3mo ago). Open PRs: 2, open issues: 4. Last activity: 1d ago. Community health: 50%. Top contributors: antfu, sheremet-va, AriPerkkio, antfubot, webfansplz, knoxnoe, harlan-zw, okxiaoliang4, JackyM06, psyirius and others.