Repository navigation
feat!: use Fetch API for HTTP transport - #657
kahirokunn wants to merge 8 commits into
Conversation
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
da558bb to
1298a74
Compare
|
Firstly, thanks for taking the initiative for this big change! We need to bring this SDK to modern times, and I very much appreciate the effort. Continue to work with me, so we can balance improvements against taking too much dependency/inflating the API surface. The change fixes #534, the typed errors and migration guide is clear. The test coverage is strong. 1. Size of the API change 2. Do we need all the overrides?
Instead of header per-send shouldn't be header per message? On this rule, the following could go:
@duglin I'd like your feedback here on how far we want to change the API, and allow overridability. By opening it too much, we become a generic http library vs a cloudevent specific one. |
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
691927c to
446b6f0
Compare
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
446b6f0 to
77c8f40
Compare
@shiva Thank you for the review! I've reduced the new exports from 13 to 5 and removed the per-message responseHandler and transport-level signal. |
Fixes: #534
Proposed Changes
Use the Fetch API for the built-in HTTP transport.
Description
This removes the Node-only HTTP imports that cause browser bundling failures.
httpTransport()returns the native FetchResponseand the handled body. Non-2xx responses, aborts and network failures reject withHTTPTransportError. The transport also accepts Fetch options, response handlers and abort signals.See
API_TRANSITION_GUIDE.mdfor the breaking changes and migration examples.