Open Emasoft opened 9 years ago
I've tried to add Tiles: https://gist.github.com/localvoid/21e539f99cb44286d49e But it seems that I am missing something, because it is running extremely slow and uses too much memory.
With TagTree I can't find a way to unmount Tag (function similar to React.unmountComponentAtNode
) and manually trigger diff/patch phase (ReactUpdates.flushBatchedUpdates
).
I am not sure that there is something like react/vdom diff is implemented, because there is no way to set unique key for tags, and I don't see it in examples.
I opened an issue on the TagTree tracker: https://github.com/google/dart-tagtree/issues/6 Let's hope Brian Slesinsky will help us, he is usually very considerate.
/sub
You are correct that there's no way to set a unique key for a Tag in TagTree; I was deliberately putting this off until I implemented a sample app that requires it for performance. I created a bug for this. [1]
And yes, triggering diffs and patches is always done via requestAnimationFrame. You could sort of hack it by subclassing RenderRoot [2] and overriding requestAnimationFrame() to call its callback immediately with a fake DomUpdater. However, this would only test the TagTree renderer's internal logic, not the code that actually updates the DOM which is in TagTree's "browser" library.
I suspect that TagTree wouldn't do well on benchmarks since I haven't done any performance tests, other than making sure the samples run fast enough. I was more concerned with thinking about what the API should look like. The vdom library is more targeted, so I suspect anyone caring about benchmarks would use that anyway. And perhaps TagTree would be simpler if it were built on vdom? :-)
[1] https://github.com/google/dart-tagtree/issues/7 [2] https://github.com/google/dart-tagtree/blob/master/lib/src/render/root.dart
And perhaps TagTree would be simpler if it were built on vdom? :-)
I've built a Components library on top of vdom, just to make sure that vdom api is enough for that task.
And btw, I really like TagTree API :)
Please add those other 2 vdom libraries to the benchmark: Tiles - https://github.com/cleandart/tiles TagTree - https://github.com/google/dart-tagtree