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
Replace close
operation with dispose
#724
Conversation
Hey @ccamarat great rational with this, I wonder if instead of dispose we use something similar to what backbone has with models
|
Props for such a comprehensive PR! I agree with @samccone and would think 'destroy' would be better (it's more obvious that its destructive and already used in Backbone). |
Thanks guys. Sorry for merging in others' changes; still getting the hang of GitHub. I will undo that, rename |
+1 for destroy() Better still would be a pattern/use case explaining the right way of swapping views. Regards Nilesh KaleSent from my iPad On 16-Sep-2013, at 23:10, "Chris Camaratta" notifications@github.com wrote:
|
Ok, I've reverted the changes that shouldn't have been in there in the first place and renamed @nileshkale - Sure, I can do a writeup. |
+1 Thanks. Regards Nilesh KaleSent from my iPad
|
@samccone - I believe all your suggestions are in now. Code review please? |
hey @ccamarat can you squash this commit back into your earlier changes so that you are not changing and then rechanging your code within a single PR. |
Yea, I can do that. Sorry, I'm not too familiar with GitHub etiquette - what's the general practice then, do I close this PR and open a new one with the updates? |
nope you can just force push over your branch, the PR will automatically be updated |
@samccone - Squashed. |
👍 really like the consistency of this. |
Hey @ccamarat this is really amazing work great job! I left a few nits also it seems like you did not add docs for
that is all, then we can bump the version and 🚢 |
nice, maybe rename this last commit to Add Documentation for Swap Events, so the git log will read better. |
Oh, sorry Sam. I'm messing with the docs and don't have a local reader. I'll squish it when I'm done. hopefully another 10 mins. |
Includes all requested changes and documentation updates.
cool I am going to give this my ⭐ When we merge we can bump the major version and note the breaking change of ping @derickbailey @mbriggs @jsoverson @tgcondor |
Hey @ccamarat we are working on the v2.0.0 release here I tried and merge and i got tons of merge issues, would you mind opening a PR into this branch? Thanks!! |
@samccone Sorry I've been busy moving. Do you still need me to do a PR? |
yeah that would be awesome, thanks @ccamarat |
Ok, gonna get this done this weekend. |
This is a breaking change request.
The
close
operation acts as a destructor for Marionette Views, and destructed objects should not be reused. The nameclose
doesn't convey this intention and Marionette's users regularly attempt to reuse closed views. Seeing unusual behavior, attempts have been made to patch individual bugs without fully realizing the scope of the problem. Marionette 1.0.3 contained the first of these partial bug-fixes, but it failed to account for all the things that the various types of views do during their construction that would need to be re-done if the view was to be reused, and so the problems persisted. Other pull requests attempt to resolve various problems arising from this usage, but none have fully addressed the problem, and I'm of the opinion we shouldn't try.I submit that
close
ing s view should truly prep it for garbage collection. To clearly convey the intent of the function I propose that it be renamed todispose
instead.Additionally, since there seems to be a genuine need for swapping views without disposing them, this pull request has added a
swap
method to the Region.