From f485adf892c5c5886ea88560a3f38011da933d44 Mon Sep 17 00:00:00 2001 From: Kennet Postigo Date: Fri, 29 Jan 2016 14:35:07 -0500 Subject: [PATCH] changed build to webpack, and changed babel asyc transformer. --- .babelrc | 2 +- dist/index.js | 15 - dist/reachGraphQL.js | 51 - dist/reachWithDispatch.js | 56 - dist/react-reach.js | 6374 +++++++++++++++++++++++++++++++++++++ dist/utils/transport.js | 42 - package.json | 13 +- src/reachWithOpts.js | 2 +- src/utils/transport.js | 1 + webpack.config.js | 38 +- 10 files changed, 6401 insertions(+), 193 deletions(-) delete mode 100644 dist/index.js delete mode 100644 dist/reachGraphQL.js delete mode 100644 dist/reachWithDispatch.js create mode 100644 dist/react-reach.js delete mode 100644 dist/utils/transport.js diff --git a/.babelrc b/.babelrc index 3094147..4ae04ec 100644 --- a/.babelrc +++ b/.babelrc @@ -2,6 +2,6 @@ "presets": ["es2015"], "plugins": [ "syntax-async-functions", - "transform-regenerator" + "transform-async-to-generator" ] } diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 96e4b20..0000000 --- a/dist/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.reachWithDispatch = exports.reachGraphQL = undefined; - -var _reachGraphQL = require('./reachGraphQL.js'); - -var _reachWithDispatch = require('./reachWithDispatch.js'); - -require('babel-polyfill'); - -exports.reachGraphQL = _reachGraphQL.reachGraphQL; -exports.reachWithDispatch = _reachWithDispatch.reachWithDispatch; diff --git a/dist/reachGraphQL.js b/dist/reachGraphQL.js deleted file mode 100644 index 0ba1d6e..0000000 --- a/dist/reachGraphQL.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.reachGraphQL = reachGraphQL; - -var _transport = require('./transport.js'); - -require('babel-polyfill'); - -/** - * [reachGraphQL Makes queres or mutations against GraphQL] - * @param {[String]} path [path to the GraphQL server] - * @param {[Object]} query [The query that GraphQL will use to fetch your data] - * @param {[object]} queryParams = {} [should contain object with different query params] - * @return {[Object]} [Data that was queried or mutated] - */ -function reachGraphQL(path, query) { - var _this = this; - - var queryParams = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - - return function _callee() { - var response; - return regeneratorRuntime.async(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.prev = 0; - _context.next = 3; - return regeneratorRuntime.awrap((0, _transport.transport)(path, query, queryParams)); - - case 3: - response = _context.sent; - return _context.abrupt('return', response.data); - - case 7: - _context.prev = 7; - _context.t0 = _context['catch'](0); - - console.log(_context.t0); - - case 10: - case 'end': - return _context.stop(); - } - } - }, null, _this, [[0, 7]]); - }; -} diff --git a/dist/reachWithDispatch.js b/dist/reachWithDispatch.js deleted file mode 100644 index 5d074d7..0000000 --- a/dist/reachWithDispatch.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.reachWithDispatch = reachWithDispatch; - -var _transport = require('./transport.js'); - -require('babel-polyfill'); - -/** - * [reachWithDispatch description] - * @param {[String]} path [path to the GraphQL server] - * @param {[Object]} query [The query that GraphQL will use to fetch your data] - * @param {[object]} queryParams = {} [should contain object with different query params] - * @param {[type]} actionCreator = ( [The actionCreator to dispatch] - * @return {[function]} [dispatch to store] - */ -function reachWithDispatch(path, query) { - var _this = this; - - var queryParams = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - var actionCreator = arguments[3]; - - return function _callee(dispatch) { - var response; - return regeneratorRuntime.async(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.prev = 0; - _context.next = 3; - return regeneratorRuntime.awrap((0, _transport.transport)(path, query, queryParams)); - - case 3: - response = _context.sent; - - dispatch(actionCreator(response.data)); - _context.next = 10; - break; - - case 7: - _context.prev = 7; - _context.t0 = _context['catch'](0); - - console.log(_context.t0); - - case 10: - case 'end': - return _context.stop(); - } - } - }, null, _this, [[0, 7]]); - }; -} diff --git a/dist/react-reach.js b/dist/react-reach.js new file mode 100644 index 0000000..dd9627a --- /dev/null +++ b/dist/react-reach.js @@ -0,0 +1,6374 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(1); + module.exports = __webpack_require__(192); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {"use strict"; + + __webpack_require__(2); + + __webpack_require__(189); + + if (global._babelPolyfill) { + throw new Error("only one instance of babel-polyfill is allowed"); + } + global._babelPolyfill = true; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + __webpack_require__(3); + __webpack_require__(36); + __webpack_require__(42); + __webpack_require__(44); + __webpack_require__(46); + __webpack_require__(48); + __webpack_require__(50); + __webpack_require__(52); + __webpack_require__(53); + __webpack_require__(54); + __webpack_require__(55); + __webpack_require__(56); + __webpack_require__(57); + __webpack_require__(58); + __webpack_require__(59); + __webpack_require__(60); + __webpack_require__(61); + __webpack_require__(62); + __webpack_require__(63); + __webpack_require__(66); + __webpack_require__(67); + __webpack_require__(68); + __webpack_require__(70); + __webpack_require__(71); + __webpack_require__(72); + __webpack_require__(73); + __webpack_require__(74); + __webpack_require__(75); + __webpack_require__(76); + __webpack_require__(78); + __webpack_require__(79); + __webpack_require__(80); + __webpack_require__(82); + __webpack_require__(83); + __webpack_require__(84); + __webpack_require__(86); + __webpack_require__(87); + __webpack_require__(88); + __webpack_require__(89); + __webpack_require__(90); + __webpack_require__(91); + __webpack_require__(92); + __webpack_require__(93); + __webpack_require__(94); + __webpack_require__(95); + __webpack_require__(96); + __webpack_require__(97); + __webpack_require__(98); + __webpack_require__(99); + __webpack_require__(104); + __webpack_require__(105); + __webpack_require__(109); + __webpack_require__(110); + __webpack_require__(112); + __webpack_require__(113); + __webpack_require__(118); + __webpack_require__(119); + __webpack_require__(122); + __webpack_require__(124); + __webpack_require__(126); + __webpack_require__(128); + __webpack_require__(129); + __webpack_require__(130); + __webpack_require__(132); + __webpack_require__(133); + __webpack_require__(135); + __webpack_require__(136); + __webpack_require__(137); + __webpack_require__(138); + __webpack_require__(145); + __webpack_require__(148); + __webpack_require__(149); + __webpack_require__(151); + __webpack_require__(152); + __webpack_require__(153); + __webpack_require__(154); + __webpack_require__(155); + __webpack_require__(156); + __webpack_require__(157); + __webpack_require__(158); + __webpack_require__(159); + __webpack_require__(160); + __webpack_require__(161); + __webpack_require__(162); + __webpack_require__(164); + __webpack_require__(165); + __webpack_require__(166); + __webpack_require__(167); + __webpack_require__(168); + __webpack_require__(169); + __webpack_require__(171); + __webpack_require__(172); + __webpack_require__(173); + __webpack_require__(174); + __webpack_require__(176); + __webpack_require__(177); + __webpack_require__(179); + __webpack_require__(180); + __webpack_require__(182); + __webpack_require__(183); + __webpack_require__(184); + __webpack_require__(187); + __webpack_require__(188); + module.exports = __webpack_require__(7); + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var $ = __webpack_require__(4), + $export = __webpack_require__(5), + DESCRIPTORS = __webpack_require__(10), + createDesc = __webpack_require__(9), + html = __webpack_require__(16), + cel = __webpack_require__(17), + has = __webpack_require__(19), + cof = __webpack_require__(20), + invoke = __webpack_require__(21), + fails = __webpack_require__(11), + anObject = __webpack_require__(22), + aFunction = __webpack_require__(15), + isObject = __webpack_require__(18), + toObject = __webpack_require__(23), + toIObject = __webpack_require__(25), + toInteger = __webpack_require__(27), + toIndex = __webpack_require__(28), + toLength = __webpack_require__(29), + IObject = __webpack_require__(26), + IE_PROTO = __webpack_require__(13)('__proto__'), + createArrayMethod = __webpack_require__(30), + arrayIndexOf = __webpack_require__(35)(false), + ObjectProto = Object.prototype, + ArrayProto = Array.prototype, + arraySlice = ArrayProto.slice, + arrayJoin = ArrayProto.join, + defineProperty = $.setDesc, + getOwnDescriptor = $.getDesc, + defineProperties = $.setDescs, + factories = {}, + IE8_DOM_DEFINE; + + if (!DESCRIPTORS) { + IE8_DOM_DEFINE = !fails(function () { + return defineProperty(cel('div'), 'a', { get: function get() { + return 7; + } }).a != 7; + }); + $.setDesc = function (O, P, Attributes) { + if (IE8_DOM_DEFINE) try { + return defineProperty(O, P, Attributes); + } catch (e) {/* empty */} + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) anObject(O)[P] = Attributes.value; + return O; + }; + $.getDesc = function (O, P) { + if (IE8_DOM_DEFINE) try { + return getOwnDescriptor(O, P); + } catch (e) {/* empty */} + if (has(O, P)) return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); + }; + $.setDescs = defineProperties = function defineProperties(O, Properties) { + anObject(O); + var keys = $.getKeys(Properties), + length = keys.length, + i = 0, + P; + while (length > i) { + $.setDesc(O, P = keys[i++], Properties[P]); + }return O; + }; + } + $export($export.S + $export.F * !DESCRIPTORS, 'Object', { + // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $.getDesc, + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + defineProperty: $.setDesc, + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + defineProperties: defineProperties + }); + + // IE 8- don't enum bug keys + var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + 'toLocaleString,toString,valueOf').split(',') + // Additional keys for getOwnPropertyNames + , + keys2 = keys1.concat('length', 'prototype'), + keysLen1 = keys1.length; + + // Create object with `null` prototype: use iframe Object with cleared prototype + var _createDict = function createDict() { + // Thrash, waste and sodomy: IE GC bug + var iframe = cel('iframe'), + i = keysLen1, + gt = '>', + iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write('