Content-Length: 628195 | pFad | https://snyk.io/redirect/github/axios/axios/commit/76f09afc03fbcf392d31ce88448246bcd4f91f8c

A50E Release/v0.22.0 (#4107) · axios/axios@76f09af · GitHub
Skip to content

Commit 76f09af

Browse files
Release/v0.22.0 (#4107)
* 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>
1 parent 7d6bddb commit 76f09af

27 files changed

+621
-363
lines changed

.eslintrc.js

Lines changed: 124 additions & 121 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ci
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [master, 'release/*']
66
pull_request:
7-
branches: [master]
7+
branches: [master, 'release/*']
88

99
jobs:
1010
build:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
### 0.22.0 (October 01, 2021)
4+
5+
Fixes and Functionality:
6+
- Caseless header comparing in HTTP adapter ([#2880](https://github.com/axios/axios/pull/2880))
7+
- 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))
8+
- Fixed cancelToken leakage and added AbortController support ([#3305](https://github.com/axios/axios/pull/3305))
9+
- Updating CI to run on release branches
10+
- Bump follow redirects version
11+
- Fixed default transitional config for custom Axios instance; ([#4052](https://github.com/axios/axios/pull/4052))
12+
13+
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
14+
15+
- [Jay](mailto:jasonsaayman@gmail.com)
16+
- [Matt R. Wilson](https://github.com/mastermatt)
17+
- [Xianming Zhong](https://github.com/chinesedfan)
18+
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
19+
320
### 0.21.4 (September 6, 2021)
421

522
Fixes and Functionality:

Gruntfile.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line strict
12
module.exports = function(grunt) {
23
require('load-grunt-tasks')(grunt);
34

@@ -37,6 +38,10 @@ module.exports = function(grunt) {
3738
}
3839
},
3940

41+
package2env: {
42+
all: {}
43+
},
44+
4045
usebanner: {
4146
all: {
4247
options: {
@@ -70,8 +75,8 @@ module.exports = function(grunt) {
7075
src: ['test/unit/**/*.js']
7176
},
7277
options: {
73-
timeout: 30000,
74-
},
78+
timeout: 30000
79+
}
7580
},
7681

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

91-
grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function () {
96+
grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function() {
9297
var npm = grunt.file.readJSON('package.json');
9398
var bower = grunt.file.readJSON('bower.json');
9499
var fields = this.data.fields || [];
95100

96-
for (var i=0, l=fields.length; i<l; i++) {
101+
for (var i = 0, l = fields.length; i < l; i++) {
97102
var field = fields[i];
98103
bower[field] = npm[field];
99104
}
100105

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

109+
grunt.registerMultiTask('package2env', 'Sync package.json to env.json', function() {
110+
var npm = grunt.file.readJSON('package.json');
111+
grunt.file.write('./lib/env/data.js', [
112+
'module.exports = ',
113+
JSON.stringify({
114+
version: npm.version
115+
}, null, 2),
116+
';'].join(''));
117+
});
118+
104119
grunt.registerTask('test', 'Run the jasmine and mocha tests', ['eslint', 'mochaTest', 'karma:single', 'ts']);
105120
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
106-
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
121+
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower', 'package2env']);
107122
};

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ These are the available config options for making requests. Only the `url` is re
452452
cancelToken: new CancelToken(function (cancel) {
453453
}),
454454

455+
// an alternative way to cancel Axios requests using AbortController
456+
signal: new AbortController().signal,
457+
455458
// `decompress` indicates whether or not the response body should be decompressed
456459
// automatically. If set to `true` will also remove the 'content-encoding' header
457460
// from the responses objects of all decompressed responses
@@ -734,7 +737,20 @@ axios.get('/user/12345', {
734737
cancel();
735738
```
736739

737-
> Note: you can cancel several requests with the same cancel token.
740+
Axios supports AbortController to abort requests in [`fetch API`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#aborting_a_fetch) way:
741+
```js
742+
const controller = new AbortController();
743+
744+
axios.get('/foo/bar', {
745+
signal: controller.signal
746+
}).then(function(response) {
747+
//...
748+
});
749+
// cancel the request
750+
controller.abort()
751+
```
752+
753+
> Note: you can cancel several requests with the same cancel token/abort controller.
738754
> 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.
739755
740756
## Using application/x-www-form-urlencoded format

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "axios",
33
"main": "./dist/axios.js",
4-
"version": "0.21.4",
4+
"version": "0.22.0",
55
"homepage": "https://axios-http.com",
66
"authors": [
77
"Matt Zabriskie"

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://snyk.io/redirect/github/axios/axios/commit/76f09afc03fbcf392d31ce88448246bcd4f91f8c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy