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 ES2017 #4787

Merged
merged 22 commits into from Jun 18, 2022
Merged

Axios ES2017 #4787

merged 22 commits into from Jun 18, 2022

Conversation

DigitalBrainJS
Copy link
Collaborator

@DigitalBrainJS DigitalBrainJS commented Jun 14, 2022

Depends on #4772

  • Refactored sources, Mocha tests, Karma tests to use ES2017 & ESM;
  • Refactored tests structure;
  • Refactored dev scripts;
  • Grunt replaced with Gulp;
  • Webpack replaced with Rollup (for Karma tests);
  • A batch of minor refactorings of the dev environment;

…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
…mption;

Added throwing an error if the request stream was silently destroying (without error) Refers to axios#3966;
Replaced grunt with gulp;
Improved dev scripts;
Added Babel for rollup build;
@jasonsaayman
Copy link
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 😄

@jasonsaayman jasonsaayman merged commit bdf493c into axios:v1.x Jun 18, 2022
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
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.

None yet

3 participants