Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 9a34f88

Browse files
author
Steffan
committed
Merge branch 'release/1.5.0'
2 parents 9a056da + ecd13de commit 9a34f88

13 files changed

+1135
-271
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22

33
defaults: &defaults
44
docker:
5-
- image: circleci/node:8-browsers
5+
- image: circleci/node:9-browsers
66
environment:
77
CHROME_BIN: /usr/bin/google-chrome
88
working_directory: ~/vue-resource
@@ -28,7 +28,7 @@ jobs:
2828
name: Run Tests
2929
command: |
3030
yarn test
31-
karma start test/karma.conf.js --single-run --browsers Chrome
31+
karma start test/karma.conf.js --single-run --browsers Chrome,Firefox
3232
- run:
3333
name: Build Release
3434
command: yarn run build

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vue-resource [![Build](https://img.shields.io/circleci/project/pagekit/vue-resource/develop.svg)](https://circleci.com/gh/pagekit/vue-resource) [![Downloads](https://img.shields.io/npm/dm/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![Version](https://img.shields.io/npm/v/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![License](https://img.shields.io/npm/l/vue-resource.svg)](https://www.npmjs.com/package/vue-resource)
1+
# vue-resource [![Build](https://img.shields.io/circleci/project/pagekit/vue-resource/develop.svg)](https://circleci.com/gh/pagekit/vue-resource) [![Downloads](https://img.shields.io/npm/dm/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/vue-resource/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vue-resource) [![Version](https://img.shields.io/npm/v/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![License](https://img.shields.io/npm/l/vue-resource.svg)](https://www.npmjs.com/package/vue-resource)
22

33
The plugin for [Vue.js](http://vuejs.org) provides services for making web requests and handle responses using a [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) or JSONP.
44

@@ -18,9 +18,9 @@ $ npm install vue-resource
1818
```
1919

2020
### CDN
21-
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.4.0), [unpkg](https://unpkg.com/vue-resource@1.4.0) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
21+
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.5.0), [unpkg](https://unpkg.com/vue-resource@1.5.0) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
2222
```html
23-
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.4.0"></script>
23+
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.0"></script>
2424
```
2525

2626
## Example

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-resource",
33
"main": "dist/vue-resource.js",
4-
"version": "1.4.0",
4+
"version": "1.5.0",
55
"description": "The HTTP client for Vue.js",
66
"homepage": "https://github.com/pagekit/vue-resource",
77
"license": "MIT",

dist/vue-resource.common.js

+21-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-resource v1.4.0
2+
* vue-resource v1.5.0
33
* https://github.com/pagekit/vue-resource
44
* Released under the MIT License.
55
*/
@@ -1037,14 +1037,6 @@ function xhrClient (request) {
10371037

10381038
request.abort = function () { return xhr.abort(); };
10391039

1040-
if (request.progress) {
1041-
if (request.method === 'GET') {
1042-
xhr.addEventListener('progress', request.progress);
1043-
} else if (/^(POST|PUT)$/i.test(request.method)) {
1044-
xhr.upload.addEventListener('progress', request.progress);
1045-
}
1046-
}
1047-
10481040
xhr.open(request.method, request.getUrl(), true);
10491041

10501042
if (request.timeout) {
@@ -1063,6 +1055,24 @@ function xhrClient (request) {
10631055
request.headers.set('X-Requested-With', 'XMLHttpRequest');
10641056
}
10651057

1058+
// deprecated use downloadProgress
1059+
if (isFunction(request.progress) && request.method === 'GET') {
1060+
xhr.addEventListener('progress', request.progress);
1061+
}
1062+
1063+
if (isFunction(request.downloadProgress)) {
1064+
xhr.addEventListener('progress', request.downloadProgress);
1065+
}
1066+
1067+
// deprecated use uploadProgress
1068+
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
1069+
xhr.upload.addEventListener('progress', request.progress);
1070+
}
1071+
1072+
if (isFunction(request.uploadProgress) && xhr.upload) {
1073+
xhr.upload.addEventListener('progress', request.uploadProgress);
1074+
}
1075+
10661076
request.headers.forEach(function (value, name) {
10671077
xhr.setRequestHeader(name, value);
10681078
});
@@ -1165,11 +1175,11 @@ function Client (context) {
11651175
return Client;
11661176
}
11671177

1168-
function sendRequest(request, resolve) {
1178+
function sendRequest(request) {
11691179

11701180
var client = request.client || (inBrowser ? xhrClient : nodeClient);
11711181

1172-
resolve(client(request));
1182+
return client(request);
11731183
}
11741184

11751185
/**

dist/vue-resource.esm.js

+21-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-resource v1.4.0
2+
* vue-resource v1.5.0
33
* https://github.com/pagekit/vue-resource
44
* Released under the MIT License.
55
*/
@@ -1035,14 +1035,6 @@ function xhrClient (request) {
10351035

10361036
request.abort = function () { return xhr.abort(); };
10371037

1038-
if (request.progress) {
1039-
if (request.method === 'GET') {
1040-
xhr.addEventListener('progress', request.progress);
1041-
} else if (/^(POST|PUT)$/i.test(request.method)) {
1042-
xhr.upload.addEventListener('progress', request.progress);
1043-
}
1044-
}
1045-
10461038
xhr.open(request.method, request.getUrl(), true);
10471039

10481040
if (request.timeout) {
@@ -1061,6 +1053,24 @@ function xhrClient (request) {
10611053
request.headers.set('X-Requested-With', 'XMLHttpRequest');
10621054
}
10631055

1056+
// deprecated use downloadProgress
1057+
if (isFunction(request.progress) && request.method === 'GET') {
1058+
xhr.addEventListener('progress', request.progress);
1059+
}
1060+
1061+
if (isFunction(request.downloadProgress)) {
1062+
xhr.addEventListener('progress', request.downloadProgress);
1063+
}
1064+
1065+
// deprecated use uploadProgress
1066+
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
1067+
xhr.upload.addEventListener('progress', request.progress);
1068+
}
1069+
1070+
if (isFunction(request.uploadProgress) && xhr.upload) {
1071+
xhr.upload.addEventListener('progress', request.uploadProgress);
1072+
}
1073+
10641074
request.headers.forEach(function (value, name) {
10651075
xhr.setRequestHeader(name, value);
10661076
});
@@ -1163,11 +1173,11 @@ function Client (context) {
11631173
return Client;
11641174
}
11651175

1166-
function sendRequest(request, resolve) {
1176+
function sendRequest(request) {
11671177

11681178
var client = request.client || (inBrowser ? xhrClient : nodeClient);
11691179

1170-
resolve(client(request));
1180+
return client(request);
11711181
}
11721182

11731183
/**

dist/vue-resource.js

+21-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-resource v1.4.0
2+
* vue-resource v1.5.0
33
* https://github.com/pagekit/vue-resource
44
* Released under the MIT License.
55
*/
@@ -1041,14 +1041,6 @@ function xhrClient (request) {
10411041

10421042
request.abort = function () { return xhr.abort(); };
10431043

1044-
if (request.progress) {
1045-
if (request.method === 'GET') {
1046-
xhr.addEventListener('progress', request.progress);
1047-
} else if (/^(POST|PUT)$/i.test(request.method)) {
1048-
xhr.upload.addEventListener('progress', request.progress);
1049-
}
1050-
}
1051-
10521044
xhr.open(request.method, request.getUrl(), true);
10531045

10541046
if (request.timeout) {
@@ -1067,6 +1059,24 @@ function xhrClient (request) {
10671059
request.headers.set('X-Requested-With', 'XMLHttpRequest');
10681060
}
10691061

1062+
// deprecated use downloadProgress
1063+
if (isFunction(request.progress) && request.method === 'GET') {
1064+
xhr.addEventListener('progress', request.progress);
1065+
}
1066+
1067+
if (isFunction(request.downloadProgress)) {
1068+
xhr.addEventListener('progress', request.downloadProgress);
1069+
}
1070+
1071+
// deprecated use uploadProgress
1072+
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
1073+
xhr.upload.addEventListener('progress', request.progress);
1074+
}
1075+
1076+
if (isFunction(request.uploadProgress) && xhr.upload) {
1077+
xhr.upload.addEventListener('progress', request.uploadProgress);
1078+
}
1079+
10701080
request.headers.forEach(function (value, name) {
10711081
xhr.setRequestHeader(name, value);
10721082
});
@@ -1169,11 +1179,11 @@ function Client (context) {
11691179
return Client;
11701180
}
11711181

1172-
function sendRequest(request, resolve) {
1182+
function sendRequest(request) {
11731183

11741184
var client = request.client || (inBrowser ? xhrClient : nodeClient);
11751185

1176-
resolve(client(request));
1186+
return client(request);
11771187
}
11781188

11791189
/**

0 commit comments

Comments
 (0)