Skip to content

chore: fix axios dependency - #405

Closed
lance wants to merge 1 commit into
cloudevents:mainfrom
lance:lance/fix-deps
Closed

lance wants to merge 1 commit into
cloudevents:mainfrom
lance:lance/fix-deps

Conversation

@lance

@lance lance commented Apr 20, 2021

Copy link
Copy Markdown
Member

Somehow axios had been completely removed from the dependencies in package.json. I guess our tests still worked because @types/axios must have a dependency on axios, and by the transitive power of npm dependencies it was there. But we actually have axios in the package itself. So, users who want to use the axios emitter that we ship will have to know to also install axios without this change.

Signed-off-by: Lance Ball lball@redhat.com

Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance added the chore/dependencies Pull requests that update a dependency file label Apr 20, 2021
@lance
lance requested a review from a team April 20, 2021 15:17
@lance lance self-assigned this Apr 20, 2021
@lholmquist

Copy link
Copy Markdown
Contributor

I didn't realize we still had an axios emitter. I thought we were trying to move away from including any specific protocol libraries.

@lance

lance commented Apr 20, 2021

Copy link
Copy Markdown
Member Author

I didn't realize we still had an axios emitter.

import { Message, Options } from "../..";
import axios from "axios";
export function axiosEmitter(sink: string) {
return function (message: Message, options?: Options): Promise<unknown> {
options = { ...options };
const headers = {
...message.headers,
...(options.headers as Record<string, string>),
};
delete options.headers;
return axios.post(sink, message.body, {
headers: headers,
...options,
});
};
}

I thought we were trying to move away from including any specific protocol libraries.

Yes we are. But we forgot to actually remove it for 4.0.

The BEFORE functionality still exists until the release of 4.x at which time it will be removed.

#342

I mean, I guess we could leave it as-is and consider it "removed" - though it is still accessible, and could work fine as long as the user declares the axios dependency themselves.

@lance

lance commented Apr 20, 2021

Copy link
Copy Markdown
Member Author

Closing this for now. We can revisit later if we need to.

@lance lance closed this Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore/dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants