diff --git a/README.md b/README.md index e67b4ed..5355b6e 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Run `npm start`. This single command does 3 things: Effectively, whenever you make any changes in Reason sources, they get automatically compiled to JS. Then `webpack` picks the new files and bundles into a single file `main.js` inside `/bundledOutputs` dir. This file is ready to be used in the browser (see `/index.html`). ## Production build -Run `npm run build`. For faster and smaller bundle try running `NODE_ENV=production npm run build` +Run `npm run build`. For faster and smaller bundle try running `npm run prod`. # Demo [https://mmiszy.github.io/reason-react-simple-starter/](https://mmiszy.github.io/reason-react-simple-starter/) diff --git a/bsconfig.json b/bsconfig.json index 26866e0..aa50fa5 100644 --- a/bsconfig.json +++ b/bsconfig.json @@ -2,7 +2,7 @@ // BuckleScript comes with its own parser for bsconfig.json, which is normal JSON, with the extra support of comments and trailing commas. { "name": "reason-react-simple-starter", - "version": "1.0.0", + "version": "2.0.0", "reason": { "react-jsx": 2 }, diff --git a/bundledOutputs/main.js b/bundledOutputs/main.js index 87cb19a..395a225 100644 --- a/bundledOutputs/main.js +++ b/bundledOutputs/main.js @@ -1,21 +1 @@ -!function(e){function t(e){delete installedChunks[e]}function n(e){var t=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.src=d.p+""+e+"."+w+".hot-update.js",t.appendChild(n)}function r(e){return e=e||1e4,new Promise(function(t,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=d.p+""+w+".hot-update.json";r.open("GET",o,!0),r.timeout=e,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)t();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var e=JSON.parse(r.responseText)}catch(e){return void n(e)}t(e)}}})}function o(e){var t=I[e];if(!t)return d;var n=function(n){return t.hot.active?(I[n]?I[n].parents.indexOf(e)<0&&I[n].parents.push(e):(E=[e],m=n),t.children.indexOf(n)<0&&t.children.push(n)):(console.warn("[HMR] unexpected require("+n+") from disposed module "+e),E=[]),d(n)};for(var r in d)Object.prototype.hasOwnProperty.call(d,r)&&"e"!==r&&Object.defineProperty(n,r,function(e){return{configurable:!0,enumerable:!0,get:function(){return d[e]},set:function(t){d[e]=t}}}(r));return n.e=function(e){function t(){N--,"prepare"===T&&(A[e]||l(e),0===N&&0===k&&p())}return"ready"===T&&a("prepare"),N++,d.e(e).then(t,function(e){throw t(),e})},n}function i(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:m!==e,active:!0,accept:function(e,n){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var r=0;r=0&&t._disposeHandlers.splice(n,1)},check:u,apply:f,status:function(e){if(!e)return T;S.push(e)},addStatusHandler:function(e){S.push(e)},removeStatusHandler:function(e){var t=S.indexOf(e);t>=0&&S.splice(t,1)},data:C[e]};return m=void 0,t}function a(e){T=e;for(var t=0;t0;){var i=o.pop(),a=i.id,s=i.chain;if((c=I[a])&&!c.hot._selfAccepted){if(c.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:a};if(c.hot._main)return{type:"unaccepted",chain:s,moduleId:a};for(var u=0;u=0||(p.hot._acceptedDependencies[a]?(n[l]||(n[l]=[]),r(n[l],[a])):(delete n[l],t.push(l),o.push({chain:s.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}(l):{type:"disposed",moduleId:v};var _=!1,x=!1,S=!1,k="";switch(b.chain&&(k="\nUpdate propagation: "+b.chain.join(" -> ")),b.type){case"self-declined":n.onDeclined&&n.onDeclined(b),n.ignoreDeclined||(_=new Error("Aborted because of self decline: "+b.moduleId+k));break;case"declined":n.onDeclined&&n.onDeclined(b),n.ignoreDeclined||(_=new Error("Aborted because of declined dependency: "+b.moduleId+" in "+b.parentId+k));break;case"unaccepted":n.onUnaccepted&&n.onUnaccepted(b),n.ignoreUnaccepted||(_=new Error("Aborted because "+l+" is not accepted"+k));break;case"accepted":n.onAccepted&&n.onAccepted(b),x=!0;break;case"disposed":n.onDisposed&&n.onDisposed(b),S=!0;break;default:throw new Error("Unexception type "+b.type)}if(_)return a("abort"),Promise.reject(_);if(x){h[l]=g[l],r(f,b.outdatedModules);for(l in b.outdatedDependencies)Object.prototype.hasOwnProperty.call(b.outdatedDependencies,l)&&(p[l]||(p[l]=[]),r(p[l],b.outdatedDependencies[l]))}S&&(r(f,[b.moduleId]),h[l]=m)}var N=[];for(i=0;i0;)if(l=O.pop(),c=I[l]){var R={},D=c.hot._disposeHandlers;for(u=0;u=0&&M.parents.splice(A,1))}}var L,U;for(l in p)if(Object.prototype.hasOwnProperty.call(p,l)&&(c=I[l]))for(U=p[l],u=0;u=0&&c.children.splice(A,1);a("apply"),w=y;for(l in h)Object.prototype.hasOwnProperty.call(h,l)&&(e[l]=h[l]);var j=null;for(l in p)if(Object.prototype.hasOwnProperty.call(p,l)){c=I[l],U=p[l];var q=[];for(i=0;i=0||q.push(o);for(i=0;i1)))/4)-_((e-1901+t)/100)+_((e-1601+t)/400)};if((h=g.hasOwnProperty)||(h=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=y?h=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,h=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,h.call(this,e)}),m=function(e,t){var n,r,o,i=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(o in r)h.call(r,o)&&i++;return n=r=null,i?m=2==i?function(e,t){var n,r={},o="[object Function]"==y.call(e);for(n in e)o&&"prototype"==n||h.call(r,n)||!(r[n]=1)||!h.call(e,n)||t(n)}:function(e,t){var n,r,o="[object Function]"==y.call(e);for(n in e)o&&"prototype"==n||!h.call(e,n)||(r="constructor"===n)||t(n);(r||h.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(e,t){var n,o,i="[object Function]"==y.call(e),a=!i&&"function"!=typeof e.constructor&&s[typeof e.hasOwnProperty]&&e.hasOwnProperty||h;for(n in e)i&&"prototype"==n||!a.call(e,n)||t(n);for(o=r.length;n=r[--o];a.call(e,n)&&t(n));}),m(e,t)},!n("json-stringify")){var x={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},S=function(e,t){return("000000"+(t||0)).slice(-e)},T=function(e){for(var t='"',n=0,r=e.length,o=!w||r>10,i=o&&(w?e.split(""):e);n-1/0&&s<1/0){if(E){for(f=_(s/864e5),c=_(f/365.2425)+1970-1;E(c+1,0)<=f;c++);for(l=_((f-E(c,0))/30.42);E(c,l+1)<=f;l++);f=1+f-E(c,l),d=(s%864e5+864e5)%864e5,g=_(d/36e5)%24,b=_(d/6e4)%60,w=_(d/1e3)%60,C=d%1e3}else c=s.getUTCFullYear(),l=s.getUTCMonth(),f=s.getUTCDate(),g=s.getUTCHours(),b=s.getUTCMinutes(),w=s.getUTCSeconds(),C=s.getUTCMilliseconds();s=(c<=0||c>=1e4?(c<0?"-":"+")+S(6,c<0?-c:c):S(4,c))+"-"+S(2,l+1)+"-"+S(2,f)+"T"+S(2,g)+":"+S(2,b)+":"+S(2,w)+"."+S(3,C)+"Z"}else s=null;if(n&&(s=n.call(t,e,s)),null===s)return"null";if("[object Boolean]"==(u=y.call(s)))return""+s;if("[object Number]"==u)return s>-1/0&&s<1/0?""+s:"null";if("[object String]"==u)return T(""+s);if("object"==typeof s){for(O=a.length;O--;)if(a[O]===s)throw p();if(a.push(s),x=[],P=i,i+=o,"[object Array]"==u){for(A=0,O=s.length;A0)for(r="",n>10&&(n=10);r.length=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||I();e+=O("0x"+i.slice(t,N));break;default:I()}else{if(34==o)break;for(o=i.charCodeAt(N),t=N;o>=32&&92!=o&&34!=o;)o=i.charCodeAt(++N);e+=i.slice(t,N)}if(34==i.charCodeAt(N))return N++,e;I();default:if(t=N,45==o&&(r=!0,o=i.charCodeAt(++N)),o>=48&&o<=57){for(48==o&&(o=i.charCodeAt(N+1))>=48&&o<=57&&I(),r=!1;N=48&&o<=57;N++);if(46==i.charCodeAt(N)){for(n=++N;n=48&&o<=57;n++);n==N&&I(),N=n}if(101==(o=i.charCodeAt(N))||69==o){for(o=i.charCodeAt(++N),43!=o&&45!=o||N++,n=N;n=48&&o<=57;n++);n==N&&I(),N=n}return+i.slice(t,N)}if(r&&I(),"true"==i.slice(N,N+4))return N+=4,!0;if("false"==i.slice(N,N+5))return N+=5,!1;if("null"==i.slice(N,N+4))return N+=4,null;I()}return"$"},D=function(e){var t,n;if("$"==e&&I(),"string"==typeof e){if("@"==(w?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=R());n||(n=!0))n&&(","==e?"]"==(e=R())&&I():I()),","==e&&I(),t.push(D(e));return t}if("{"==e){for(t={};"}"!=(e=R());n||(n=!0))n&&(","==e?"}"==(e=R())&&I():I()),","!=e&&"string"==typeof e&&"@"==(w?e.charAt(0):e[0])&&":"==R()||I(),t[e.slice(1)]=D(R());return t}I()}return e},M=function(e,t,n){var r=L(e,t,n);r===v?delete e[t]:e[t]=r},L=function(e,t,n){var r,o=e[t];if("object"==typeof o&&o)if("[object Array]"==y.call(o))for(r=o.length;r--;)M(o,r,n);else m(o,function(e){M(o,e,n)});return n.call(e,t,o)};t.parse=function(e,t){var n,r;return N=0,A=""+e,n=D(R()),"$"!=R()&&I(),N=A=null,t&&"[object Function]"==y.call(t)?L((r={},r[""]=n,r),"",t):n}}}return t.runInContext=i,t}var a=n(142),s={function:!0,object:!0},u=s[typeof t]&&t&&!t.nodeType&&t,c=s[typeof window]&&window||this,l=u&&s[typeof e]&&e&&!e.nodeType&&"object"==typeof r&&r;if(!l||l.global!==l&&l.window!==l&&l.self!==l||(c=l),u&&!a)i(c,u);else{var p=c.JSON,f=c.JSON3,d=!1,h=i(c,c.JSON3={noConflict:function(){return d||(d=!0,c.JSON=p,c.JSON3=f,p=f=null),h}});c.JSON={parse:h.parse,stringify:h.stringify}}a&&void 0!==(o=function(){return h}.call(t,n,t,e))&&(e.exports=o)}).call(this)}).call(t,n(65)(e),n(4))},function(e,t,n){"use strict";var r={current:null};e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){var s=o[i];s?this[i]=s(n):"target"===i?this.target=r:this[i]=n[i]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var o=n(5),i=n(17),a=n(10),s=(n(2),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n1){for(var h=Array(d),m=0;m1){for(var g=Array(v),y=0;y