-
Notifications
You must be signed in to change notification settings - Fork 844
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
upgrade xaniajs implementation to 0.3.* #991
Conversation
this update should "hopefully" prove to be even more performant than the previous submission of xaniajs |
Thanks. Xaniajs got really fast! |
Hi, thx again, I don't think I agree with
|
BTW,
and is used in the jsx template
|
In the same category of confusion, the variable name |
I think the delete is fine. It's basically like manual event delegation being done in others but done more cleanly. Instead of walking to find the row Xania already wrote it to the element which you'd have anyway in any event handler and typically you'd have the index as well (the data being read). This basically avoids the closure like any of the methods used under the hood in other frameworks for implicit event delegation. It's more in the open here but it'd be hard to say it is #772. Maybe #801 but even that's arguable. One thing you are doing is storing the
Overall this implementation is like Mikado in that it uses swap to proxy swap. There is no reconciler here. Replace clears before it attaches because it knows it is a replacement instead of diffing. It's this thread all over again: #654. I don't even remember if we landed anywhere on considering that #772 because the author changed his implementation to be more data-driven afterwards because he was tired of catching flack from people. @krausest I mentioned this in other issues I was surprised we hadn't seen more libraries like this. It's basically a different sort of model that works really well in these sorts of benchmarks which don't need to handle shared state synchronization. |
Yes, this is really always a difficult topic. This benchmark certainly has a weakness in that it allows a comparison for all kinds of frameworks (we only managed to distinguish between keyed and non-keyed). More imperative frameworks often have an edge over model-driven benchmarks, but the lines between the frameworks are blurry. |
thx guys for the impressive in-depth analysis of xaniajs' implementation, it even helped me understand it better myself :) And if you really want to force the model-driven approach then I would suggest to provide the data as external source
|
Yeah and to be clear reactive frameworks are sort of teetering on that line since they also follow the thing that once loaded you own the data. Pulling it outside and doing snapshots would put them out too or relying on sneaking proxies in because they too need custom data. The difference between Xania's approach and reactive libs is just what is being proxied. Reactive libraries intercept the data updates, but work off multi-cast events so the data to template relationship isn't 1 to 1. Neither need a reconciler in the pure sense. So I don't think the intention is to try to force this into basically a VDOM only thing. However, I do see the dilemma. Replace and Select rows are sort of the perfect examples of where this gets tricky. Any framework could clear before insert for their replace. Or benefit from putting selected on each row. The reason for the different tests are these super common with model-driven approach. If selected was on each row it is basically the same as partial updates test. Often with model-driven approach more than one template can represent the same data so polluting the model is a case to avoid. As are specific data projections where you preserve the source list but need to show filtered results and between changing those filters some of the elements may be retained and others not. So the tests are written in the spirit of those cases without actually being forced into them.
Yup. And the most efficient direct approach would just be using VanillaJS. So if the premise was the reconciler was necessary you'd just skip straight past proxying the DOM and use the DOM directly. I'm not saying it is necessary here (or anywhere else) as clearly Xania implementations shows but the abstraction difference does sidestep some of the tests. View the notes as an indicator of that different behavior. I can picture how Xania could partially conform but as I told the author of Mikado might not be worth it, not a true representation of how one idiomatically uses the library. It's a choice. With Solid I was like 90% conformance so I just went slightly out of the way to do so, so I could remove the markers. But I think one of the strengths here is that you can just leave it as is and still showcase the library for the way it was meant to behave. |
No description provided.