Skip to content

Commit

Permalink
Release/v0.22.0 (#4107)
Browse files Browse the repository at this point in the history
* fix/Avoid package.json import; (#4041)

* Added auto-generated config module `env/data.js` for importing package environment vars without importing the whole `package.json`;
Refactored `http.js` to use `env/data.js` instead of package.json;

* Added `env/data.js`;
Added `env/README.md`;

* Feat/export package version constant (#4065)

* Added auto-generated config module `env/data.js` for importing package environment vars without importing the whole `package.json`;
Refactored `http.js` to use `env/data.js` instead of package.json;

* Added `env/data.js`;
Added `env/README.md`;

* Export package version constant;

* Fixed cancelToken leakage; Added AbortController support; (#3305)

* Fixed cancelToken leakage;
Added AbortController support;

* Fixed typings;

* Documented `signal` option;

* Added processing of early cancellation using AbortController without sending a request;

Co-authored-by: Jay <jasonsaayman@gmail.com>

* Updating CI to run on release branches

* Fixed default transitional config for custom Axios instance; (#4052)

Refactored `/core/mergeConfig`;

Co-authored-by: Jay <jasonsaayman@gmail.com>

* Prepping v0.22.0 for release

* Updated date

Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
  • Loading branch information
jasonsaayman and DigitalBrainJS committed Oct 1, 2021
1 parent 7d6bddb commit 76f09af
Show file tree
Hide file tree
Showing 27 changed files with 621 additions and 363 deletions.
245 changes: 124 additions & 121 deletions .eslintrc.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: ci

on:
push:
branches: [master]
branches: [master, 'release/*']
pull_request:
branches: [master]
branches: [master, 'release/*']

jobs:
build:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

### 0.22.0 (October 01, 2021)

Fixes and Functionality:
- Caseless header comparing in HTTP adapter ([#2880](https://github.com/axios/axios/pull/2880))
- Avoid package.json import fixing issues and warnings related to this ([#4041](https://github.com/axios/axios/pull/4041)), ([#4065](https://github.com/axios/axios/pull/4065))
- Fixed cancelToken leakage and added AbortController support ([#3305](https://github.com/axios/axios/pull/3305))
- Updating CI to run on release branches
- Bump follow redirects version
- Fixed default transitional config for custom Axios instance; ([#4052](https://github.com/axios/axios/pull/4052))

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

- [Jay](mailto:jasonsaayman@gmail.com)
- [Matt R. Wilson](https://github.com/mastermatt)
- [Xianming Zhong](https://github.com/chinesedfan)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)

### 0.21.4 (September 6, 2021)

Fixes and Functionality:
Expand Down
25 changes: 20 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line strict
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);

Expand Down Expand Up @@ -37,6 +38,10 @@ module.exports = function(grunt) {
}
},

package2env: {
all: {}
},

usebanner: {
all: {
options: {
Expand Down Expand Up @@ -70,8 +75,8 @@ module.exports = function(grunt) {
src: ['test/unit/**/*.js']
},
options: {
timeout: 30000,
},
timeout: 30000
}
},

watch: {
Expand All @@ -88,20 +93,30 @@ module.exports = function(grunt) {
webpack: require('./webpack.config.js')
});

grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function () {
grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function() {
var npm = grunt.file.readJSON('package.json');
var bower = grunt.file.readJSON('bower.json');
var fields = this.data.fields || [];

for (var i=0, l=fields.length; i<l; i++) {
for (var i = 0, l = fields.length; i < l; i++) {
var field = fields[i];
bower[field] = npm[field];
}

grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
});

grunt.registerMultiTask('package2env', 'Sync package.json to env.json', function() {
var npm = grunt.file.readJSON('package.json');
grunt.file.write('./lib/env/data.js', [
'module.exports = ',
JSON.stringify({
version: npm.version
}, null, 2),
';'].join(''));
});

grunt.registerTask('test', 'Run the jasmine and mocha tests', ['eslint', 'mochaTest', 'karma:single', 'ts']);
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower', 'package2env']);
};
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ These are the available config options for making requests. Only the `url` is re
cancelToken: new CancelToken(function (cancel) {
}),

// an alternative way to cancel Axios requests using AbortController
signal: new AbortController().signal,

// `decompress` indicates whether or not the response body should be decompressed
// automatically. If set to `true` will also remove the 'content-encoding' header
// from the responses objects of all decompressed responses
Expand Down Expand Up @@ -734,7 +737,20 @@ axios.get('/user/12345', {
cancel();
```

> Note: you can cancel several requests with the same cancel token.
Axios supports AbortController to abort requests in [`fetch API`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#aborting_a_fetch) way:
```js
const controller = new AbortController();

axios.get('/foo/bar', {
signal: controller.signal
}).then(function(response) {
//...
});
// cancel the request
controller.abort()
```

> Note: you can cancel several requests with the same cancel token/abort controller.
> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request.
## Using application/x-www-form-urlencoded format
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "0.21.4",
"version": "0.22.0",
"homepage": "https://axios-http.com",
"authors": [
"Matt Zabriskie"
Expand Down

0 comments on commit 76f09af

Please sign in to comment.