8000 feat!: add http transport and remove axios by lance · Pull Request #481 · cloudevents/sdk-javascript · GitHub
[go: up one dir, main page]

Skip to content

feat!: add http transport and remove axios #481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 18, 2022

Conversation

lance
Copy link
Member
@lance lance commented Mar 18, 2022

This commit adds a base HTTP emitter that can be used to send events over HTTP without requiring any additional dependencies. It uses the Node.js builtin HTTP module instead of a dependency on axios/got/whatever. I have also eliminated the axiosEmitter in the desire to eliminate the axios dependency. I've done this as a single commit, so it can be reverted if folks prefer to keep it.

Also, before landing this, I would like to add HTTPS support. Done

lance added 2 commits March 18, 2022 12:39
Adds a builtin HTTP event emitter that can be used with `emitterFor()`
to send events over HTTP without pulling in any additional dependencies.

Signed-off-by: Lance Ball <lball@redhat.com>
In the past we chose to keep this in our code base by considering axios a
peer dependency - users were required to include it in their projects
explicitly. In working on the HTTP emitter, it became more and more
apparent that the axios emitter was probably no longer needed, and in fact
I doubt it was really used at all. To use it, users would have been required
to do this, since it isn't exported at the top level.

const { axiosEmitter } = require("cloudevents/transport/http");

Based on this, I think the usage in the wild is probably very minimal,
and I like the idea of eliminating this dependency.

Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance requested a review from a team March 18, 2022 16:48
lance added 4 commits March 18, 2022 12:52
Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance merged commit 0362a4f into cloudevents:main Mar 18, 2022
@lance lance deleted the lance/add-base-http-transport branch March 18, 2022 17:36
@github-actions github-actions bot mentioned this pull request Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0