-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List is rerendered on browser even with zero state changes #1285
Comments
The problem here (as you've discovered) is that if a component has an inline Using Let me know if this solves your issue. |
No success the payload is still delivered to the browser. component-browser.js module.exports = {
onFilterChange(filterFormState) {
console.log(filterFormState);
}
}; index.marko <section class="category-components">
<section class="product-list container">
<div class="row">
<for|product| of=input.products>
<div class="col-4">
<div class="product-list__item align-middle">
<a href=`/components/${input.category.slug}/${product.slug}`>
<div class="product-list__item__image d-flex align-items-center justify-content-center text-center">
<img src="../../global-asset/images/product-example.png"/>
</div>
</a>
<div class="product-list__item__details">
<span class="product-list__item__name d-block font-weight-bold">
<a href=`/components/${input.category.slug}/${product.slug}`>${product.name}</a>
</span>
<span class="product-list__item__name d-block">${product.type}</span>
<span class="product-list__item__name d-block">${product.vendor}</span>
</div>
</div>
</div>
</for>
</div>
</section>
</section> Could you point me to the place where that decision is made? |
The way that it works is that the Marko compiler exposes some meta data that has info like Having said that the above does not look like the template should be sent down. Is there anything else in the template? Are you using a |
Yes, I use a <@footer>
<section class="container">
<app-footer/>
</section>
</@footer> and |
The bug is still there and looks like a deeper marko issue of dynamic attribute tags You can reproduce it as follow:
|
Although this is something we plan to automatically optimize away in the future we've mentioned this caveat in the docs (https://markojs.com/docs/server-side-rendering/#caveats). Also using split-components allows for some additional optimization, and you can manually prune input for split components by following https://markojs.com/docs/server-side-rendering/#serialization |
Marko Version: 4.15.2
My components looks as follow:
Expected Behavior
The component should be rendered only on server-side.
Actual Behavior
The component is rerendered on the client even when no state was changed.
Workaround
Remove the complete
class
or don't use dynamic attribute tags for the layout.Environment
I'm using
layout
tags and the default marko & lasso setup.Ubuntu 18.04
The text was updated successfully, but these errors were encountered: