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
i-bem. this.elem cache #347
Comments
Are you talking about |
Sure not. I'm just talking about block/elem cache invalidation. Actually some jquery plugins just modifying DOM tree so we can't be everywhere and need some stable solution. I don't need to manipulate it by self despite the fact that some times it could be useful. e.g. for dynamic initialization of block: this.elem('title').length > 0 || renderBlock(); Just if something changed in DOM tree cache of elem and block must be dropped because it's already invalid and can store references to removed DOMElements at the moment. So garbage collector will be confused and it will result in memory leaks. There is also W3C DOM 2 Events Recommendation: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents about mutationevents. Easy way to do that is to use something like http://www.quirksmode.org/js/events/DOMtree.html — pretty cute demo about mutations which could be used to cache validation (tiny and useful way to collect garbage in cache). I think it should be integrated. It's not too hard to do that and also it will be very good to have it regardless of DOM tree modifications by some third party scripts. |
@zxqfox could you plz send pr? |
@deeonis I can try to do it in medium-long period. |
Similar issue in bem-core: bem/bem-core#583 |
we'll be waiting 😼 |
@deeonis I'm not sure about the full idea of this issue but since code is pretty close to bem-core@v2.x codebase I think we can use it as is. About full caching issues → not sure we can do it easily, it's a lot of work so I prefer to left it as is. So it's ready, feel free to merge it ;-) |
@deeonis Polite ping. |
@zxqfox pong :) |
Partially fixes #347 Ref bem/bem-core#842 Closes gh-634
@zxqfox Do u think that we need to do smth else with this issue? |
I had some ideas long time ago, but for now there is better idea with virtualdom. I think we can left it as is. |
this.elem cache should be dropped after findElem call
also is it possible to drop elem cache after jQuery dom manipulation functions calls? like empty or append, remove?
The text was updated successfully, but these errors were encountered: