react 16.0.0-alpha.3 → 16.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-with-addons.js +209 -181
- package/dist/react-with-addons.min.js +2 -2
- package/dist/react.js +164 -136
- package/dist/react.min.js +2 -2
- package/lib/ReactAddonsDOMDependencies.js +1 -1
- package/lib/ReactClass.js +2 -2
- package/lib/ReactComponentTreeHook.js +8 -47
- package/lib/ReactDebugCurrentFrame.js +3 -1
- package/lib/ReactElementValidator.js +5 -3
- package/lib/ReactFiberComponentTreeHook.js +62 -0
- package/lib/ReactPropTypes.js +1 -1
- package/lib/ReactVersion.js +1 -1
- package/lib/traverseAllChildren.js +1 -1
- package/lib/update.js +2 -2
- package/package.json +1 -1
- package/lib/ReactStateSetters.js +0 -103
- package/lib/sliceChildren.js +0 -33
package/dist/react.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React v16.0.0-alpha.
|
|
2
|
+
* React v16.0.0-alpha.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright 2013-present, Facebook, Inc.
|
|
5
5
|
* All rights reserved.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.React=t()}}(function(){return function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";function r(t){var e=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+t).replace(e,function(t){return n[t]});return"$"+r}function o(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1);return(""+r).replace(e,function(t){return n[t]})}var i={escape:r,unescape:o};e.exports=i},{}],2:[function(t,e,n){"use strict";var r=t(20),o=(t(24),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),i=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},a=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},u=function(t,e,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,t,e,n,r),i}return new o(t,e,n,r)},s=function(t){var e=this;t instanceof e?void 0:r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=10,l=o,p=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||l,n.poolSize||(n.poolSize=c),n.release=s,n},f={addPoolingTo:p,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:u};e.exports=f},{20:20,24:24}],3:[function(t,e,n){"use strict";var r=t(4),o=t(5),i=t(6),a=t(8),u=t(9),s=t(12),c=t(15),l=t(19),p=(t(25),t(17)),f=u.createElement,d=u.createFactory,h=u.cloneElement,y=function(t){return t},v={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:r.Component,PureComponent:r.PureComponent,createElement:f,cloneElement:h,isValidElement:u.isValidElement,checkPropTypes:p,PropTypes:s,createClass:i.createClass,createFactory:d,createMixin:y,DOM:a,version:c};e.exports=v},{12:12,15:15,17:17,19:19,25:25,4:4,5:5,6:6,8:8,9:9}],4:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||s}function o(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||s}function i(){}var a=t(20),u=t(26),s=t(11),c=(t(16),t(23));t(24),t(25);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t?a("85"):void 0,this.updater.enqueueSetState(this,t,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};i.prototype=r.prototype,o.prototype=new i,o.prototype.constructor=o,u(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:o}},{11:11,16:16,20:20,23:23,24:24,25:25,26:26}],5:[function(t,e,n){"use strict";function r(t){return(""+t).replace(b,"$&/")}function o(t,e){this.func=t,this.context=e,this.count=0}function i(t,e,n){var r=t.func,o=t.context;r.call(o,e,t.count++)}function a(t,e,n){if(null==t)return t;var r=o.getPooled(e,n);m(t,i,r),o.release(r)}function u(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function s(t,e,n){var o=t.result,i=t.keyPrefix,a=t.func,u=t.context,s=a.call(u,e,t.count++);Array.isArray(s)?c(s,o,n,v.thatReturnsArgument):null!=s&&(y.isValidElement(s)&&(s=y.cloneAndReplaceKey(s,i+(!s.key||e&&e.key===s.key?"":r(s.key)+"/")+n)),o.push(s))}function c(t,e,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=u.getPooled(e,a,o,i);m(t,s,c),u.release(c)}function l(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function p(t,e,n){return null}function f(t,e){return m(t,p,null)}function d(t){var e=[];return c(t,e,null,v.thatReturnsArgument),e}var h=t(2),y=t(9),v=t(22),m=t(21),g=h.twoArgumentPooler,E=h.fourArgumentPooler,b=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,g),u.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(u,E);var _={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:f,toArray:d};e.exports=_},{2:2,21:21,22:22,9:9}],6:[function(t,e,n){"use strict";function r(t){return t}function o(t,e){var n=b.hasOwnProperty(e)?b[e]:null;P.hasOwnProperty(e)&&("OVERRIDE_BASE"!==n?f("73",e):void 0),t&&("DEFINE_MANY"!==n&&"DEFINE_MANY_MERGED"!==n?f("74",e):void 0)}function i(t,e){if(e){"function"==typeof e?f("75"):void 0,y.isValidElement(e)?f("76"):void 0;var n=t.prototype,r=n.__reactAutoBindPairs;e.hasOwnProperty(E)&&_.mixins(t,e.mixins);for(var i in e)if(e.hasOwnProperty(i)&&i!==E){var a=e[i],u=n.hasOwnProperty(i);if(o(u,i),_.hasOwnProperty(i))_[i](t,a);else{var l=b.hasOwnProperty(i),p="function"==typeof a,d=p&&!l&&!u&&e.autobind!==!1;if(d)r.push(i,a),n[i]=a;else if(u){var h=b[i];!l||"DEFINE_MANY_MERGED"!==h&&"DEFINE_MANY"!==h?f("77",h,i):void 0,"DEFINE_MANY_MERGED"===h?n[i]=s(n[i],a):"DEFINE_MANY"===h&&(n[i]=c(n[i],a))}else n[i]=a}}}}function a(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in _;o?f("78",n):void 0;var i=n in t;i?f("79",n):void 0,t[n]=r}}}function u(t,e){t&&e&&"object"==typeof t&&"object"==typeof e?void 0:f("80");for(var n in e)e.hasOwnProperty(n)&&(void 0!==t[n]?f("81",n):void 0,t[n]=e[n]);return t}function s(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return u(o,n),u(o,r),o}}function c(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function l(t,e){var n=e.bind(t);return n}function p(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=l(t,o)}}var f=t(20),d=t(26),h=t(4),y=t(9),v=t(11),m=t(23),g=(t(24),t(25),h.Component),E="mixins",b={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=d({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=d({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=s(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=d({},t.propTypes,e)},statics:function(t,e){a(t,e)},autobind:function(){}},P={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e,"replaceState")},isMounted:function(){return this.updater.isMounted(this)}},x=function(){};d(x.prototype,g.prototype,P);var N={createClass:function(t){var e=r(function(t,n,r){this.__reactAutoBindPairs.length&&p(this),this.props=t,this.context=n,this.refs=m,this.updater=r||v,this.state=null;var o=this.getInitialState?this.getInitialState():null;"object"!=typeof o||Array.isArray(o)?f("82",e.displayName||"ReactCompositeComponent"):void 0,this.state=o});e.prototype=new x,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),e.prototype.render?void 0:f("83");for(var n in b)e.prototype[n]||(e.prototype[n]=null);return e}};e.exports=N},{11:11,20:20,23:23,24:24,25:25,26:26,4:4,9:9}],7:[function(t,e,n){"use strict";var r={current:null};e.exports=r},{}],8:[function(t,e,n){"use strict";var r=t(9),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},{9:9}],9:[function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function o(t){return void 0!==t.key}var i=t(26),a=t(7),u=(t(25),t(16),Object.prototype.hasOwnProperty),s=t(10),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(t,e,n,r,o,i,a){var u={$$typeof:s,type:t,key:e,ref:n,props:a,_owner:i};return u};l.createElement=function(t,e,n){var i,s={},p=null,f=null,d=null,h=null;if(null!=e){r(e)&&(f=e.ref),o(e)&&(p=""+e.key),d=void 0===e.__self?null:e.__self,h=void 0===e.__source?null:e.__source;for(i in e)u.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i])}var y=arguments.length-2;if(1===y)s.children=n;else if(y>1){for(var v=Array(y),m=0;m<y;m++)v[m]=arguments[m+2];s.children=v}if(t&&t.defaultProps){var g=t.defaultProps;for(i in g)void 0===s[i]&&(s[i]=g[i])}return l(t,p,f,d,h,a.current,s)},l.createFactory=function(t){var e=l.createElement.bind(null,t);return e.type=t,e},l.cloneAndReplaceKey=function(t,e){var n=l(t.type,e,t.ref,t._self,t._source,t._owner,t.props);return n},l.cloneElement=function(t,e,n){var s,p=i({},t.props),f=t.key,d=t.ref,h=t._self,y=t._source,v=t._owner;if(null!=e){r(e)&&(d=e.ref,v=a.current),o(e)&&(f=""+e.key);var m;t.type&&t.type.defaultProps&&(m=t.type.defaultProps);for(s in e)u.call(e,s)&&!c.hasOwnProperty(s)&&(void 0===e[s]&&void 0!==m?p[s]=m[s]:p[s]=e[s])}var g=arguments.length-2;if(1===g)p.children=n;else if(g>1){for(var E=Array(g),b=0;b<g;b++)E[b]=arguments[b+2];p.children=E}return l(t.type,f,d,h,y,v,p)},l.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},e.exports=l},{10:10,16:16,25:25,26:26,7:7}],10:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},{}],11:[function(t,e,n){"use strict";function r(t,e){}var o=(t(25),{isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,n){r(t,"forceUpdate")},enqueueReplaceState:function(t,e,n,o){r(t,"replaceState")},enqueueSetState:function(t,e,n,o){r(t,"setState")}});e.exports=o},{25:25}],12:[function(t,e,n){"use strict";function r(t){this.message=t,this.stack=""}var o,i=(t(20),t(9),t(13),t(22),t(18),t(24)),a=(t(25),function(){i(!1,"React.PropTypes type checking code is stripped in production.")});a.isRequired=a;var u=function(){return a};o={array:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:u,element:a,instanceOf:u,node:a,objectOf:u,oneOf:u,oneOfType:u,shape:u},r.prototype=Error.prototype,e.exports=o},{13:13,18:18,20:20,22:22,24:24,25:25,9:9}],13:[function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r},{}],14:[function(t,e,n){"use strict";var r=t(26),o=t(3),i=r({__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:t(7)}},o);e.exports=i},{26:26,3:3,7:7}],15:[function(t,e,n){"use strict";e.exports="16.0.0-alpha.3"},{}],16:[function(t,e,n){"use strict";var r=!1;e.exports=r},{}],17:[function(t,e,n){"use strict";function r(t,e,n,r,o){}t(20),t(13),t(24),t(25);e.exports=r},{13:13,20:20,24:24,25:25}],18:[function(t,e,n){"use strict";function r(t){var e=t&&(o&&t[o]||t[i]);if("function"==typeof e)return e}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},{}],19:[function(t,e,n){"use strict";function r(t){return i.isValidElement(t)?void 0:o("143"),t}var o=t(20),i=t(9);t(24);e.exports=r},{20:20,24:24,9:9}],20:[function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},{}],21:[function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function o(t,e,n,i){var c=typeof t;if("undefined"!==c&&"boolean"!==c||(t=null),null===t||"string"===c||"number"===c||"object"===c&&t.$$typeof===u)return n(i,t,""===e?l+r(t,0):e),1;var f,d,h=0,y=""===e?l:e+p;if(Array.isArray(t))for(var v=0;v<t.length;v++)f=t[v],d=y+r(f,v),h+=o(f,d,n,i);else{var m=s(t);if(m)for(var g,E=m.call(t),b=0;!(g=E.next()).done;)f=g.value,d=y+r(f,b++),h+=o(f,d,n,i);else if("object"===c){var _="",P=String(t);a("31","[object Object]"===P?"object with keys {"+Object.keys(t).join(", ")+"}":P,_)}}return h}function i(t,e,n){return null==t?0:o(t,"",e,n)}var a=t(20),u=(t(7),t(10)),s=t(18),c=(t(24),t(1)),l=(t(25),"."),p=":";e.exports=i},{1:1,10:10,18:18,20:20,24:24,25:25,7:7}],22:[function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},e.exports=o},{}],23:[function(t,e,n){"use strict";var r={};e.exports=r},{}],24:[function(t,e,n){"use strict";function r(t,e,n,r,i,a,u,s){if(o(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,u,s],p=0;c=new Error(e.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(t){};e.exports=r},{}],25:[function(t,e,n){"use strict";var r=t(22),o=r;e.exports=o},{22:22}],26:[function(t,e,n){/*
|
|
12
|
+
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.React=t()}}(function(){return function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";function r(t){var e=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+t).replace(e,function(t){return n[t]});return"$"+r}function o(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1);return(""+r).replace(e,function(t){return n[t]})}var i={escape:r,unescape:o};e.exports=i},{}],2:[function(t,e,n){"use strict";var r=t(20),o=(t(24),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),i=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},a=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},u=function(t,e,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,t,e,n,r),i}return new o(t,e,n,r)},s=function(t){var e=this;t instanceof e?void 0:r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=10,l=o,p=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||l,n.poolSize||(n.poolSize=c),n.release=s,n},f={addPoolingTo:p,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:u};e.exports=f},{20:20,24:24}],3:[function(t,e,n){"use strict";var r=t(4),o=t(5),i=t(6),a=t(8),u=t(9),s=t(12),c=t(15),l=t(19),p=(t(25),t(17)),f=u.createElement,d=u.createFactory,h=u.cloneElement,y=function(t){return t},v={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:r.Component,PureComponent:r.PureComponent,createElement:f,cloneElement:h,isValidElement:u.isValidElement,checkPropTypes:p,PropTypes:s,createClass:i.createClass,createFactory:d,createMixin:y,DOM:a,version:c};e.exports=v},{12:12,15:15,17:17,19:19,25:25,4:4,5:5,6:6,8:8,9:9}],4:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||s}function o(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||s}function i(){}var a=t(20),u=t(26),s=t(11),c=(t(16),t(23));t(24),t(25);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t?a("85"):void 0,this.updater.enqueueSetState(this,t,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};i.prototype=r.prototype,o.prototype=new i,o.prototype.constructor=o,u(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:o}},{11:11,16:16,20:20,23:23,24:24,25:25,26:26}],5:[function(t,e,n){"use strict";function r(t){return(""+t).replace(b,"$&/")}function o(t,e){this.func=t,this.context=e,this.count=0}function i(t,e,n){var r=t.func,o=t.context;r.call(o,e,t.count++)}function a(t,e,n){if(null==t)return t;var r=o.getPooled(e,n);m(t,i,r),o.release(r)}function u(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function s(t,e,n){var o=t.result,i=t.keyPrefix,a=t.func,u=t.context,s=a.call(u,e,t.count++);Array.isArray(s)?c(s,o,n,v.thatReturnsArgument):null!=s&&(y.isValidElement(s)&&(s=y.cloneAndReplaceKey(s,i+(!s.key||e&&e.key===s.key?"":r(s.key)+"/")+n)),o.push(s))}function c(t,e,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=u.getPooled(e,a,o,i);m(t,s,c),u.release(c)}function l(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function p(t,e,n){return null}function f(t,e){return m(t,p,null)}function d(t){var e=[];return c(t,e,null,v.thatReturnsArgument),e}var h=t(2),y=t(9),v=t(22),m=t(21),g=h.twoArgumentPooler,E=h.fourArgumentPooler,b=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,g),u.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(u,E);var _={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:f,toArray:d};e.exports=_},{2:2,21:21,22:22,9:9}],6:[function(t,e,n){"use strict";function r(t){return t}function o(t,e){var n=b.hasOwnProperty(e)?b[e]:null;P.hasOwnProperty(e)&&("OVERRIDE_BASE"!==n?d("73",e):void 0),t&&("DEFINE_MANY"!==n&&"DEFINE_MANY_MERGED"!==n?d("74",e):void 0)}function i(t,e){if(e){"function"==typeof e?d("75"):void 0,y.isValidElement(e)?d("76"):void 0;var n=t.prototype,r=n.__reactAutoBindPairs;e.hasOwnProperty(E)&&_.mixins(t,e.mixins);for(var i in e)if(e.hasOwnProperty(i)&&i!==E){var a=e[i],u=n.hasOwnProperty(i);if(o(u,i),_.hasOwnProperty(i))_[i](t,a);else{var l=b.hasOwnProperty(i),p="function"==typeof a,f=p&&!l&&!u&&e.autobind!==!1;if(f)r.push(i,a),n[i]=a;else if(u){var h=b[i];!l||"DEFINE_MANY_MERGED"!==h&&"DEFINE_MANY"!==h?d("77",h,i):void 0,"DEFINE_MANY_MERGED"===h?n[i]=s(n[i],a):"DEFINE_MANY"===h&&(n[i]=c(n[i],a))}else n[i]=a}}}}function a(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in _;o?d("78",n):void 0;var i=n in t;i?d("79",n):void 0,t[n]=r}}}function u(t,e){t&&e&&"object"==typeof t&&"object"==typeof e?void 0:d("80");for(var n in e)e.hasOwnProperty(n)&&(void 0!==t[n]?d("81",n):void 0,t[n]=e[n]);return t}function s(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return u(o,n),u(o,r),o}}function c(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function l(t,e){var n=e.bind(t);return n}function p(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=l(t,o)}}var f=t(26),d=t(20),h=t(4),y=t(9),v=t(11),m=t(23),g=(t(24),t(25),h.Component),E="mixins",b={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=f({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=f({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=s(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=f({},t.propTypes,e)},statics:function(t,e){a(t,e)},autobind:function(){}},P={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e,"replaceState")},isMounted:function(){return this.updater.isMounted(this)}},x=function(){};f(x.prototype,g.prototype,P);var N={createClass:function(t){var e=r(function(t,n,r){this.__reactAutoBindPairs.length&&p(this),this.props=t,this.context=n,this.refs=m,this.updater=r||v,this.state=null;var o=this.getInitialState?this.getInitialState():null;"object"!=typeof o||Array.isArray(o)?d("82",e.displayName||"ReactCompositeComponent"):void 0,this.state=o});e.prototype=new x,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),e.prototype.render?void 0:d("83");for(var n in b)e.prototype[n]||(e.prototype[n]=null);return e}};e.exports=N},{11:11,20:20,23:23,24:24,25:25,26:26,4:4,9:9}],7:[function(t,e,n){"use strict";var r={current:null};e.exports=r},{}],8:[function(t,e,n){"use strict";var r=t(9),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},{9:9}],9:[function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function o(t){return void 0!==t.key}var i=t(26),a=t(7),u=(t(25),t(16),Object.prototype.hasOwnProperty),s=t(10),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(t,e,n,r,o,i,a){var u={$$typeof:s,type:t,key:e,ref:n,props:a,_owner:i};return u};l.createElement=function(t,e,n){var i,s={},p=null,f=null,d=null,h=null;if(null!=e){r(e)&&(f=e.ref),o(e)&&(p=""+e.key),d=void 0===e.__self?null:e.__self,h=void 0===e.__source?null:e.__source;for(i in e)u.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i])}var y=arguments.length-2;if(1===y)s.children=n;else if(y>1){for(var v=Array(y),m=0;m<y;m++)v[m]=arguments[m+2];s.children=v}if(t&&t.defaultProps){var g=t.defaultProps;for(i in g)void 0===s[i]&&(s[i]=g[i])}return l(t,p,f,d,h,a.current,s)},l.createFactory=function(t){var e=l.createElement.bind(null,t);return e.type=t,e},l.cloneAndReplaceKey=function(t,e){var n=l(t.type,e,t.ref,t._self,t._source,t._owner,t.props);return n},l.cloneElement=function(t,e,n){var s,p=i({},t.props),f=t.key,d=t.ref,h=t._self,y=t._source,v=t._owner;if(null!=e){r(e)&&(d=e.ref,v=a.current),o(e)&&(f=""+e.key);var m;t.type&&t.type.defaultProps&&(m=t.type.defaultProps);for(s in e)u.call(e,s)&&!c.hasOwnProperty(s)&&(void 0===e[s]&&void 0!==m?p[s]=m[s]:p[s]=e[s])}var g=arguments.length-2;if(1===g)p.children=n;else if(g>1){for(var E=Array(g),b=0;b<g;b++)E[b]=arguments[b+2];p.children=E}return l(t.type,f,d,h,y,v,p)},l.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},e.exports=l},{10:10,16:16,25:25,26:26,7:7}],10:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},{}],11:[function(t,e,n){"use strict";function r(t,e){}var o=(t(25),{isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,n){r(t,"forceUpdate")},enqueueReplaceState:function(t,e,n,o){r(t,"replaceState")},enqueueSetState:function(t,e,n,o){r(t,"setState")}});e.exports=o},{25:25}],12:[function(t,e,n){"use strict";function r(t){this.message=t,this.stack=""}var o,i=t(20),a=(t(9),t(13),t(22),t(18),t(24),t(25),function(){i("144")});a.isRequired=a;var u=function(){return a};o={array:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:u,element:a,instanceOf:u,node:a,objectOf:u,oneOf:u,oneOfType:u,shape:u},r.prototype=Error.prototype,e.exports=o},{13:13,18:18,20:20,22:22,24:24,25:25,9:9}],13:[function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r},{}],14:[function(t,e,n){"use strict";var r=t(26),o=t(3),i=r({__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:t(7)}},o);e.exports=i},{26:26,3:3,7:7}],15:[function(t,e,n){"use strict";e.exports="16.0.0-alpha.4"},{}],16:[function(t,e,n){"use strict";var r=!1;e.exports=r},{}],17:[function(t,e,n){"use strict";function r(t,e,n,r,o){}t(20),t(13),t(24),t(25);e.exports=r},{13:13,20:20,24:24,25:25}],18:[function(t,e,n){"use strict";function r(t){var e=t&&(o&&t[o]||t[i]);if("function"==typeof e)return e}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},{}],19:[function(t,e,n){"use strict";function r(t){return i.isValidElement(t)?void 0:o("143"),t}var o=t(20),i=t(9);t(24);e.exports=r},{20:20,24:24,9:9}],20:[function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},{}],21:[function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function o(t,e,n,i){var c=typeof t;if("undefined"!==c&&"boolean"!==c||(t=null),null===t||"string"===c||"number"===c||"object"===c&&t.$$typeof===u)return n(i,t,""===e?l+r(t,0):e),1;var f,d,h=0,y=""===e?l:e+p;if(Array.isArray(t))for(var v=0;v<t.length;v++)f=t[v],d=y+r(f,v),h+=o(f,d,n,i);else{var m=s(t);if(m)for(var g,E=m.call(t),b=0;!(g=E.next()).done;)f=g.value,d=y+r(f,b++),h+=o(f,d,n,i);else if("object"===c){var _="",P=""+t;a("31","[object Object]"===P?"object with keys {"+Object.keys(t).join(", ")+"}":P,_)}}return h}function i(t,e,n){return null==t?0:o(t,"",e,n)}var a=t(20),u=(t(7),t(10)),s=t(18),c=(t(24),t(1)),l=(t(25),"."),p=":";e.exports=i},{1:1,10:10,18:18,20:20,24:24,25:25,7:7}],22:[function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},e.exports=o},{}],23:[function(t,e,n){"use strict";var r={};e.exports=r},{}],24:[function(t,e,n){"use strict";function r(t,e,n,r,i,a,u,s){if(o(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,u,s],p=0;c=new Error(e.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(t){};e.exports=r},{}],25:[function(t,e,n){"use strict";var r=t(22),o=r;e.exports=o},{22:22}],26:[function(t,e,n){/*
|
|
13
13
|
object-assign
|
|
14
14
|
(c) Sindre Sorhus
|
|
15
15
|
@license MIT
|
package/lib/ReactClass.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var _assign = require('object-assign'),
|
|
14
|
+
_prodInvariant = require('./reactProdInvariant');
|
|
15
15
|
|
|
16
16
|
var ReactBaseClasses = require('./ReactBaseClasses');
|
|
17
17
|
var ReactElement = require('./ReactElement');
|
|
@@ -14,16 +14,14 @@
|
|
|
14
14
|
var _prodInvariant = require('./reactProdInvariant');
|
|
15
15
|
|
|
16
16
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
17
|
-
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
18
|
-
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
19
|
-
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
20
|
-
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
21
|
-
HostComponent = ReactTypeOfWork.HostComponent;
|
|
22
17
|
|
|
18
|
+
var _require = require('./ReactFiberComponentTreeHook'),
|
|
19
|
+
getStackAddendumByWorkInProgressFiber = _require.getStackAddendumByWorkInProgressFiber,
|
|
20
|
+
describeComponentFrame = _require.describeComponentFrame;
|
|
23
21
|
|
|
24
|
-
var getComponentName = require('./getComponentName');
|
|
25
22
|
var invariant = require('fbjs/lib/invariant');
|
|
26
23
|
var warning = require('fbjs/lib/warning');
|
|
24
|
+
var getComponentName = require('./getComponentName');
|
|
27
25
|
|
|
28
26
|
function isNative(fn) {
|
|
29
27
|
// Based on isNative() from Lodash
|
|
@@ -144,10 +142,6 @@ function purgeDeep(id) {
|
|
|
144
142
|
}
|
|
145
143
|
}
|
|
146
144
|
|
|
147
|
-
function describeComponentFrame(name, source, ownerName) {
|
|
148
|
-
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
145
|
function getDisplayName(element) {
|
|
152
146
|
if (element == null) {
|
|
153
147
|
return '#empty';
|
|
@@ -164,31 +158,13 @@ function describeID(id) {
|
|
|
164
158
|
var name = ReactComponentTreeHook.getDisplayName(id);
|
|
165
159
|
var element = ReactComponentTreeHook.getElement(id);
|
|
166
160
|
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
167
|
-
var ownerName;
|
|
161
|
+
var ownerName = void 0;
|
|
162
|
+
|
|
168
163
|
if (ownerID) {
|
|
169
164
|
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
|
170
165
|
}
|
|
171
166
|
process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
|
|
172
|
-
return describeComponentFrame(name, element && element._source, ownerName);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function describeFiber(fiber) {
|
|
176
|
-
switch (fiber.tag) {
|
|
177
|
-
case IndeterminateComponent:
|
|
178
|
-
case FunctionalComponent:
|
|
179
|
-
case ClassComponent:
|
|
180
|
-
case HostComponent:
|
|
181
|
-
var owner = fiber._debugOwner;
|
|
182
|
-
var source = fiber._debugSource;
|
|
183
|
-
var name = getComponentName(fiber);
|
|
184
|
-
var ownerName = null;
|
|
185
|
-
if (owner) {
|
|
186
|
-
ownerName = getComponentName(owner);
|
|
187
|
-
}
|
|
188
|
-
return describeComponentFrame(name, source, ownerName);
|
|
189
|
-
default:
|
|
190
|
-
return '';
|
|
191
|
-
}
|
|
167
|
+
return describeComponentFrame(name || '', element && element._source, ownerName || '');
|
|
192
168
|
}
|
|
193
169
|
|
|
194
170
|
var ReactComponentTreeHook = {
|
|
@@ -296,7 +272,7 @@ var ReactComponentTreeHook = {
|
|
|
296
272
|
var workInProgress = currentOwner;
|
|
297
273
|
// Safe because if current owner exists, we are reconciling,
|
|
298
274
|
// and it is guaranteed to be the work-in-progress version.
|
|
299
|
-
info +=
|
|
275
|
+
info += getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
300
276
|
} else if (typeof currentOwner._debugID === 'number') {
|
|
301
277
|
info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
|
|
302
278
|
}
|
|
@@ -311,21 +287,6 @@ var ReactComponentTreeHook = {
|
|
|
311
287
|
}
|
|
312
288
|
return info;
|
|
313
289
|
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
// This function can only be called with a work-in-progress fiber and
|
|
317
|
-
// only during begin or complete phase. Do not call it under any other
|
|
318
|
-
// circumstances.
|
|
319
|
-
getStackAddendumByWorkInProgressFiber: function (workInProgress) {
|
|
320
|
-
var info = '';
|
|
321
|
-
var node = workInProgress;
|
|
322
|
-
do {
|
|
323
|
-
info += describeFiber(node);
|
|
324
|
-
// Otherwise this return pointer might point to the wrong tree:
|
|
325
|
-
node = node['return'];
|
|
326
|
-
} while (node);
|
|
327
|
-
return info;
|
|
328
|
-
},
|
|
329
290
|
getChildIDs: function (id) {
|
|
330
291
|
var item = getItem(id);
|
|
331
292
|
return item ? item.childIDs : [];
|
|
@@ -16,9 +16,11 @@ var ReactDebugCurrentFrame = {};
|
|
|
16
16
|
if (process.env.NODE_ENV !== 'production') {
|
|
17
17
|
var _require = require('./ReactComponentTreeHook'),
|
|
18
18
|
getStackAddendumByID = _require.getStackAddendumByID,
|
|
19
|
-
getStackAddendumByWorkInProgressFiber = _require.getStackAddendumByWorkInProgressFiber,
|
|
20
19
|
getCurrentStackAddendum = _require.getCurrentStackAddendum;
|
|
21
20
|
|
|
21
|
+
var _require2 = require('./ReactFiberComponentTreeHook'),
|
|
22
|
+
getStackAddendumByWorkInProgressFiber = _require2.getStackAddendumByWorkInProgressFiber;
|
|
23
|
+
|
|
22
24
|
// Component that is being worked on
|
|
23
25
|
|
|
24
26
|
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
21
|
-
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
22
21
|
var ReactElement = require('./ReactElement');
|
|
23
22
|
|
|
24
23
|
var checkReactTypeSpec = require('./checkReactTypeSpec');
|
|
@@ -30,6 +29,9 @@ var getIteratorFn = require('./getIteratorFn');
|
|
|
30
29
|
if (process.env.NODE_ENV !== 'production') {
|
|
31
30
|
var warning = require('fbjs/lib/warning');
|
|
32
31
|
var ReactDebugCurrentFrame = require('./ReactDebugCurrentFrame');
|
|
32
|
+
|
|
33
|
+
var _require = require('./ReactComponentTreeHook'),
|
|
34
|
+
getCurrentStackAddendum = _require.getCurrentStackAddendum;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
function getDeclarationErrorAddendum() {
|
|
@@ -105,7 +107,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
105
107
|
childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner,
|
|
110
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getCurrentStackAddendum(element)) : void 0;
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
/**
|
|
@@ -189,7 +191,7 @@ var ReactElementValidator = {
|
|
|
189
191
|
info += getDeclarationErrorAddendum();
|
|
190
192
|
}
|
|
191
193
|
|
|
192
|
-
info +=
|
|
194
|
+
info += getCurrentStackAddendum();
|
|
193
195
|
|
|
194
196
|
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
|
|
195
197
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2016-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
15
|
+
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
16
|
+
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
17
|
+
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
18
|
+
HostComponent = ReactTypeOfWork.HostComponent;
|
|
19
|
+
|
|
20
|
+
var getComponentName = require('./getComponentName');
|
|
21
|
+
|
|
22
|
+
function describeComponentFrame(name, source, ownerName) {
|
|
23
|
+
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function describeFiber(fiber) {
|
|
27
|
+
switch (fiber.tag) {
|
|
28
|
+
case IndeterminateComponent:
|
|
29
|
+
case FunctionalComponent:
|
|
30
|
+
case ClassComponent:
|
|
31
|
+
case HostComponent:
|
|
32
|
+
var owner = fiber._debugOwner;
|
|
33
|
+
var source = fiber._debugSource;
|
|
34
|
+
var name = getComponentName(fiber);
|
|
35
|
+
var ownerName = null;
|
|
36
|
+
if (owner) {
|
|
37
|
+
ownerName = getComponentName(owner);
|
|
38
|
+
}
|
|
39
|
+
return describeComponentFrame(name, source, ownerName);
|
|
40
|
+
default:
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// This function can only be called with a work-in-progress fiber and
|
|
46
|
+
// only during begin or complete phase. Do not call it under any other
|
|
47
|
+
// circumstances.
|
|
48
|
+
function getStackAddendumByWorkInProgressFiber(workInProgress) {
|
|
49
|
+
var info = '';
|
|
50
|
+
var node = workInProgress;
|
|
51
|
+
do {
|
|
52
|
+
info += describeFiber(node);
|
|
53
|
+
// Otherwise this return pointer might point to the wrong tree:
|
|
54
|
+
node = node['return'];
|
|
55
|
+
} while (node);
|
|
56
|
+
return info;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = {
|
|
60
|
+
getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber,
|
|
61
|
+
describeComponentFrame: describeComponentFrame
|
|
62
|
+
};
|
package/lib/ReactPropTypes.js
CHANGED
|
@@ -94,7 +94,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
94
94
|
};
|
|
95
95
|
} else {
|
|
96
96
|
var productionTypeChecker = function () {
|
|
97
|
-
invariant(false, 'React.PropTypes type checking code is stripped in production.');
|
|
97
|
+
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.PropTypes type checking code is stripped in production.') : _prodInvariant('144') : void 0;
|
|
98
98
|
};
|
|
99
99
|
productionTypeChecker.isRequired = productionTypeChecker;
|
|
100
100
|
var getProductionTypeChecker = function () {
|
package/lib/ReactVersion.js
CHANGED
|
@@ -129,7 +129,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
var childrenString =
|
|
132
|
+
var childrenString = '' + children;
|
|
133
133
|
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
|
|
134
134
|
}
|
|
135
135
|
}
|
package/lib/update.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
|
|
15
|
+
var _assign = require('object-assign'),
|
|
16
|
+
_prodInvariant = require('./reactProdInvariant');
|
|
17
17
|
|
|
18
18
|
var invariant = require('fbjs/lib/invariant');
|
|
19
19
|
var hasOwnProperty = {}.hasOwnProperty;
|
package/package.json
CHANGED
package/lib/ReactStateSetters.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
var ReactStateSetters = {
|
|
14
|
-
/**
|
|
15
|
-
* Returns a function that calls the provided function, and uses the result
|
|
16
|
-
* of that to set the component's state.
|
|
17
|
-
*
|
|
18
|
-
* @param {ReactCompositeComponent} component
|
|
19
|
-
* @param {function} funcReturningState Returned callback uses this to
|
|
20
|
-
* determine how to update state.
|
|
21
|
-
* @return {function} callback that when invoked uses funcReturningState to
|
|
22
|
-
* determined the object literal to setState.
|
|
23
|
-
*/
|
|
24
|
-
createStateSetter: function (component, funcReturningState) {
|
|
25
|
-
return function (a, b, c, d, e, f) {
|
|
26
|
-
var partialState = funcReturningState.call(component, a, b, c, d, e, f);
|
|
27
|
-
if (partialState) {
|
|
28
|
-
component.setState(partialState);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Returns a single-argument callback that can be used to update a single
|
|
35
|
-
* key in the component's state.
|
|
36
|
-
*
|
|
37
|
-
* Note: this is memoized function, which makes it inexpensive to call.
|
|
38
|
-
*
|
|
39
|
-
* @param {ReactCompositeComponent} component
|
|
40
|
-
* @param {string} key The key in the state that you should update.
|
|
41
|
-
* @return {function} callback of 1 argument which calls setState() with
|
|
42
|
-
* the provided keyName and callback argument.
|
|
43
|
-
*/
|
|
44
|
-
createStateKeySetter: function (component, key) {
|
|
45
|
-
// Memoize the setters.
|
|
46
|
-
var cache = component.__keySetters || (component.__keySetters = {});
|
|
47
|
-
return cache[key] || (cache[key] = createStateKeySetter(component, key));
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function createStateKeySetter(component, key) {
|
|
52
|
-
// Partial state is allocated outside of the function closure so it can be
|
|
53
|
-
// reused with every call, avoiding memory allocation when this function
|
|
54
|
-
// is called.
|
|
55
|
-
var partialState = {};
|
|
56
|
-
return function stateKeySetter(value) {
|
|
57
|
-
partialState[key] = value;
|
|
58
|
-
component.setState(partialState);
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ReactStateSetters.Mixin = {
|
|
63
|
-
/**
|
|
64
|
-
* Returns a function that calls the provided function, and uses the result
|
|
65
|
-
* of that to set the component's state.
|
|
66
|
-
*
|
|
67
|
-
* For example, these statements are equivalent:
|
|
68
|
-
*
|
|
69
|
-
* this.setState({x: 1});
|
|
70
|
-
* this.createStateSetter(function(xValue) {
|
|
71
|
-
* return {x: xValue};
|
|
72
|
-
* })(1);
|
|
73
|
-
*
|
|
74
|
-
* @param {function} funcReturningState Returned callback uses this to
|
|
75
|
-
* determine how to update state.
|
|
76
|
-
* @return {function} callback that when invoked uses funcReturningState to
|
|
77
|
-
* determined the object literal to setState.
|
|
78
|
-
*/
|
|
79
|
-
createStateSetter: function (funcReturningState) {
|
|
80
|
-
return ReactStateSetters.createStateSetter(this, funcReturningState);
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Returns a single-argument callback that can be used to update a single
|
|
85
|
-
* key in the component's state.
|
|
86
|
-
*
|
|
87
|
-
* For example, these statements are equivalent:
|
|
88
|
-
*
|
|
89
|
-
* this.setState({x: 1});
|
|
90
|
-
* this.createStateKeySetter('x')(1);
|
|
91
|
-
*
|
|
92
|
-
* Note: this is memoized function, which makes it inexpensive to call.
|
|
93
|
-
*
|
|
94
|
-
* @param {string} key The key in the state that you should update.
|
|
95
|
-
* @return {function} callback of 1 argument which calls setState() with
|
|
96
|
-
* the provided keyName and callback argument.
|
|
97
|
-
*/
|
|
98
|
-
createStateKeySetter: function (key) {
|
|
99
|
-
return ReactStateSetters.createStateKeySetter(this, key);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
module.exports = ReactStateSetters;
|
package/lib/sliceChildren.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
var ReactChildren = require('./ReactChildren');
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Slice children that are typically specified as `props.children`. This version
|
|
17
|
-
* of slice children ignores empty child components.
|
|
18
|
-
*
|
|
19
|
-
* @param {*} children The children set to filter.
|
|
20
|
-
* @param {number} start The first zero-based index to include in the subset.
|
|
21
|
-
* @param {?number} end The non-inclusive last index of the subset.
|
|
22
|
-
* @return {object} mirrored array with mapped children
|
|
23
|
-
*/
|
|
24
|
-
function sliceChildren(children, start, end) {
|
|
25
|
-
if (children == null) {
|
|
26
|
-
return children;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var array = ReactChildren.toArray(children);
|
|
30
|
-
return array.slice(start, end);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = sliceChildren;
|