Skip to content
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

axios in dependencies and peerDependencies #154

Open
parkerault opened this issue Jul 2, 2021 · 5 comments
Open

axios in dependencies and peerDependencies #154

parkerault opened this issue Jul 2, 2021 · 5 comments

Comments

@parkerault
Copy link

I believe it should be one or the other, right? It generates a warning on npm install.

@dearsaturn
Copy link

I don't think it belongs in peerDependencies. That seems like a mistake.

@erhathaway
Copy link
Contributor

erhathaway commented Jul 7, 2021

@parkerault @dearsaturn

I think it was a mistake to be in dependencies. It would make more sense to be in devDependencies and peerDependencies. In dev, the playground uses it in the AxiosClient. In production, you can optionally use it, if you want to use the AxiosClient to submit requests.

These are the original docs I wrote on the peerDeps https://github.com/social-native/elastic-composer#peer-dependencies

@parkerault
Copy link
Author

If I were the king of the universe I would put it in peerDependencies and log an error if AxiosESClient is imported and it's not available. There's also optionalDependencies but it gets installed by default because npm always does the opposite of what you would expect. :)

@erhathaway
Copy link
Contributor

@parkerault

There's also optionalDependencies but it gets installed by default because npm always does the opposite of what you would expect. :)

I did not know about this! Very cool!

I just checked out the docs, there is also peerDependenciesMeta (https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependenciesmeta). This could be used to clean up the terminal output.

What are your thoughts about this situation? Leave as peer or try to clean up or something else?

@erhathaway
Copy link
Contributor

@parkerault I'm not fully awake. Just reread what you wrote. I like the idea of logging an error if missing. I think that plus peerDependenciesMeta + devDependencies would be a good approach.

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

No branches or pull requests

3 participants