You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laminar elements can in theory be moved from one parent to another without unmounting. Few people knowingly use that feature, but it's possible, especially in Laminar 15.x.x. In those cases, certain advanced use cases (Frontroute URL routing, or integration with third party JS libs) might require notifications about such moves.
I think I can implement onBeforeParentChange and onAfterParentChange callbacks at no performance or complexity cost to users who don't need them. I'm not yet sure which one of those I will implement (feedback welcome). I do not plan to implement any other helper methods (*bind, *insert, etc.). I'm also not yet sure if these callbacks should fire on any parent change, or only if the element is mounted and remains mounted after the change.
Also, if the callback is to provide a reference to the next or previous parent, make sure this does not jeopardize GC – by the time the callback finishes, the reference to the old parent should be GC-d if it's not actually used, even if the callback spawned other closures (that also have access to the old parent reference, but don't use it). Figure out how to test for that.
@yurique Sadly this won't make it to 17.x, too many other features.
What's your priority for this, compared to the other stuff I've been doing?
If you want, I can prioritize this for v18.
Laminar elements can in theory be moved from one parent to another without unmounting. Few people knowingly use that feature, but it's possible, especially in Laminar 15.x.x. In those cases, certain advanced use cases (Frontroute URL routing, or integration with third party JS libs) might require notifications about such moves.
I think I can implement
onBeforeParentChange
andonAfterParentChange
callbacks at no performance or complexity cost to users who don't need them. I'm not yet sure which one of those I will implement (feedback welcome). I do not plan to implement any other helper methods (*bind, *insert, etc.). I'm also not yet sure if these callbacks should fire on any parent change, or only if the element is mounted and remains mounted after the change.Also, if the callback is to provide a reference to the next or previous parent, make sure this does not jeopardize GC – by the time the callback finishes, the reference to the old parent should be GC-d if it's not actually used, even if the callback spawned other closures (that also have access to the old parent reference, but don't use it). Figure out how to test for that.
Requested by @yurique
The text was updated successfully, but these errors were encountered: