diff --git a/bower.json b/bower.json index 2a195b10..0c9b31c5 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.7.2", + "version": "0.7.3", "homepage": "https://github.com/vuejs/vue-resource", "license": "MIT", "ignore": [ diff --git a/build/webpack.build.config.js b/build/webpack.build.config.js index 6d718f29..65608530 100644 --- a/build/webpack.build.config.js +++ b/build/webpack.build.config.js @@ -19,7 +19,7 @@ module.exports = [ }, module: { loaders: [ - {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015-without-strict']}} + {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015']}} ] }, plugins: [ @@ -37,7 +37,7 @@ module.exports = [ }, module: { loaders: [ - {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015-without-strict']}} + {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015']}} ] }, plugins: [ @@ -55,7 +55,7 @@ module.exports = [ }, module: { loaders: [ - {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015-without-strict']}} + {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015']}} ] }, plugins: [ diff --git a/dist/vue-resource.common.js b/dist/vue-resource.common.js index 8f77595b..577db0af 100644 --- a/dist/vue-resource.common.js +++ b/dist/vue-resource.common.js @@ -1,5 +1,5 @@ /** - * vue-resource v0.7.2 + * vue-resource v0.7.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ @@ -51,6 +51,8 @@ module.exports = /* 0 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Install plugin. */ @@ -115,6 +117,8 @@ module.exports = /* 1 */ /***/ function(module, exports) { + 'use strict'; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /** @@ -246,6 +250,8 @@ module.exports = /* 2 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Service for URL templating. */ @@ -380,6 +386,8 @@ module.exports = /* 3 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * URL Template (RFC 6570) Transform. */ @@ -402,6 +410,8 @@ module.exports = /* 4 */ /***/ function(module, exports) { + 'use strict'; + /** * URL Template v2.0.6 (https://github.com/bramstein/url-template) */ @@ -560,6 +570,8 @@ module.exports = /* 5 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Legacy Transform. */ @@ -604,6 +616,8 @@ module.exports = /* 6 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Query Parameter Transform. */ @@ -635,6 +649,8 @@ module.exports = /* 7 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Root Prefix Transform. */ @@ -656,6 +672,8 @@ module.exports = /* 8 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Service for sending network requests. */ @@ -667,19 +685,19 @@ module.exports = var jsonType = { 'Content-Type': 'application/json' }; function Http(url, options) { - var _this = this; - var client = Client, + var self = this || {}, + client = Client, request, promise; Http.interceptors.forEach(function (handler) { - client = interceptor(handler, _this.$vm)(client); + client = interceptor(handler, self.$vm)(client); }); options = _.isObject(url) ? url : _.extend({ url: url }, options); - request = _.merge({}, Http.options, this.$options, options); - promise = client(request).bind(this.$vm).then(function (response) { + request = _.merge({}, Http.options, self.$options, options); + promise = client(request).bind(self.$vm).then(function (response) { return response.ok ? response : Promise.reject(response); }, function (response) { @@ -753,6 +771,8 @@ module.exports = /* 9 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Base client. */ @@ -822,6 +842,8 @@ module.exports = /* 10 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Promise adapter. */ @@ -935,6 +957,8 @@ module.exports = /* 11 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /** @@ -1121,6 +1145,8 @@ module.exports = /* 12 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * XMLHttp client. */ @@ -1178,6 +1204,8 @@ module.exports = /* 13 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Interceptor factory. */ @@ -1228,6 +1256,8 @@ module.exports = /* 14 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Before Interceptor. */ @@ -1251,6 +1281,8 @@ module.exports = /* 15 */ /***/ function(module, exports) { + "use strict"; + /** * Timeout Interceptor. */ @@ -1286,6 +1318,8 @@ module.exports = /* 16 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * JSONP Interceptor. */ @@ -1309,6 +1343,8 @@ module.exports = /* 17 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * JSONP client. */ @@ -1365,6 +1401,8 @@ module.exports = /* 18 */ /***/ function(module, exports) { + 'use strict'; + /** * HTTP method override Interceptor. */ @@ -1387,6 +1425,8 @@ module.exports = /* 19 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Mime Interceptor. */ @@ -1428,6 +1468,8 @@ module.exports = /* 20 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Header Interceptor. */ @@ -1455,6 +1497,8 @@ module.exports = /* 21 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * CORS Interceptor. */ @@ -1497,6 +1541,8 @@ module.exports = /* 22 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * XDomain client (Internet Explorer). */ @@ -1541,6 +1587,8 @@ module.exports = /* 23 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Service for interacting with RESTful services. */ diff --git a/dist/vue-resource.js b/dist/vue-resource.js index bcd8c89e..dc23ad0d 100644 --- a/dist/vue-resource.js +++ b/dist/vue-resource.js @@ -1,5 +1,5 @@ /** - * vue-resource v0.7.2 + * vue-resource v0.7.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ @@ -60,6 +60,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Install plugin. */ @@ -124,6 +126,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 1 */ /***/ function(module, exports) { + 'use strict'; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /** @@ -255,6 +259,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 2 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Service for URL templating. */ @@ -389,6 +395,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 3 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * URL Template (RFC 6570) Transform. */ @@ -411,6 +419,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 4 */ /***/ function(module, exports) { + 'use strict'; + /** * URL Template v2.0.6 (https://github.com/bramstein/url-template) */ @@ -569,6 +579,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 5 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Legacy Transform. */ @@ -613,6 +625,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 6 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Query Parameter Transform. */ @@ -644,6 +658,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 7 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Root Prefix Transform. */ @@ -665,6 +681,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 8 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Service for sending network requests. */ @@ -676,19 +694,19 @@ return /******/ (function(modules) { // webpackBootstrap var jsonType = { 'Content-Type': 'application/json' }; function Http(url, options) { - var _this = this; - var client = Client, + var self = this || {}, + client = Client, request, promise; Http.interceptors.forEach(function (handler) { - client = interceptor(handler, _this.$vm)(client); + client = interceptor(handler, self.$vm)(client); }); options = _.isObject(url) ? url : _.extend({ url: url }, options); - request = _.merge({}, Http.options, this.$options, options); - promise = client(request).bind(this.$vm).then(function (response) { + request = _.merge({}, Http.options, self.$options, options); + promise = client(request).bind(self.$vm).then(function (response) { return response.ok ? response : Promise.reject(response); }, function (response) { @@ -762,6 +780,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 9 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Base client. */ @@ -831,6 +851,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 10 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Promise adapter. */ @@ -944,6 +966,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 11 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /** @@ -1130,6 +1154,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 12 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * XMLHttp client. */ @@ -1187,6 +1213,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 13 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Interceptor factory. */ @@ -1237,6 +1265,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 14 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Before Interceptor. */ @@ -1260,6 +1290,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 15 */ /***/ function(module, exports) { + "use strict"; + /** * Timeout Interceptor. */ @@ -1295,6 +1327,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 16 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * JSONP Interceptor. */ @@ -1318,6 +1352,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 17 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * JSONP client. */ @@ -1374,6 +1410,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 18 */ /***/ function(module, exports) { + 'use strict'; + /** * HTTP method override Interceptor. */ @@ -1396,6 +1434,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 19 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Mime Interceptor. */ @@ -1437,6 +1477,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 20 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Header Interceptor. */ @@ -1464,6 +1506,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 21 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * CORS Interceptor. */ @@ -1506,6 +1550,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 22 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * XDomain client (Internet Explorer). */ @@ -1550,6 +1596,8 @@ return /******/ (function(modules) { // webpackBootstrap /* 23 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + /** * Service for interacting with RESTful services. */ diff --git a/dist/vue-resource.min.js b/dist/vue-resource.min.js index a0510582..295c65d5 100644 --- a/dist/vue-resource.min.js +++ b/dist/vue-resource.min.js @@ -1,7 +1,7 @@ /** - * vue-resource v0.7.2 + * vue-resource v0.7.3 * https://github.com/vuejs/vue-resource * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueResource=e():t.VueResource=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function r(t){if(!r.installed){var e=n(1);e.config=t.config,e.warning=t.util.warn,e.nextTick=t.util.nextTick,t.url=n(2),t.http=n(8),t.resource=n(23),t.Promise=n(10),Object.defineProperties(t.prototype,{$url:{get:function(){return e.options(t.url,this,this.$options.url)}},$http:{get:function(){return e.options(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(n){return new t.Promise(n,e)}}}})}}"undefined"!=typeof window&&window.Vue&&window.Vue.use(r),t.exports=r},function(t,e){function n(t,e,r){for(var i in e)r&&(o.isPlainObject(e[i])||o.isArray(e[i]))?(o.isPlainObject(e[i])&&!o.isPlainObject(t[i])&&(t[i]={}),o.isArray(e[i])&&!o.isArray(t[i])&&(t[i]=[]),n(t[i],e[i],r)):void 0!==e[i]&&(t[i]=e[i])}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=e,i=[],s=window.console;o.warn=function(t){s&&o.warning&&(!o.config.silent||o.config.debug)&&s.warn("[VueResource warn]: "+t)},o.error=function(t){s&&s.error(t)},o.trim=function(t){return t.replace(/^\s*|\s*$/g,"")},o.toLower=function(t){return t?t.toLowerCase():""},o.isArray=Array.isArray,o.isString=function(t){return"string"==typeof t},o.isFunction=function(t){return"function"==typeof t},o.isObject=function(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":r(t))},o.isPlainObject=function(t){return o.isObject(t)&&Object.getPrototypeOf(t)==Object.prototype},o.options=function(t,e,n){return n=n||{},o.isFunction(n)&&(n=n.call(e)),o.merge(t.bind({$vm:e,$options:n}),t,{$options:n})},o.each=function(t,e){var n,r;if("number"==typeof t.length)for(n=0;n=200&&t.status<300,t})}},function(t,e,n){function r(t,e){t instanceof i?this.promise=t:this.promise=new i(t.bind(e)),this.context=e}var o=n(1),i=window.Promise||n(11);r.all=function(t,e){return new r(i.all(t),e)},r.resolve=function(t,e){return new r(i.resolve(t),e)},r.reject=function(t,e){return new r(i.reject(t),e)},r.race=function(t,e){return new r(i.race(t),e)};var s=r.prototype;s.bind=function(t){return this.context=t,this},s.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),this.promise=this.promise.then(t,e),this},s["catch"]=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),this.promise=this.promise["catch"](t),this},s["finally"]=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),i.reject(e)})},s.success=function(t){return o.warn("The `success` method has been deprecated. Use the `then` method instead."),this.then(function(e){return t.call(this,e.data,e.status,e)||e})},s.error=function(t){return o.warn("The `error` method has been deprecated. Use the `catch` method instead."),this["catch"](function(e){return t.call(this,e.data,e.status,e)||e})},s.always=function(t){o.warn("The `always` method has been deprecated. Use the `finally` method instead.");var e=function(e){return t.call(this,e.data,e.status,e)||e};return this.then(e,e)},t.exports=r},function(t,e,n){function r(t){this.state=a,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(n){e.reject(n)}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=n(1),s=0,u=1,a=2;r.reject=function(t){return new r(function(e,n){n(t)})},r.resolve=function(t){return new r(function(e,n){e(t)})},r.all=function(t){return new r(function(e,n){function o(n){return function(r){s[n]=r,i+=1,i===t.length&&e(s)}}var i=0,s=[];0===t.length&&e(s);for(var u=0;u=200&&t.status<300,t})}},function(t,e,n){"use strict";function r(t,e){t instanceof i?this.promise=t:this.promise=new i(t.bind(e)),this.context=e}var o=n(1),i=window.Promise||n(11);r.all=function(t,e){return new r(i.all(t),e)},r.resolve=function(t,e){return new r(i.resolve(t),e)},r.reject=function(t,e){return new r(i.reject(t),e)},r.race=function(t,e){return new r(i.race(t),e)};var s=r.prototype;s.bind=function(t){return this.context=t,this},s.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),this.promise=this.promise.then(t,e),this},s["catch"]=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),this.promise=this.promise["catch"](t),this},s["finally"]=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),i.reject(e)})},s.success=function(t){return o.warn("The `success` method has been deprecated. Use the `then` method instead."),this.then(function(e){return t.call(this,e.data,e.status,e)||e})},s.error=function(t){return o.warn("The `error` method has been deprecated. Use the `catch` method instead."),this["catch"](function(e){return t.call(this,e.data,e.status,e)||e})},s.always=function(t){o.warn("The `always` method has been deprecated. Use the `finally` method instead.");var e=function(e){return t.call(this,e.data,e.status,e)||e};return this.then(e,e)},t.exports=r},function(t,e,n){"use strict";function r(t){this.state=c,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(n){e.reject(n)}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=n(1),s=0,u=1,c=2;r.reject=function(t){return new r(function(e,n){n(t)})},r.resolve=function(t){return new r(function(e,n){e(t)})},r.all=function(t){return new r(function(e,n){function o(n){return function(r){s[n]=r,i+=1,i===t.length&&e(s)}}var i=0,s=[];0===t.length&&e(s);for(var u=0;u { - client = interceptor(handler, this.$vm)(client); + client = interceptor(handler, self.$vm)(client); }); options = _.isObject(url) ? url : _.extend({url: url}, options); - request = _.merge({}, Http.options, this.$options, options); - promise = client(request).bind(this.$vm).then((response) => { + request = _.merge({}, Http.options, self.$options, options); + promise = client(request).bind(self.$vm).then((response) => { return response.ok ? response : Promise.reject(response); diff --git a/test/webpack.config.js b/test/webpack.config.js index f978c69e..28fe900a 100644 --- a/test/webpack.config.js +++ b/test/webpack.config.js @@ -6,7 +6,7 @@ module.exports = { }, module: { loaders: [ - {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015-without-strict']}} + {test: /.js/, exclude: /node_modules/, loader: 'babel', query: {presets: ['es2015']}} ] } };