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
#1395 breaks custom config #1718
Comments
To be honest, I'm not convinced this is a good idea. Arbitrary user data shouldn't be root level keys to a library from my design perspective. Even though TypeScript might not be a "blocker" in a traditional sense to a JS project: e.g. Usually I'd recommend abstracting user data into your own class that extends Axios - though I can see how people currently using Axios might rely on this, so my recommendation for an easy upgrade path would be exactly one root key whose value is an object of shape Implementation in current code base would be trivia - just copy over that key as well. WDYT @rikuayanokozy? |
@zcei |
I agree we should list it as a breaking change. I'm not sure whether it makes sense to first deprecate it, but still support it. Would be quite easy though, I guess. We can assign the lists with known keys to variables and then get all the keys from the two configs. What is the reason to type this |
Unless there's opposition, I'm okay with noting this as a breaking change and keeping the current functionality in the 0.19 beta |
Although the change makes sense I still agree with @rikuayanokozy here. I would like to have a |
I made a PR that allows a |
I am looking forward to this feature😀 |
This is still an issue and I've create a PR that fixes it without requiring a new feature #2006 |
Faced this as well, custom config parameters for interceptors is very important. Any work around? Or is downgrade the only option? |
TypeScript isn't a blocker at all. In order to support custom config properties, Axios doesn't need to change its type definitions anyhow. Modules are easily augmented in TS. E.g. if you want to use a custom property in your project, just do this:
That's it. |
What if I'm not using typescript? Looks like there are PRs, but no changes here yet. Any news? |
Closing, #2207 is merged and will be released as part of 0.19.1 |
Summary
#1395 launched a fix that instance config may override global config, but it ignore custom configs.
So it will break something we'd like to attach into the config and access in interceptor (e.g. CookieJar).
For example (https://codepen.io/anon/pen/gjZRdR?editors=1111):
Context
The text was updated successfully, but these errors were encountered: