Skip to content

Commit

Permalink
Merge branch 'master' into isAxiosError-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Aug 20, 2018
2 parents 033f60e + c0b4065 commit 59f67b2
Show file tree
Hide file tree
Showing 40 changed files with 1,609 additions and 1,110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,3 +7,4 @@ typings/
coverage/
test/typescript/axios.js*
sauce_connect.log
package-lock.json
74 changes: 71 additions & 3 deletions CHANGELOG.md
@@ -1,16 +1,84 @@
# Changelog

### 0.19.0-beta.1 (Aug 9, 2018)

**NOTE:** This is a beta version of this release. There may be functionality that is broken in
certain browsers, though we suspect that builds are hanging and not erroring. See
https://saucelabs.com/u/axios for the most up-to-date information.

New Functionality:

- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712))
- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693))
- Add toJSON to decorated Axios errors to faciliate serialization ([#1625](https://github.com/axios/axios/issues/1625))
- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623))
- Typings: allow custom return types
- Add option to specify character set in responses (with http adapter)

Fixes:

- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385))
- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475))
- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698))
- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959))
- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622))
- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285))
- Fixing defaults to use httpAdapter if available
- Use a safer, cross-platform method to detect the Node environment
- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537))
- [Typescript] Fix missing type parameters on delete/head methods
- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript
- Fix missing type parameters on delete/head
- Fix Default method for an instance always overwritten by get
- Fix type error when socketPath option in AxiosRequestConfig
- Capture errors on request data streams
- Decorate resolve and reject to clear timeout in all cases

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

- Andrew Scott <ascott18@gmail.com>
- Anthony Gauthier <antho325@hotmail.com>
- arpit <arpit2438735@gmail.com>
- ascott18
- Benedikt Rötsch <axe312ger@users.noreply.github.com>
- Chance Dickson <me@chancedickson.com>
- Dave Stewart <info@davestewart.co.uk>
- Deric Cain <deric.cain@gmail.com>
- Guillaume Briday <guillaumebriday@gmail.com>
- Jacob Wejendorp <jacob@wejendorp.dk>
- Jim Lynch <mrdotjim@gmail.com>
- johntron
- Justin Beckwith <beckwith@google.com>
- Justin Beckwith <justin.beckwith@gmail.com>
- Khaled Garbaya <khaledgarbaya@gmail.com>
- Lim Jing Rong <jjingrong@users.noreply.github.com>
- Mark van den Broek <mvdnbrk@gmail.com>
- Martti Laine <martti@codeclown.net>
- mattridley
- mattridley <matt.r@joinblink.com>
- Nicolas Del Valle <nicolas.delvalle@gmail.com>
- Nilegfx
- pbarbiero
- Rikki Gibson <rikkigibson@gmail.com>
- Sako Hartounian <sakohartounian@yahoo.com>
- Shane Fitzpatrick <fitzpasd@gmail.com>
- Stephan Schneider <stephanschndr@gmail.com>
- Steven <steven@ceriously.com>
- Tim Garthwaite <tim.garthwaite@jibo.com>
- Tim Johns <timjohns@yahoo.com>
- Yutaro Miyazaki <yutaro@studio-rubbish.com>

### 0.18.0 (Feb 19, 2018)

- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070))
- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)):
- AxiosRequestConfig.proxy: allows type false
- AxiosProxyConfig: added auth field
- AxiosRequestConfig.proxy: allows type false
- AxiosProxyConfig: added auth field
- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254))
- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287))
- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342))


### 0.17.1 (Nov 11, 2017)

- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160))
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -25,7 +25,7 @@ Please update the docs accordingly so that there are no discrepencies between th

### Developing

- `grunt test` run the jasmine and nodeunit tests
- `grunt test` run the jasmine and mocha tests
- `grunt build` run webpack and bundle the source
- `grunt version` prepare the code for release
- `grunt watch:test` watch for changes and run `test`
Expand Down
45 changes: 22 additions & 23 deletions COOKBOOK.md
Expand Up @@ -11,12 +11,12 @@ $ npm install axios promise --save
```

```js
var axios = require('axios');
const axios = require('axios');
require('promise/polyfill-done');

axios
.get('http://www.example.com/user')
.then(function (response) {
.then((response) => {
console.log(response.data);
return response;
})
Expand All @@ -30,16 +30,16 @@ $ npm install axios promise.prototype.finally --save
```

```js
var axios = require('axios');
const axios = require('axios');
require('promise.prototype.finally').shim();

axios
.get('http://www.example.com/user')
.then(function (response) {
.then((response) => {
console.log(response.data);
return response;
})
.finally(function () {
.finally(() => {
console.log('this will always be called');
});
```
Expand All @@ -52,19 +52,19 @@ $ npm install axios pako --save

```js
// client.js
var axios = require('axios');
var pako = require('pako');
const axios = require('axios');
const pako = require('pako');

var user = {
const user = {
firstName: 'Fred',
lastName: 'Flintstone'
};

var data = pako.deflate(JSON.stringify(user), { to: 'string' });
const data = pako.deflate(JSON.stringify(user), { to: 'string' });

axios
.post('http://127.0.0.1:3333/user', data)
.then(function (response) {
.then((response) => {
response.data = JSON.parse(pako.inflate(response.data, { to: 'string' }));
console.log(response.data);
return response;
Expand All @@ -73,25 +73,24 @@ axios

```js
// server.js
var pako = require('pako');
var http = require('http');
var url = require('url');
var server;
const pako = require('pako');
const http = require('http');
const url = require('url');

server = http.createServer(function (req, res) {
const server = http.createServer((req, res) => {
req.setEncoding('utf8');

var parsed = url.parse(req.url, true);
var pathname = parsed.pathname;
const parsed = url.parse(req.url, true);
const pathname = parsed.pathname;

if (pathname === '/user') {
var data = '';
req.on('data', function (chunk) {
let data = '';
req.on('data', (chunk) => {
data += chunk;
});

req.on('end', function () {
var user = JSON.parse(pako.inflate(data, { to: 'string' }));
req.on('end', () => {
const user = JSON.parse(pako.inflate(data, { to: 'string' }));
console.log(user);

res.writeHead(200, {
Expand All @@ -115,9 +114,9 @@ $ npm install jsonp --save
```

```js
var jsonp = require('jsonp');
const jsonp = require('jsonp');

jsonp('http://www.example.com/foo', null, function (err, data) {
jsonp('http://www.example.com/foo', null, (err, data) => {
if (err) {
console.error(err.message);
} else {
Expand Down
2 changes: 2 additions & 0 deletions ECOSYSTEM.md
Expand Up @@ -18,3 +18,5 @@ This is a list of axios related libraries and resources. If you have a suggestio
* [axios-extensions](https://github.com/kuitos/axios-extensions) - A collection of axios extensions, including throttle and cache GET request plugin.
* [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests.
* [axios-fetch](https://github.com/lifeomic/axios-fetch) - A WebAPI Fetch implementation backed by an Axios client
* [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value.
* [axios-actions](https://github.com/davestewart/axios-actions) - Bundle endpoints as callable, reusable services
11 changes: 8 additions & 3 deletions Gruntfile.js
Expand Up @@ -65,8 +65,13 @@ module.exports = function(grunt) {
}
},

nodeunit: {
all: ['test/unit/**/*.js']
mochaTest: {
test: {
src: ['test/unit/**/*.js']
},
options: {
timeout: 30000,
},
},

watch: {
Expand Down Expand Up @@ -96,7 +101,7 @@ module.exports = function(grunt) {
grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
});

grunt.registerTask('test', 'Run the jasmine and nodeunit tests', ['eslint', 'nodeunit', 'karma:single', 'ts']);
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']);
};

0 comments on commit 59f67b2

Please sign in to comment.