Skip to content

Commit

Permalink
fix: split components under preserved root resetting ___isPreserved (#…
Browse files Browse the repository at this point in the history
…1559)

(cherry picked from commit 03bb099)
  • Loading branch information
mlrawlings authored and DylanPiercey committed Apr 27, 2020
1 parent e6a2c53 commit dd9f7ac
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/marko/src/runtime/components/beginComponent.js
Expand Up @@ -45,10 +45,10 @@ module.exports = function beginComponent(
let runtimeId = out.global.runtimeId;

componentDef.___renderBoundary = true;
componentDef.___parentPreserved = componentsContext.___isPreserved;

if (isSplitComponent === false && out.global.noBrowserRerender !== true) {
componentDef.___flags |= FLAG_WILL_RERENDER_IN_BROWSER;
componentDef.___parentPreserved = componentsContext.___isPreserved;
componentsContext.___isPreserved = false;
}

Expand Down
@@ -0,0 +1,7 @@
window.mountCount = 0;

module.exports = {
onMount: function() {
window.mountCount++;
}
};
@@ -0,0 +1 @@
<div/>
@@ -0,0 +1,7 @@
class {}

<div no-update>
<app-split/>
<app-split/>
<app-split/>
</div>
@@ -0,0 +1,6 @@
var expect = require("chai").expect;

module.exports = function(helpers) {
helpers.mount(require.resolve("./index"), {});
expect(window.mountCount).to.equal(3);
};

0 comments on commit dd9f7ac

Please sign in to comment.