Comparing version 2.8.1 to 2.8.2
@@ -224,5 +224,3 @@ (function (global, factory) { | ||
function render(vnode, parent) { | ||
var merge = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; | ||
function render(vnode, parent, merge) { | ||
var existing = merge && merge._component && merge._componentConstructor === vnode.nodeName, | ||
@@ -506,4 +504,5 @@ built = build(merge, vnode), | ||
unmountComponent(dom, c); | ||
dom = null; | ||
} | ||
dom = createComponentFromVNode(vnode); | ||
dom = createComponentFromVNode(vnode, dom); | ||
} | ||
@@ -518,5 +517,6 @@ | ||
*/ | ||
function createComponentFromVNode(vnode) { | ||
function createComponentFromVNode(vnode, dom) { | ||
var props = getNodeProps(vnode); | ||
var component = componentRecycler.create(vnode.nodeName, props); | ||
if (dom) component.base = dom; | ||
setComponentProps(component, props, NO_RENDER); | ||
@@ -523,0 +523,0 @@ renderComponent(component, DOM_RENDER); |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.preact={})}(this,function(e){"use strict";function n(e,n){var t=arguments.length<=2||void 0===arguments[2]?null:arguments[2],o=t&&t._component&&t._componentConstructor===e.nodeName,i=h(t,e),a=!o&&i._component;return a&&r(a,"componentWillMount"),h.parentNode!==n&&n.appendChild(i),a&&r(a,"componentDidMount"),i}function t(e,n){for(var t=arguments.length,r=Array(t>2?t-2:0),c=2;t>c;c++)r[c-2]=arguments[c];var s=void 0,l=[],u=r.length,d=void 0,p=void 0;if(u){s=[];for(var f=0;u>f;f++){var m=r[f];if(!a(m)){m.join?d=m:(d=l,d[0]=m);for(var v=0;v<d.length;v++){var h=d[v],y=!a(h)&&!i(h);y&&(h=String(h)),y&&p?s[s.length-1]+=h:a(h)||s.push(h),p=y}}}}n&&n.children&&delete n.children;var g=new H(e,n||void 0,s||void 0);return o($,"vnode",g),g}function o(e,n){for(var t=e[n],o=arguments.length,r=Array(o>2?o-2:0),i=2;o>i;i++)r[i-2]=arguments[i];return t&&"function"==typeof t?t.apply(e,r):void 0}function r(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];do o.apply(void 0,[e].concat(t));while(e=e._component)}function i(e){return e&&e.__isVNode===!0}function a(e){return null===e||void 0===e}function c(e,n){if(3===e.nodeType)return"string"==typeof n;if(s(n))return!0;var t=n.nodeName;return"function"==typeof t?e._componentConstructor===t:e.nodeName.toLowerCase()===t}function s(e){var n=e.nodeName;return"function"==typeof n&&!n.prototype.render}function l(e){return e.nodeName(w(e))||M}function u(e){e._dirty||(e._dirty=!0,Z.add(e))}function d(e,n){var t=arguments.length<=2||void 0===arguments[2]?W:arguments[2],r=e._disableRendering;e._disableRendering=!0,o(e,"componentWillReceiveProps",n,e.props),e.nextProps=n,e._disableRendering=r,t.render!==!1&&(t.renderSync||G.syncComponentUpdates?p(e):u(e))}function p(e,n){if(!e._disableRendering){e._dirty=!1;var t=e.nextProps,i=e.state;if(e.base){if(o(e,"shouldComponentUpdate",t,i)===!1)return void(e.props=t);o(e,"componentWillUpdate",t,i)}e.props=t;var a=o(e,"render",t,i),c=a&&a.nodeName,s=void 0;if("function"==typeof c&&c.prototype.render){var l=e._component;l&&l.constructor!==c&&(v(l.base,l,!1),l=null);var u=w(a);l?d(l,u,R):(l=K.create(c,u),l._parentComponent=e,e._component=l,e.base&&r(l,"componentWillMount"),d(l,u,A),p(l,z),e.base&&r(l,"componentDidMount")),s=l.base}else e._component&&v(e.base,e._component),e._component=null,(e.base||n&&n.build)&&(s=h(e.base,a||M,e));if(e.base&&s!==e.base){var f=e.base.parentNode;f&&f.replaceChild(s,e.base)}return e.base=s,s&&(s._component=e,s._componentConstructor=e.constructor),o(e,"componentDidUpdate",t,i),a}}function f(e,n){var t=e&&e._component;if(s(n)){var o=h(e,l(n));return o._componentConstructor=n.nodeName,o}for(var r=t&&e._componentConstructor===n.nodeName;t&&!r&&(t=t._parentComponent);)r=t.constructor===n.nodeName;return r?d(t,w(n),R):(t&&v(e,t),e=m(n)),e}function m(e){var n=w(e),t=K.create(e.nodeName,n);return d(t,n,A),p(t,z),t.base}function v(e,n,t){if(o(n,"componentWillUnmount"),t!==!1){e._component===n&&(delete e._component,delete e._componentConstructor);var r=n.base;r&&r.parentNode&&r.parentNode.removeChild(r)}n._parentComponent=null,o(n,"componentDidUnmount"),K.collect(n)}function h(e,n){var t=e,i=n.nodeName;if("function"!=typeof i||i.prototype.render||(n=l(n),i=n.nodeName),"function"==typeof i)return f(e,n);if("string"==typeof n){if(e){if(3===e.nodeType)return e[L]=n,e;1===e.nodeType&&J.collect(e)}return document.createTextNode(n)}(null===i||void 0===i)&&(i="x-undefined-element"),e?e.nodeName.toLowerCase()!==i&&(t=J.create(i),g(t,V(e.childNodes)),1===e.nodeType&&J.collect(e)):t=J.create(i);var a=x(t)||W,s=n.attributes||W;if(a!==W)for(var u in a)if(E.call(a,u)){var d=s[u];(void 0===d||null===d)&&b(t,u,null,a[u])}if(s!==W)for(var p in s)if(E.call(s,p)){var m=s[p];if(void 0!==m&&null!==m){var v=_(t,p,a[p]);m!=v&&b(t,p,m,v)}}for(var y=V(t.childNodes),C={},N=y.length;N--;){var k=y[N].nodeType,w=void 0;if(3===k)w=k.key;else{if(1!==k)continue;w=y[N].getAttribute("key")}w&&(C[w]=y.splice(N,1)[0])}var T=[];if(n.children)for(var N=0,S=n.children.length;S>N;N++){var U=n.children[N],D=U.attributes,w=void 0,O=void 0;if(D&&(w=D.key,O=w&&C[w]),!O){var P=y.length;if(y.length)for(var A=0;P>A;A++)if(c(y[A],U)){O=y.splice(A,1)[0];break}}T.push(h(O,U))}for(var N=0,P=T.length;P>N;N++)if(t.childNodes[N]!==T[N]){var O=T[N],R=O._component,z=t.childNodes[N+1];R&&r(R,"componentWillMount"),z?t.insertBefore(O,z):t.appendChild(O),R&&r(R,"componentDidMount")}for(var N=0,P=y.length;P>N;N++){var O=y[N],R=O._component;R&&o(R,"componentWillUnmount"),O.parentNode.removeChild(O),R?(o(R,"componentDidUnmount"),K.collect(R)):1===O.nodeType&&J.collect(O)}return t}function y(e,n,t){var o=n.split("."),r=o[0];return function(n){var i,c=this,s=e.state,l=void 0,u=void 0;for("string"==typeof t?(l=I(n,t),a(l)&&(c=c._component)&&(l=I(c,t))):l=(c.nodeName+c.type).match(/^input(checkbox|radio)$/i)?c.checked:c.value,"function"==typeof l&&(l=l.call(c)),u=0;u<o.length-1;u++)s=s[o[u]]||{};s[o[u]]=l,e.setState((i={},i[r]=e.state[r],i))}}function g(e,n){var t=n.length;if(2>=t)return e.appendChild(n[0]),void(2===t&&e.appendChild(n[1]));for(var o=document.createDocumentFragment(),r=0;t>r;r++)o.appendChild(n[r]);e.appendChild(o)}function _(e,n,t){var o=""+O+n;return"type"!==n&&n in e?e[n]:"class"===n?e.className:"style"===n?e.style.cssText:E.call(e,o)?e[o]:t}function b(e,n,t){"class"===n?e.className=t:"style"===n?e.style.cssText=t:n in e&&"type"!==n?e[n]=t:C(e,n,t),e[""+O+n]=_(e,n,t)}function C(e,n,t){if("on"===n.substring(0,2)){var o=Q(n),r=e._listeners||(e._listeners={});return r[o]||e.addEventListener(o,N),void(r[o]=t)}var i=typeof t;null===t?e.removeAttribute(n):"function"!==i&&"object"!==i&&e.setAttribute(n,t)}function N(e){var n=this._listeners[Q(e.type)];return n?n.call(this,o($,"event",e)||e):void 0}function x(e){var n=e.attributes;return n&&n.getNamedItem?n.length?k(n):void 0:n}function k(e){for(var n={},t=e.length;t--;){var o=e[t];n[o.name]=o.value}return n}function w(e){var n=U({},e.attributes);return e.children&&(n.children=e.children),n}function T(e){var n="",t=": ",o="; ";for(var r in e)if(E.call(e,r)){var i=e[r];n+=X(r),n+=t,n+=i,"number"!=typeof i||E.call(j,r)||(n+="px"),n+=o}return n}function S(e){var n="";for(var t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function U(e,n){for(var t in n)E.call(n,t)&&(e[t]=n[t]);return e}var D={};D.classCallCheck=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")};var O="__preactattr_",P="undefined"!=typeof document,W={},A={render:!1},R={renderSync:!0},z={build:!0},M="",L=!P||"textContent"in document?"textContent":"nodeValue",j={boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1},V=function(e){for(var n=[],t=e.length;t--;)n[t]=e[t];return n},E=Object.prototype.hasOwnProperty,F=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return function(t){return E.call(n,t)?n[t]:n[t]=e(t)}},I=function(e,n){return n.split(".").map(function(n){return e=e&&e[n]}),e},G={syncComponentUpdates:!0},$={vnode:function(e){var n=e.attributes;if(n){var t=n.style;t&&!t.substring&&(n.style=T(t));var o=n["class"];E.call(n,"className")&&(o=n["class"]=n.className,delete n.className),o&&!o.substring&&(n["class"]=S(o))}}},B=function(){function e(){D.classCallCheck(this,e),this._dirty=this._disableRendering=!1,this._linkedStates={},this.nextProps=this.base=null,this.props=o(this,"getDefaultProps")||{},this.state=o(this,"getInitialState")||{},o(this,"initialize")}return e.prototype.linkState=function(e,n){var t=this._linkedStates,o=e+"|"+(n||"");return t[o]||(t[o]=y(this,e,n))},e.prototype.setState=function(e){U(this.state,e),u(this)},e.prototype.setProps=function(e,n){return d(this,e,n)},e.prototype.render=function(e){return t("div",null,e.children)},e}(),H=function ee(e,n,t){D.classCallCheck(this,ee),this.nodeName=e,this.attributes=n,this.children=t};H.prototype.__isVNode=!0;var Z={items:[],itemsOffline:[],add:function(e){if(1===Z.items.push(e)){var n=$.debounceRendering;n?n(Z.process):setTimeout(Z.process,0)}},process:function(){var e=Z.items,n=e.length;if(n)for(Z.items=Z.itemsOffline,Z.items.length=0,Z.itemsOffline=e;n--;)e[n]._dirty&&p(e[n])}},q=Z.process,J={nodes:{},normalizeName:F(function(e){return e.toUpperCase()}),collect:function(e){J.clean(e);var n=J.normalizeName(e.nodeName),t=J.nodes[n];t?t.push(e):J.nodes[n]=[e]},create:function(e){var n=J.normalizeName(e),t=J.nodes[n];return t&&t.pop()||document.createElement(e)},clean:function(e){if(e.parentNode&&e.parentNode.removeChild(e),3!==e.nodeType){delete e._component,delete e._componentConstructor;var n=O.length;for(var t in e)0===t.indexOf(O)&&b(e,t.substring(n),null,e[t])}}},K={components:{},collect:function(e){var n=e.constructor.name,t=K.components[n];t?t.push(e):K.components[n]=[e]},create:function(e,n){var t=K.components[e.name];if(t&&t.length)for(var o=t.length;o--;)if(t[o].constructor===e)return t.splice(o,1)[0];return new e(n)}},Q=F(function(e){return e.replace(/^on/i,"").toLowerCase()}),X=F(function(e){return e.replace(/([A-Z])/,"-$1").toLowerCase()}),Y={options:G,hooks:$,render:n,rerender:q,h:t,Component:B};e.render=n,e.h=t,e.Component=B,e.VNode=H,e.options=G,e.hooks=$,e.rerender=q,e["default"]=Y}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.preact={})}(this,function(e){"use strict";function n(e,n,t){var o=t&&t._component&&t._componentConstructor===e.nodeName,i=h(t,e),a=!o&&i._component;return a&&r(a,"componentWillMount"),h.parentNode!==n&&n.appendChild(i),a&&r(a,"componentDidMount"),i}function t(e,n){for(var t=arguments.length,r=Array(t>2?t-2:0),c=2;t>c;c++)r[c-2]=arguments[c];var s=void 0,l=[],u=r.length,d=void 0,p=void 0;if(u){s=[];for(var f=0;u>f;f++){var m=r[f];if(!a(m)){m.join?d=m:(d=l,d[0]=m);for(var v=0;v<d.length;v++){var h=d[v],y=!a(h)&&!i(h);y&&(h=String(h)),y&&p?s[s.length-1]+=h:a(h)||s.push(h),p=y}}}}n&&n.children&&delete n.children;var g=new H(e,n||void 0,s||void 0);return o($,"vnode",g),g}function o(e,n){for(var t=e[n],o=arguments.length,r=Array(o>2?o-2:0),i=2;o>i;i++)r[i-2]=arguments[i];return t&&"function"==typeof t?t.apply(e,r):void 0}function r(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];do o.apply(void 0,[e].concat(t));while(e=e._component)}function i(e){return e&&e.__isVNode===!0}function a(e){return null===e||void 0===e}function c(e,n){if(3===e.nodeType)return"string"==typeof n;if(s(n))return!0;var t=n.nodeName;return"function"==typeof t?e._componentConstructor===t:e.nodeName.toLowerCase()===t}function s(e){var n=e.nodeName;return"function"==typeof n&&!n.prototype.render}function l(e){return e.nodeName(w(e))||M}function u(e){e._dirty||(e._dirty=!0,Z.add(e))}function d(e,n){var t=arguments.length<=2||void 0===arguments[2]?W:arguments[2],r=e._disableRendering;e._disableRendering=!0,o(e,"componentWillReceiveProps",n,e.props),e.nextProps=n,e._disableRendering=r,t.render!==!1&&(t.renderSync||G.syncComponentUpdates?p(e):u(e))}function p(e,n){if(!e._disableRendering){e._dirty=!1;var t=e.nextProps,i=e.state;if(e.base){if(o(e,"shouldComponentUpdate",t,i)===!1)return void(e.props=t);o(e,"componentWillUpdate",t,i)}e.props=t;var a=o(e,"render",t,i),c=a&&a.nodeName,s=void 0;if("function"==typeof c&&c.prototype.render){var l=e._component;l&&l.constructor!==c&&(v(l.base,l,!1),l=null);var u=w(a);l?d(l,u,R):(l=K.create(c,u),l._parentComponent=e,e._component=l,e.base&&r(l,"componentWillMount"),d(l,u,A),p(l,z),e.base&&r(l,"componentDidMount")),s=l.base}else e._component&&v(e.base,e._component),e._component=null,(e.base||n&&n.build)&&(s=h(e.base,a||M,e));if(e.base&&s!==e.base){var f=e.base.parentNode;f&&f.replaceChild(s,e.base)}return e.base=s,s&&(s._component=e,s._componentConstructor=e.constructor),o(e,"componentDidUpdate",t,i),a}}function f(e,n){var t=e&&e._component;if(s(n)){var o=h(e,l(n));return o._componentConstructor=n.nodeName,o}for(var r=t&&e._componentConstructor===n.nodeName;t&&!r&&(t=t._parentComponent);)r=t.constructor===n.nodeName;return r?d(t,w(n),R):(t&&(v(e,t),e=null),e=m(n,e)),e}function m(e,n){var t=w(e),o=K.create(e.nodeName,t);return n&&(o.base=n),d(o,t,A),p(o,z),o.base}function v(e,n,t){if(o(n,"componentWillUnmount"),t!==!1){e._component===n&&(delete e._component,delete e._componentConstructor);var r=n.base;r&&r.parentNode&&r.parentNode.removeChild(r)}n._parentComponent=null,o(n,"componentDidUnmount"),K.collect(n)}function h(e,n){var t=e,i=n.nodeName;if("function"!=typeof i||i.prototype.render||(n=l(n),i=n.nodeName),"function"==typeof i)return f(e,n);if("string"==typeof n){if(e){if(3===e.nodeType)return e[L]=n,e;1===e.nodeType&&J.collect(e)}return document.createTextNode(n)}(null===i||void 0===i)&&(i="x-undefined-element"),e?e.nodeName.toLowerCase()!==i&&(t=J.create(i),g(t,V(e.childNodes)),1===e.nodeType&&J.collect(e)):t=J.create(i);var a=x(t)||W,s=n.attributes||W;if(a!==W)for(var u in a)if(E.call(a,u)){var d=s[u];(void 0===d||null===d)&&b(t,u,null,a[u])}if(s!==W)for(var p in s)if(E.call(s,p)){var m=s[p];if(void 0!==m&&null!==m){var v=_(t,p,a[p]);m!=v&&b(t,p,m,v)}}for(var y=V(t.childNodes),C={},N=y.length;N--;){var k=y[N].nodeType,w=void 0;if(3===k)w=k.key;else{if(1!==k)continue;w=y[N].getAttribute("key")}w&&(C[w]=y.splice(N,1)[0])}var T=[];if(n.children)for(var N=0,S=n.children.length;S>N;N++){var U=n.children[N],D=U.attributes,w=void 0,O=void 0;if(D&&(w=D.key,O=w&&C[w]),!O){var P=y.length;if(y.length)for(var A=0;P>A;A++)if(c(y[A],U)){O=y.splice(A,1)[0];break}}T.push(h(O,U))}for(var N=0,P=T.length;P>N;N++)if(t.childNodes[N]!==T[N]){var O=T[N],R=O._component,z=t.childNodes[N+1];R&&r(R,"componentWillMount"),z?t.insertBefore(O,z):t.appendChild(O),R&&r(R,"componentDidMount")}for(var N=0,P=y.length;P>N;N++){var O=y[N],R=O._component;R&&o(R,"componentWillUnmount"),O.parentNode.removeChild(O),R?(o(R,"componentDidUnmount"),K.collect(R)):1===O.nodeType&&J.collect(O)}return t}function y(e,n,t){var o=n.split("."),r=o[0];return function(n){var i,c=this,s=e.state,l=void 0,u=void 0;for("string"==typeof t?(l=I(n,t),a(l)&&(c=c._component)&&(l=I(c,t))):l=(c.nodeName+c.type).match(/^input(checkbox|radio)$/i)?c.checked:c.value,"function"==typeof l&&(l=l.call(c)),u=0;u<o.length-1;u++)s=s[o[u]]||{};s[o[u]]=l,e.setState((i={},i[r]=e.state[r],i))}}function g(e,n){var t=n.length;if(2>=t)return e.appendChild(n[0]),void(2===t&&e.appendChild(n[1]));for(var o=document.createDocumentFragment(),r=0;t>r;r++)o.appendChild(n[r]);e.appendChild(o)}function _(e,n,t){var o=""+O+n;return"type"!==n&&n in e?e[n]:"class"===n?e.className:"style"===n?e.style.cssText:E.call(e,o)?e[o]:t}function b(e,n,t){"class"===n?e.className=t:"style"===n?e.style.cssText=t:n in e&&"type"!==n?e[n]=t:C(e,n,t),e[""+O+n]=_(e,n,t)}function C(e,n,t){if("on"===n.substring(0,2)){var o=Q(n),r=e._listeners||(e._listeners={});return r[o]||e.addEventListener(o,N),void(r[o]=t)}var i=typeof t;null===t?e.removeAttribute(n):"function"!==i&&"object"!==i&&e.setAttribute(n,t)}function N(e){var n=this._listeners[Q(e.type)];return n?n.call(this,o($,"event",e)||e):void 0}function x(e){var n=e.attributes;return n&&n.getNamedItem?n.length?k(n):void 0:n}function k(e){for(var n={},t=e.length;t--;){var o=e[t];n[o.name]=o.value}return n}function w(e){var n=U({},e.attributes);return e.children&&(n.children=e.children),n}function T(e){var n="",t=": ",o="; ";for(var r in e)if(E.call(e,r)){var i=e[r];n+=X(r),n+=t,n+=i,"number"!=typeof i||E.call(j,r)||(n+="px"),n+=o}return n}function S(e){var n="";for(var t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function U(e,n){for(var t in n)E.call(n,t)&&(e[t]=n[t]);return e}var D={};D.classCallCheck=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")};var O="__preactattr_",P="undefined"!=typeof document,W={},A={render:!1},R={renderSync:!0},z={build:!0},M="",L=!P||"textContent"in document?"textContent":"nodeValue",j={boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1},V=function(e){for(var n=[],t=e.length;t--;)n[t]=e[t];return n},E=Object.prototype.hasOwnProperty,F=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return function(t){return E.call(n,t)?n[t]:n[t]=e(t)}},I=function(e,n){return n.split(".").map(function(n){return e=e&&e[n]}),e},G={syncComponentUpdates:!0},$={vnode:function(e){var n=e.attributes;if(n){var t=n.style;t&&!t.substring&&(n.style=T(t));var o=n["class"];E.call(n,"className")&&(o=n["class"]=n.className,delete n.className),o&&!o.substring&&(n["class"]=S(o))}}},B=function(){function e(){D.classCallCheck(this,e),this._dirty=this._disableRendering=!1,this._linkedStates={},this.nextProps=this.base=null,this.props=o(this,"getDefaultProps")||{},this.state=o(this,"getInitialState")||{},o(this,"initialize")}return e.prototype.linkState=function(e,n){var t=this._linkedStates,o=e+"|"+(n||"");return t[o]||(t[o]=y(this,e,n))},e.prototype.setState=function(e){U(this.state,e),u(this)},e.prototype.setProps=function(e,n){return d(this,e,n)},e.prototype.render=function(e){return t("div",null,e.children)},e}(),H=function ee(e,n,t){D.classCallCheck(this,ee),this.nodeName=e,this.attributes=n,this.children=t};H.prototype.__isVNode=!0;var Z={items:[],itemsOffline:[],add:function(e){if(1===Z.items.push(e)){var n=$.debounceRendering;n?n(Z.process):setTimeout(Z.process,0)}},process:function(){var e=Z.items,n=e.length;if(n)for(Z.items=Z.itemsOffline,Z.items.length=0,Z.itemsOffline=e;n--;)e[n]._dirty&&p(e[n])}},q=Z.process,J={nodes:{},normalizeName:F(function(e){return e.toUpperCase()}),collect:function(e){J.clean(e);var n=J.normalizeName(e.nodeName),t=J.nodes[n];t?t.push(e):J.nodes[n]=[e]},create:function(e){var n=J.normalizeName(e),t=J.nodes[n];return t&&t.pop()||document.createElement(e)},clean:function(e){if(e.parentNode&&e.parentNode.removeChild(e),3!==e.nodeType){delete e._component,delete e._componentConstructor;var n=O.length;for(var t in e)0===t.indexOf(O)&&b(e,t.substring(n),null,e[t])}}},K={components:{},collect:function(e){var n=e.constructor.name,t=K.components[n];t?t.push(e):K.components[n]=[e]},create:function(e,n){var t=K.components[e.name];if(t&&t.length)for(var o=t.length;o--;)if(t[o].constructor===e)return t.splice(o,1)[0];return new e(n)}},Q=F(function(e){return e.replace(/^on/i,"").toLowerCase()}),X=F(function(e){return e.replace(/([A-Z])/,"-$1").toLowerCase()}),Y={options:G,hooks:$,render:n,rerender:q,h:t,Component:B};e.render=n,e.h=t,e.Component=B,e.VNode=H,e.options=G,e.hooks=$,e.rerender=q,e["default"]=Y}); | ||
//# sourceMappingURL=preact.min.js.map |
{ | ||
"name": "preact", | ||
"amdName": "preact", | ||
"version": "2.8.1", | ||
"version": "2.8.2", | ||
"description": "Tiny & fast Component-based virtual DOM framework.", | ||
@@ -6,0 +6,0 @@ "main": "dist/preact.js", |
@@ -197,3 +197,3 @@ const ATTR_PREFIX = '__preactattr_'; | ||
*/ | ||
export function render(vnode, parent, merge=null) { | ||
export function render(vnode, parent, merge) { | ||
let existing = merge && merge._component && merge._componentConstructor===vnode.nodeName, | ||
@@ -488,4 +488,5 @@ built = build(merge, vnode), | ||
unmountComponent(dom, c); | ||
dom = null; | ||
} | ||
dom = createComponentFromVNode(vnode); | ||
dom = createComponentFromVNode(vnode, dom); | ||
} | ||
@@ -502,5 +503,6 @@ | ||
*/ | ||
function createComponentFromVNode(vnode) { | ||
function createComponentFromVNode(vnode, dom) { | ||
let props = getNodeProps(vnode); | ||
let component = componentRecycler.create(vnode.nodeName, props); | ||
if (dom) component.base = dom; | ||
setComponentProps(component, props, NO_RENDER); | ||
@@ -507,0 +509,0 @@ renderComponent(component, DOM_RENDER); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202408
1813