-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Axios ES2017 #4787
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
Axios ES2017 #4787
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…osHeaders � Conflicts: � lib/core/dispatchRequest.js
Refactored accessor building routine; Refactored default transforms; Removed `normalizeHeaderName` helper;
Added missed `has` accessor to TS types;
Added progress capturing ability for node.js environment; Added `maxRate` option to limit the data rate in node.js environment; Refactored event handled by `onUploadProgress` && `onDownloadProgress` listeners in browser environment; Added progress & data rate tests for the http adapter; Added response stream aborting test; Added a manual progress capture test for the browser; Updated TS types; Added TS tests; Refactored request abort logic for the http adapter; Added ability to abort the response stream;
� Conflicts: � lib/core/transformData.js � lib/defaults/index.js � lib/helpers/parseHeaders.js � lib/utils.js
Fixed CancelError emitting in streams;
…mption; Added throwing an error if the request stream was silently destroying (without error) Refers to axios#3966;
…request; Fixed tests;
Replaced grunt with gulp; Improved dev scripts; Added Babel for rollup build;
462ed4c to
b114f1f
Compare
Member
|
@DigitalBrainJS please can you send me an email with your email address I would like to add you to our slack channel, this pr and another one in the works would make a lot of sense to pull together as one larger refactor. Thanks 😄 |
Added automatic contributors list generator for package.json;
thebanjomatic
added a commit
to thebanjomatic/axios
that referenced
this pull request
Jun 29, 2023
When axios#4787 was implemented, the project was switched to `"type": "module"` and "./index.js" became an esm file instead of commonjs, however, the "main" entry in package.json still points to "index.js". As a result, consumers using this field may get unexpected behavior since the main field is supposed to be commonjs if the entry is provided. Many consumers won't run into this as a practical problem (for example when just doing `const axios = require('axios').default` from inside of a cjs file in node) because the "exports" map takes precedence over the main/module fields, but tools that don't parse the object map when resolving still run into problems here. The fix for this is to just point the "main" entry-point to the commonjs artifacts located at "./dist/node/index.cjs".
thebanjomatic
added a commit
to thebanjomatic/axios
that referenced
this pull request
Oct 5, 2023
When axios#4787 was implemented, the project was switched to `"type": "module"` and "./index.js" became an esm file instead of commonjs, however, the "main" entry in package.json still points to "index.js". As a result, consumers using this field may get unexpected behavior since the main field is supposed to be commonjs if the entry is provided. Many consumers won't run into this as a practical problem (for example when just doing `const axios = require('axios').default` from inside of a cjs file in node) because the "exports" map takes precedence over the main/module fields, but tools that don't parse the object map when resolving still run into problems here. The fix for this is to just point the "main" entry-point to the commonjs artifacts located at "./dist/node/index.cjs".
thebanjomatic
added a commit
to thebanjomatic/axios
that referenced
this pull request
Oct 5, 2023
When axios#4787 was implemented, the project was switched to `"type": "module"` and "./index.js" became an esm file instead of commonjs, however, the "main" entry in package.json still points to "index.js". As a result, consumers using this field may get unexpected behavior since the main field is supposed to be commonjs if the entry is provided. Many consumers won't run into this as a practical problem (for example when just doing `const axios = require('axios').default` from inside of a cjs file in node) because the "exports" map takes precedence over the main/module fields, but tools that don't parse the object map when resolving still run into problems here. The fix for this is to just point the "main" entry-point to the commonjs artifacts located at "./dist/node/index.cjs". I also added a module entrypoint to improve compatability for the cases where the export map is not used (webpack 4 for example) since that would likely be reading the cjs "main" entrypoint now that main has switched back to cjs.
ckng0221
added a commit
to ckng0221/axios
that referenced
this pull request
Nov 11, 2023
As grunt devDependencies were already remove in axios#4787, change the grunt related CLI run, including `grunt build` and `grunt test` to `npm run test` and `npm run build`. Refs: axios#4787
ebeigarts
added a commit
to ebeigarts/axios
that referenced
this pull request
Oct 13, 2025
…d and maxRedirects is set to 0
The axios request is left in an unsettled state (waits forever) when using compression
and maxRedirects is set to 0 and the request gets aborted after some chunks are sent.
The problem is that the response `abort` event is not being emitted and the request state
inside the `responseStream.on('error')` callback is `destroyed: true, aborted: false`.
I see that previoysly axios was checking `req.aborted` instead of `req.destroyed` inside
the `responseStream.on('error')` callback, but since node deprecated the `req.aborted`, it was
changed to `req.destroyed` in axios#4787.
We could change that back to `req.aborted`, but I think checking `rejected` would be
a better option, so we can be sure that we are catching all the errors
(in case there are some more weird cases).
This was referenced Oct 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #4772