From ca4b27dd7c6a01daa9bf580a54f1e0a2ac608321 Mon Sep 17 00:00:00 2001 From: hedii Date: Fri, 1 Jul 2016 12:02:22 +0200 Subject: [PATCH 1/3] change cancel to abort --- src/http/interceptor/timeout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/interceptor/timeout.js b/src/http/interceptor/timeout.js index a67ec570..3a75da71 100644 --- a/src/http/interceptor/timeout.js +++ b/src/http/interceptor/timeout.js @@ -8,7 +8,7 @@ export default function (request, next) { if (request.timeout) { timeout = setTimeout(() => { - request.cancel(); + request.abort(); }, request.timeout); } From 7d57dbd614a8626f4532b1d633e28e00c6b0810c Mon Sep 17 00:00:00 2001 From: Steffan Date: Fri, 1 Jul 2016 16:34:51 +0200 Subject: [PATCH 2/3] update scripts --- build/build.js | 3 +-- build/release.js | 20 ++++++++++++++++++++ package.json | 4 +++- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 build/release.js diff --git a/build/build.js b/build/build.js index 247feb56..71e21a93 100644 --- a/build/build.js +++ b/build/build.js @@ -3,10 +3,9 @@ var rollup = require('rollup'); var uglify = require('uglify-js'); var babel = require('rollup-plugin-babel'); var package = require('../package.json'); -var version = process.env.VERSION || package.version; var banner = "/*!\n" + - " * vue-resource v" + version + "\n" + + " * vue-resource v" + package.version + "\n" + " * https://github.com/vuejs/vue-resource\n" + " * Released under the MIT License.\n" + " */\n"; diff --git a/build/release.js b/build/release.js new file mode 100644 index 00000000..88c4ff6e --- /dev/null +++ b/build/release.js @@ -0,0 +1,20 @@ +var replace = require('replace-in-file'); +var version = process.argv[2]; + +replace({ + files: "bower.json", + replace: /("version"\s*:\s*")\d+\.\d+\.\d+("\s*,)/g, + with: "$1" + version + "$2" +}); + +replace({ + files: "package.json", + replace: /("version"\s*:\s*")\d+\.\d+\.\d+("\s*,)/g, + with: "$1" + version + "$2" +}); + +replace({ + files: "README.md", + replace: /(\/|@)\d+\.\d+\.\d+/g, + with: "$1" + version +}); diff --git a/package.json b/package.json index 24249e8e..513c79e9 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "main": "dist/vue-resource.common.js", "jsnext:main": "dist/vue-resource.es2015.js", "scripts": { + "test": "webpack --config test/webpack.config.js", "build": "node build/build.js", - "test": "webpack --config test/webpack.config.js" + "release": "node build/release.js" }, "repository": { "type": "git", @@ -31,6 +32,7 @@ "babel-preset-es2015-loose-rollup": "^7.0.0", "babel-runtime": "^6.9.2", "jasmine-core": "^2.3.4", + "replace-in-file": "^1.1.1", "rollup": "^0.33.0", "rollup-plugin-babel": "^2.6.1", "uglify-js": "^2.6.4", From 525939c86b3a2682581c54c592c234519299e9d0 Mon Sep 17 00:00:00 2001 From: Steffan Date: Fri, 1 Jul 2016 17:53:25 +0200 Subject: [PATCH 3/3] v0.9.3 --- README.md | 4 ++-- bower.json | 2 +- dist/vue-resource.common.js | 4 ++-- dist/vue-resource.es2015.js | 4 ++-- dist/vue-resource.js | 4 ++-- dist/vue-resource.min.js | 4 ++-- package.json | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 90e711e0..700916bc 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ $ bower install vue-resource ``` ### CDN -Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/0.9.2/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [npmcdn](https://npmcdn.com/vue-resource@0.9.2/dist/vue-resource.min.js). +Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/0.9.3/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [npmcdn](https://npmcdn.com/vue-resource@0.9.3/dist/vue-resource.min.js). ```html - + ``` ## Documentation diff --git a/bower.json b/bower.json index c189373b..cd073e2c 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,7 @@ "name": "vue-resource", "main": "dist/vue-resource.js", "description": "A web request service for Vue.js", - "version": "0.9.2", + "version": "0.9.3", "homepage": "https://github.com/vuejs/vue-resource", "license": "MIT", "ignore": [ diff --git a/dist/vue-resource.common.js b/dist/vue-resource.common.js index a120e190..51e4d79e 100644 --- a/dist/vue-resource.common.js +++ b/dist/vue-resource.common.js @@ -1,5 +1,5 @@ /*! - * vue-resource v0.9.2 + * vue-resource v0.9.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ @@ -913,7 +913,7 @@ function timeout (request, next) { if (request.timeout) { timeout = setTimeout(function () { - request.cancel(); + request.abort(); }, request.timeout); } diff --git a/dist/vue-resource.es2015.js b/dist/vue-resource.es2015.js index 3f9f70bb..bfc12498 100644 --- a/dist/vue-resource.es2015.js +++ b/dist/vue-resource.es2015.js @@ -1,5 +1,5 @@ /*! - * vue-resource v0.9.2 + * vue-resource v0.9.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ @@ -911,7 +911,7 @@ function timeout (request, next) { if (request.timeout) { timeout = setTimeout(function () { - request.cancel(); + request.abort(); }, request.timeout); } diff --git a/dist/vue-resource.js b/dist/vue-resource.js index 3d9c8ebd..d7981dbe 100644 --- a/dist/vue-resource.js +++ b/dist/vue-resource.js @@ -1,5 +1,5 @@ /*! - * vue-resource v0.9.2 + * vue-resource v0.9.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ @@ -917,7 +917,7 @@ if (request.timeout) { timeout = setTimeout(function () { - request.cancel(); + request.abort(); }, request.timeout); } diff --git a/dist/vue-resource.min.js b/dist/vue-resource.min.js index 96e29f63..6bff73a2 100644 --- a/dist/vue-resource.min.js +++ b/dist/vue-resource.min.js @@ -1,7 +1,7 @@ /*! - * vue-resource v0.9.2 + * vue-resource v0.9.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.VueResource=n()}(this,function(){"use strict";function t(t){this.state=Z,this.value=void 0,this.deferred=[];var n=this;try{t(function(t){n.resolve(t)},function(t){n.reject(t)})}catch(e){n.reject(e)}}function n(t,n){t instanceof nt?this.promise=t:this.promise=new nt(t.bind(n)),this.context=n}function e(t){rt=t.util,ot=t.config.debug||!t.config.silent}function o(t){"undefined"!=typeof console&&ot&&console.warn("[VueResource warn]: "+t)}function r(t){"undefined"!=typeof console&&console.error(t)}function i(t,n){return rt.nextTick(t,n)}function u(t){return t.replace(/^\s*|\s*$/g,"")}function s(t){return"string"==typeof t}function c(t){return t===!0||t===!1}function a(t){return"function"==typeof t}function f(t){return null!==t&&"object"==typeof t}function h(t){return f(t)&&Object.getPrototypeOf(t)==Object.prototype}function p(t){return"undefined"!=typeof FormData&&t instanceof FormData}function l(t,e,o){var r=n.resolve(t);return arguments.length<2?r:r.then(e,o)}function d(t,n,e){return e=e||{},a(e)&&(e=e.call(n)),v(t.bind({$vm:n,$options:e}),t,{$options:e})}function m(t,n){var e,o;if("number"==typeof t.length)for(e=0;e=200&&i<300}return t.prototype.text=function(){return this.body},t.prototype.blob=function(){return new Blob([this.body])},t.prototype.json=function(){return JSON.parse(this.body)},t}(),dt=function(){function t(n){pt(this,t),this.method="GET",this.body=null,this.params={},this.headers={},st(this,n)}return t.prototype.getUrl=function(){return R(this)},t.prototype.getBody=function(){return this.body},t.prototype.respondWith=function(t,n){return new lt(t,st(n||{},{url:this.getUrl()}))},t}(),mt={"X-Requested-With":"XMLHttpRequest"},vt={Accept:"application/json, text/plain, */*"},yt={"Content-Type":"application/json;charset=utf-8"};return V.options={},V.headers={put:yt,post:yt,patch:yt,"delete":yt,custom:mt,common:vt},V.interceptors=[D,X,J,L,N,M,H],["get","delete","head","jsonp"].forEach(function(t){V[t]=function(n,e){return this(st(e||{},{url:n,method:t}))}}),["post","put","patch"].forEach(function(t){V[t]=function(n,e,o){return this(st(o||{},{url:n,method:t,body:e}))}}),_.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},"delete":{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(K),K}); \ No newline at end of file +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.VueResource=n()}(this,function(){"use strict";function t(t){this.state=Z,this.value=void 0,this.deferred=[];var n=this;try{t(function(t){n.resolve(t)},function(t){n.reject(t)})}catch(e){n.reject(e)}}function n(t,n){t instanceof nt?this.promise=t:this.promise=new nt(t.bind(n)),this.context=n}function e(t){rt=t.util,ot=t.config.debug||!t.config.silent}function o(t){"undefined"!=typeof console&&ot&&console.warn("[VueResource warn]: "+t)}function r(t){"undefined"!=typeof console&&console.error(t)}function i(t,n){return rt.nextTick(t,n)}function u(t){return t.replace(/^\s*|\s*$/g,"")}function s(t){return"string"==typeof t}function c(t){return t===!0||t===!1}function a(t){return"function"==typeof t}function f(t){return null!==t&&"object"==typeof t}function h(t){return f(t)&&Object.getPrototypeOf(t)==Object.prototype}function p(t){return"undefined"!=typeof FormData&&t instanceof FormData}function l(t,e,o){var r=n.resolve(t);return arguments.length<2?r:r.then(e,o)}function d(t,n,e){return e=e||{},a(e)&&(e=e.call(n)),v(t.bind({$vm:n,$options:e}),t,{$options:e})}function m(t,n){var e,o;if("number"==typeof t.length)for(e=0;e=200&&i<300}return t.prototype.text=function(){return this.body},t.prototype.blob=function(){return new Blob([this.body])},t.prototype.json=function(){return JSON.parse(this.body)},t}(),dt=function(){function t(n){pt(this,t),this.method="GET",this.body=null,this.params={},this.headers={},st(this,n)}return t.prototype.getUrl=function(){return R(this)},t.prototype.getBody=function(){return this.body},t.prototype.respondWith=function(t,n){return new lt(t,st(n||{},{url:this.getUrl()}))},t}(),mt={"X-Requested-With":"XMLHttpRequest"},vt={Accept:"application/json, text/plain, */*"},yt={"Content-Type":"application/json;charset=utf-8"};return V.options={},V.headers={put:yt,post:yt,patch:yt,"delete":yt,custom:mt,common:vt},V.interceptors=[D,X,J,L,N,M,H],["get","delete","head","jsonp"].forEach(function(t){V[t]=function(n,e){return this(st(e||{},{url:n,method:t}))}}),["post","put","patch"].forEach(function(t){V[t]=function(n,e,o){return this(st(o||{},{url:n,method:t,body:e}))}}),_.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},"delete":{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(K),K}); \ No newline at end of file diff --git a/package.json b/package.json index 513c79e9..6f71c44a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-resource", - "version": "0.9.2", + "version": "0.9.3", "description": "A web request service for Vue.js", "main": "dist/vue-resource.common.js", "jsnext:main": "dist/vue-resource.es2015.js",