-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adds a widget destroy method #9097
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
base: master
Are you sure you want to change the base?
Conversation
Confirmed: saqimtiaz has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
Branch | Size |
---|---|
Base (master) | 2528.0 KB |
PR | 2528.7 KB |
Diff: ⬆️ Increase: +0.7 KB
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
I did run https://destroytest.tiddlyhost.com/ with Saq's changes here and there seems to be some differences. @buggyj -- I did test it with your destroytest at tiddlyhost according to your information in the test tiddlers. I think I did understand, what they should do. Using this branch with your plugin there is a different behaviour. |
I had another look at those tests and I am not certain they are universal enough to be relevant here. For instance, they expect that the DOM node created by a widget persists until after the base class |
The test for v5.3.0 are here https://destroytests530prerelease.tiddlyhost.com/ , I will try them with this branch. |
@pmario @saqimtiaz I put the tests here https://destroytests537prerelease.tiddlyhost.com/ , they all pass. These are only basic tests, I have not thought about DOM MutationObserver I believe that @linonetwo uses these... |
@buggyj thank you @linonetwo when you get the chance please have a look. |
@saqimtiaz Great, please merge it soon. |
@saqimtiaz Could you add some test for this? Like a custom widget and test it is called. And dom tree only removed once. Or something related to performance. |
This PR adds a widget destroy method, and builds on the earlier work in #7468, which was reverted to allow more time for performance testing.
The key difference to that implementation is that a widget only removes its DOM nodes if an ancestor widget is not already going to remove an ancestor DOM node.
Apologies for the extended delay on this, it slipped through the cracks until I started reviewing all local branches that had not been pushed. It would be nice to get this into the upcoming v5.4.0 release that also allows for the possibility of limited backwards compatibility breaks.
To do: