-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Implement setRenderer destructive option #3556
Conversation
I'd support this for an experimental API. Looking forward to v4.x and v5 for region improvements and I don't want to box ourselves in. |
I'm ok with marking as an experimental API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a fan overall, I just think the naming could be improved (see my comment).
this.prototype._renderHtml = renderer; | ||
if (options && options.destructive === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the feature could be good, though I don't like the name.
Maybe just call this reInitializeRegion
or maybe preserveRegion
so the flag check can be options.preserveRegion
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine changing the name but should not be region specific. This flag may be needed for other things than reinitialize region like for example adding an onReady event which would have a different behavior from destructive and non destructive regions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about preventDestroy
? It's used in stuff like region.show
and it feels like it does a similar job.
Something like this may make it to https://github.com/marionettejs/marionette |
Proposed changes
setRenderer
with destructive: false, do not reinit regions on view re-renderLink to the issue: #3427