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

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffan committed Mar 3, 2018
2 parents 9a056da + ecd13de commit 9a34f88
Show file tree
Hide file tree
Showing 13 changed files with 1,135 additions and 271 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

defaults: &defaults
docker:
- image: circleci/node:8-browsers
- image: circleci/node:9-browsers
environment:
CHROME_BIN: /usr/bin/google-chrome
working_directory: ~/vue-resource
Expand All @@ -28,7 +28,7 @@ jobs:
name: Run Tests
command: |
yarn test
karma start test/karma.conf.js --single-run --browsers Chrome
karma start test/karma.conf.js --single-run --browsers Chrome,Firefox
- run:
name: Build Release
command: yarn run build
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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)
# 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)

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.

Expand All @@ -18,9 +18,9 @@ $ npm install vue-resource
```

### CDN
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).
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).
```html
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.4.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.0"></script>
```

## Example
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": "vue-resource",
"main": "dist/vue-resource.js",
"version": "1.4.0",
"version": "1.5.0",
"description": "The HTTP client for Vue.js",
"homepage": "https://github.com/pagekit/vue-resource",
"license": "MIT",
Expand Down
32 changes: 21 additions & 11 deletions dist/vue-resource.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.4.0
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1037,14 +1037,6 @@ function xhrClient (request) {

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

if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}

xhr.open(request.method, request.getUrl(), true);

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

// deprecated use downloadProgress
if (isFunction(request.progress) && request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
}

if (isFunction(request.downloadProgress)) {
xhr.addEventListener('progress', request.downloadProgress);
}

// deprecated use uploadProgress
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}

if (isFunction(request.uploadProgress) && xhr.upload) {
xhr.upload.addEventListener('progress', request.uploadProgress);
}

request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -1165,11 +1175,11 @@ function Client (context) {
return Client;
}

function sendRequest(request, resolve) {
function sendRequest(request) {

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

resolve(client(request));
return client(request);
}

/**
Expand Down
32 changes: 21 additions & 11 deletions dist/vue-resource.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.4.0
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1035,14 +1035,6 @@ function xhrClient (request) {

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

if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}

xhr.open(request.method, request.getUrl(), true);

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

// deprecated use downloadProgress
if (isFunction(request.progress) && request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
}

if (isFunction(request.downloadProgress)) {
xhr.addEventListener('progress', request.downloadProgress);
}

// deprecated use uploadProgress
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}

if (isFunction(request.uploadProgress) && xhr.upload) {
xhr.upload.addEventListener('progress', request.uploadProgress);
}

request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -1163,11 +1173,11 @@ function Client (context) {
return Client;
}

function sendRequest(request, resolve) {
function sendRequest(request) {

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

resolve(client(request));
return client(request);
}

/**
Expand Down
32 changes: 21 additions & 11 deletions dist/vue-resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.4.0
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1041,14 +1041,6 @@ function xhrClient (request) {

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

if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}

xhr.open(request.method, request.getUrl(), true);

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

// deprecated use downloadProgress
if (isFunction(request.progress) && request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
}

if (isFunction(request.downloadProgress)) {
xhr.addEventListener('progress', request.downloadProgress);
}

// deprecated use uploadProgress
if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}

if (isFunction(request.uploadProgress) && xhr.upload) {
xhr.upload.addEventListener('progress', request.uploadProgress);
}

request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -1169,11 +1179,11 @@ function Client (context) {
return Client;
}

function sendRequest(request, resolve) {
function sendRequest(request) {

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

resolve(client(request));
return client(request);
}

/**
Expand Down
Loading

0 comments on commit 9a34f88

Please sign in to comment.