feat: transport that does not depend on global fetch
See original GitHub issueDescribe the feature you’d like to request
I’d like to see a transport layer that is pluggable and allows for other implementations to exist and does not assume the existence of fetch in the global (or window) scope.
Describe the solution you’d like to see
A well-defined interface for the transport layer that can be easily swapped out for other implementations.
Desribe alternate solutions
Global patching, described here: https://github.com/trpc/trpc/discussions/1982
Additional information
Related: https://github.com/trpc/trpc/discussions/1982
Node 18 announcement: https://nodejs.org/de/blog/announcements/v18-release-announce/#new-globally-available-browser-compatible-apis
👨👧👦 Contributing
- 🙋♂️ Yes, I’d be down to file a PR implementing this feature!
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
fetch() performance parity · Issue #1203 · nodejs/undici - GitHub
I wrote up a tiny DoH load-tester with python and golang (don't ask) which I intend to publish as a github action by...
Read more >Simple fetch mock using Typescript and Jest - Stack Overflow
You can tell TypeScript that you're defining global.fetch as a Jest mock. global.fetch = jest.fn(() => Promise.resolve({ json: ...
Read more >How To Mock Fetch in Jest | Leigh Halliday
In our case we can do this, and that is because fetch is available globally. So instead we will override the global.
Read more >New Node.js features, Node latest version report | TSH.io
Node 18 features an experimental global fetch API, which enables the same methods without having to rely on external packages.
Read more >Voice Extensible Markup Language (VoiceXML) Version 2.0
In this document, the key words "must", "must not", "required", "shall", "shall not", "should", "should not", "recommended", "may", and " ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We should probably do this tbh:
And
Hi @moltar - this is already possible, I think you are describing the purpose of
adapters(router-side) andlinks(client-side). Please seetrpc-chromeas an example for web extensions where the message passing transport layer is:chrome.runtime.connect(...).