From ed73326cc3c9146b419c75a9a35523552ed17568 Mon Sep 17 00:00:00 2001 From: fang Date: Sat, 12 Dec 2020 00:44:59 +0100 Subject: [PATCH 01/13] debug: render queued ames acks correctly Wrap the items in a SearchableList instead of throwing the objects into the DOM directly. --- pkg/arvo/app/debug/js/index.js | 2 +- pkg/interface/dbug/src/js/views/ames.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/app/debug/js/index.js b/pkg/arvo/app/debug/js/index.js index 1d5335d219..d972baa8fc 100644 --- a/pkg/arvo/app/debug/js/index.js +++ b/pkg/arvo/app/debug/js/index.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("buffer")):"function"==typeof define&&define.amd?define("index",["buffer"],t):t((e=e||self).buffer)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n=t.performance||{},r=(n.now||n.mozNow||n.msNow||n.oNow||n.webkitNow,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function i(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var c=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o2?n-2:0),i=2;i1?t-1:0),r=1;r2?n-2:0),i=2;i8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var o=r.map(function(e){return""+e});o.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,o)}try{var a=0,l="Warning: "+t.replace(/%s/g,function(){return r[a++]});throw new Error(l)}catch(e){}}},M={};function N(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+t;M[i]||(C(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),M[i]=!0)}var P={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){N(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){N(e,"replaceState")},enqueueSetState:function(e,t,n,r){N(e,"setState")}},R={};function O(e,t,n){this.props=e,this.context=t,this.refs=R,this.updater=n||P}Object.freeze(R),O.prototype.isReactComponent={},O.prototype.setState=function(e,t){!function(){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw T(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."))}(),this.updater.enqueueSetState(this,e,t,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},A=function(e,t){Object.defineProperty(O.prototype,e,{get:function(){S(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var I in D)D.hasOwnProperty(I)&&A(I,D[I]);function U(){}function j(e,t,n){this.props=e,this.context=t,this.refs=R,this.updater=n||P}U.prototype=O.prototype;var z=j.prototype=new U;z.constructor=j,t(z,O.prototype),z.isPureReactComponent=!0;var L={current:null},F={suspense:null},W={current:null},B=/^(.*)[\\\/]/,Y=1;function H(e){if(null==e)return null;if("number"==typeof e.tag&&C(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case o:return"Portal";case u:return"Profiler";case l:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case f:return"Context.Consumer";case s:return"Context.Provider";case h:return r=e,i=e.render,c="ForwardRef",d=i.displayName||i.name||"",r.displayName||(""!==d?c+"("+d+")":c);case g:return H(e.type);case v:var t=(n=e)._status===Y?n._result:null;if(t)return H(t)}var n,r,i,c,d;return null}var $={},V=null;function q(e){V=e}$.getCurrentStack=null,$.getStackAddendum=function(){var e="";if(V){var t=H(V.type),n=V._owner;e+=function(e,t,n){var r="";if(t){var i=t.fileName,o=i.replace(B,"");if(/^index\./.test(o)){var a=i.match(B);if(a){var l=a[1];l&&(o=l.replace(B,"")+"/"+o)}}r=" (at "+o+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,V._source,n&&H(n.type))}var r=$.getCurrentStack;return r&&(e+=r()||""),e};var G={ReactCurrentDispatcher:L,ReactCurrentBatchConfig:F,ReactCurrentOwner:W,IsSomeRendererActing:{current:!1},assign:t};t(G,{ReactDebugCurrentFrame:$,ReactComponentTreeHook:{}});var Q,K,Z=function(e,t){if(!e){for(var n=G.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,i=new Array(r>2?r-2:0),o=2;o1){for(var c=Array(s),f=0;f.")}return t}(t);if(!xe[n]){xe[n]=!0;var r="";e&&e._owner&&e._owner!==W.current&&(r=" It was passed a child from "+H(e._owner.type)+"."),q(e),Z(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),q(null)}}}function Te(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",u=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,Z(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,u)}var f=re.apply(this,arguments);if(null==f)return f;if(l)for(var d=2;d is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,Z(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===g?C(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?C(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&C(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&C(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:h,render:e}},lazy:function(e){var t,n,r={$$typeof:v,_ctor:e,_status:-1,_result:null};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){Z(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){Z(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},memo:function(e,t){return _e(e)||C(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:g,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return we().useCallback(e,t)},useContext:function(e,t){var n=we();if(void 0!==t&&Z(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?Z(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&Z(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return we().useEffect(e,t)},useImperativeHandle:function(e,t,n){return we().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return we().useDebugValue(e,t)},useLayoutEffect:function(e,t){return we().useLayoutEffect(e,t)},useMemo:function(e,t){return we().useMemo(e,t)},useReducer:function(e,t,n){return we().useReducer(e,t,n)},useRef:function(e){return we().useRef(e)},useState:function(e){return we().useState(e)},Fragment:a,Profiler:u,StrictMode:l,Suspense:p,unstable_SuspenseList:m,createElement:Ce,cloneElement:function(e,n,r){for(var i=function(e,n,r){var i;!function(){if(null==e)throw T(Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+"."))}();var o,a=t({},e.props),l=e.key,u=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=n)for(i in ee(n)&&(u=n.ref,f=W.current),te(n)&&(l=""+n.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),n)X.call(n,i)&&!J.hasOwnProperty(i)&&(void 0===n[i]&&void 0!==o?a[i]=o[i]:a[i]=n[i]);var d=arguments.length-2;if(1===d)a.children=r;else if(d>1){for(var h=Array(d),p=0;p=k},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125M(a,n))void 0!==u&&0>M(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>M(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function M(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var N=[],P=[],R=1,O=null,D=3,A=!1,I=!1,U=!1;function j(e){for(var t=S(P);null!==t;){if(null===t.callback)C(P);else{if(!(t.startTime<=e))break;C(P),t.sortIndex=t.expirationTime,T(N,t)}t=S(P)}}function z(e){if(U=!1,j(e),!I)if(null!==S(N))I=!0,n(L);else{var t=S(P);null!==t&&r(z,t.startTime-e)}}function L(e,n){I=!1,U&&(U=!1,i()),A=!0;var a=D;try{for(j(n),O=S(N);null!==O&&(!(O.expirationTime>n)||e&&!o());){var l=O.callback;if(null!==l){O.callback=null,D=O.priorityLevel;var u=l(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?O.callback=u:O===S(N)&&C(N),j(n)}else C(N);O=S(N)}if(null!==O)var s=!0;else{var c=S(P);null!==c&&r(z,c.startTime-n),s=!1}return s}finally{O=null,D=a,A=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=a;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},t.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},t.unstable_scheduleCallback=function(e,o,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0l?(e.sortIndex=u,T(P,e),null===S(N)&&e===S(P)&&(U?i():U=!0,r(z,u-l))):(e.sortIndex=a,T(N,e),I||A||(I=!0,n(L))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=D;return function(){var n=D;D=t;try{return e.apply(this,arguments)}finally{D=n}}},t.unstable_getCurrentPriorityLevel=function(){return D},t.unstable_shouldYield=function(){var e=t.unstable_now();j(e);var n=S(N);return n!==O&&null!==O&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=x},o=function(){},t.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):k=e>0?Math.floor(1e3/e):33.33};var E=new MessageChannel,T=E.port2;E.port1.onmessage=function(){if(null!==_){var e=t.unstable_now();x=e+k;try{_(!0,e)?T.postMessage(null):(b=!1,_=null)}catch(e){throw T.postMessage(null),e}}else b=!1},e=function(e){_=e,b||(b=!0,T.postMessage(null))},n=function(e,n){w=p(function(){e(t.unstable_now())},n)},r=function(){m(w),w=-1}}function S(e,t){var n=e.length;e.push(t),function(e,t,n){var r=n;for(;;){var i=Math.floor((r-1)/2),o=e[i];if(!(void 0!==o&&N(o,t)>0))return;e[i]=t,e[r]=o,r=i}}(e,t,n)}function C(e){var t=e[0];return void 0===t?null:t}function M(e){var t=e[0];if(void 0!==t){var n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){var r=n,i=e.length;for(;rV){if((V*=2)>$)return console.error("Scheduler Profiling: Event log exceeded maximum size. Don't forget to call `stopLoggingProfilingEvents()`."),void oe();var n=new Int32Array(4*V);n.set(G),q=n.buffer,G=n}G.set(e,t)}}function oe(){var e=q;return V=0,q=null,G=null,Q=0,e}function ae(e,t){L[Y]++,null!==G&&ie([K,t,e.id,e.priorityLevel])}function le(e,t){L[F]=P,L[W]=0,L[Y]--,null!==G&&ie([Z,t,e.id])}function ue(e,t){L[F]=P,L[W]=0,L[B]=0,null!==G&&ie([te,t,e.id,U])}var se=-1,ce=250,fe=5e3,de=1e4,he=1073741823,pe=[],me=[],ge=1,ve=null,ye=D,be=!1,_e=!1,we=!1;function ke(e){for(var t=C(me);null!==t;){if(null===t.callback)M(me);else{if(!(t.startTime<=e))return;M(me),t.sortIndex=t.expirationTime,S(pe,t),ae(t,e),t.isQueued=!0}t=C(me)}}function xe(t){if(we=!1,ke(t),!_e)if(null!==C(pe))_e=!0,e(Ee);else{var r=C(me);null!==r&&n(xe,r.startTime-t)}}function Ee(e,n){var i;i=n,null!==G&&ie([re,i,j]),_e=!1,we&&(we=!1,r()),be=!0;var o=ye;try{if(!l)return Te(e,n);try{return Te(e,n)}catch(e){if(null!==ve){var a=t.unstable_now();!function(e,t){L[F]=P,L[W]=0,L[Y]--,null!==G&&ie([X,t,e.id])}(ve,a),ve.isQueued=!1}throw e}}finally{ve=null,ye=o,be=!1,function(e){j++,null!==G&&ie([ne,e,j])}(t.unstable_now())}}function Te(e,r){var o,l,u=r;for(ke(u),ve=C(pe);null!==ve&&!a&&(!(ve.expirationTime>u)||e&&!i());){var s=ve.callback;if(null!==s){ve.callback=null,ye=ve.priorityLevel;var c=ve.expirationTime<=u;o=ve,l=u,U++,L[F]=o.priorityLevel,L[W]=o.id,L[B]=U,null!==G&&ie([ee,l,o.id,U]);var f=s(c);u=t.unstable_now(),"function"==typeof f?(ve.callback=f,ue(ve,u)):(le(ve,u),ve.isQueued=!1,ve===C(pe)&&M(pe)),ke(u)}else M(pe);ve=C(pe)}if(null!==ve)return!0;var d=C(me);return null!==d&&n(xe,d.startTime-u),!1}function Se(e){switch(e){case R:return se;case O:return ce;case I:return he;case A:return de;case D:default:return fe}}var Ce=o,Me={startLoggingProfilingEvents:function(){V=H,q=new ArrayBuffer(4*V),G=new Int32Array(q),Q=0},stopLoggingProfilingEvents:oe,sharedProfilingBuffer:z};t.unstable_ImmediatePriority=R,t.unstable_UserBlockingPriority=O,t.unstable_NormalPriority=D,t.unstable_IdlePriority=I,t.unstable_LowPriority=A,t.unstable_runWithPriority=function(e,t){switch(e){case R:case O:case D:case A:case I:break;default:e=D}var n=ye;ye=e;try{return t()}finally{ye=n}},t.unstable_next=function(e){var t;switch(ye){case R:case O:case D:t=D;break;default:t=ye}var n=ye;ye=t;try{return e()}finally{ye=n}},t.unstable_scheduleCallback=function(i,o,a){var l,u,s=t.unstable_now();if("object"==typeof a&&null!==a){var c=a.delay;l="number"==typeof c&&c>0?s+c:s,u="number"==typeof a.timeout?a.timeout:Se(i)}else u=Se(i),l=s;var f=l+u,d={id:ge++,callback:o,priorityLevel:i,startTime:l,expirationTime:f,sortIndex:-1,isQueued:!1};return l>s?(d.sortIndex=l,S(me,d),null===C(pe)&&d===C(me)&&(we?r():we=!0,n(xe,l-s))):(d.sortIndex=f,S(pe,d),ae(d,s),d.isQueued=!0,_e||be||(_e=!0,e(Ee))),d},t.unstable_cancelCallback=function(e){e.isQueued&&(function(e,t){L[Y]--,null!==G&&ie([J,t,e.id])}(e,t.unstable_now()),e.isQueued=!1),e.callback=null},t.unstable_wrapCallback=function(e){var t=ye;return function(){var n=ye;ye=t;try{return e.apply(this,arguments)}finally{ye=n}}},t.unstable_getCurrentPriorityLevel=function(){return ye},t.unstable_shouldYield=function(){var e=t.unstable_now();ke(e);var n=C(pe);return n!==ve&&null!==ve&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime