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 Render Bug: when using observables and selectors, there are edge cases where the list stops rendering to the DOM as expected. #1
Comments
Hey @jaymanmdev, I'm really happy to know that you've been working with it and sorry for not have responded earlier. I've been working on some great improvements for the Estrela framework, some great features that will make it very easy to work with Estrela. I have just pushed a new version today, but still need to fiz some bugs. I'm going to look into your bug description and see if it's still there, and fix it accordingly. Thanks so much! |
About the bug, I'm pretty sure that it's caused by the When you use an observable as the render content, Estrela creates a fragment which is a collection of nodes within a children list of a Parent node. If the observable children is empty, Estrela creates an empty Text node to serve as a placeholder to keep track of the Parent and position in the children list. If we add an item back to the list, it will replace that Text node with the actual one. If we remove the node by ourselves, the fragment won't understand that the node was removed and won't be able to patch it later. I don't know how other languages deal with this, maybe it should have a way to detect these cases, but the correct way would be to remove the node inside the observable data and let it update correctly. But it's good to have this in mind, I will keep this issue opened to think more about it. |
Cool! Glad that you were able to track down a probable cause of the issue. It really only happens for a couple edge cases, but otherwise works fine. Just thought I would bring it up with you anyways. Cheers for your time! |
When you get a chance, please test the latest version. Now it's not necessary to create a state by yourself, just declare a variable using the My intention is to make it very simple by removing all the complexity that other frameworks have, like React that requires Checkout the playground package in the repository, I added a Todo example that shows how easy it can be to work with it. I'm still working on the styled feat that allows css in js, but I needed to remove it because it was not a good idea to have |
Hey, I am trying out the new syntax, however, even the minimal counter example on the README doesn't work reactively. And mine is pretty much identical to it. EDIT: Okay, it works fine using a normal function, however, it breaks if I use an arrow function. Just FYI. :) |
@jaymanmdev how are you writing the arrow function component? Like this? const App = () => {
return <div></div>
} |
Closing the issue. The issue is when you remove a DOM element by yourself and causes it to break Estrela logic, so it shouldn't be covered. |
Hi, I just found out about this marvelous framework, and I am really loving the look of it and can't wait for its future.
I have spent a little bit of time playing around with observables and selectors to see what they are capable of, and have been extremely happy with them thus far. However, I have run into a small bug with the rendering of lists. It really only happens (as far as I can see) in one or two particular edge cases.
Reproduction repo: https://github.com/JaymanMDev/estrela-issue-reproduction
Reproduction steps:
The text was updated successfully, but these errors were encountered: