Skip to content
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

We need some way to prevent components from being unregistered if they're not contained in the parent component DOMNode #20

Open
ElliotNB opened this issue Sep 6, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ElliotNB
Copy link
Owner

ElliotNB commented Sep 6, 2018

TXMBase is designed to unregister and delete components if they are found to not be contained within the DOMNode of a parent component after a refresh. TXMBase was built this way in order to prevent memory leaks after successive component refreshes and updates. However, it is possible that we want to display a registered component for the first display, hide it for another display mode and then display it again on a successive refresh into another display mode. We need to figure out a way to only unregister the components that have no possibility of being displayed again.

@ElliotNB ElliotNB added the enhancement New feature or request label Sep 6, 2018
@ElliotNB ElliotNB self-assigned this Sep 6, 2018
@ElliotNB
Copy link
Owner Author

ElliotNB commented Sep 8, 2018

Proposed rules for component refresh clean-up:

  1. If component XYZ is not contained in the DOM, then
    A. If component XYZ is registered into a repeatable section AND the repeatable section is still present, then component XYZ gets unregistered.
    B. Else if component XYZ does not belong to a repeatable section and there was another (newer) component registered using the same tag name, then component XYZ gets unregistered (because the new component replaces it).
  2. If component XYZ is contained in the DOM, then it does not get unregistered.

@ElliotNB
Copy link
Owner Author

This could be more easily solved by ignoring the unregistration and deletion of components that are registered outside of the ._render method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant