Marionette.Upgrade icon indicating copy to clipboard operation
Marionette.Upgrade copied to clipboard

Region close => empty

Open jamesplease opened this issue 11 years ago • 6 comments

Region's close is empty, not destroy

jamesplease avatar Jun 19 '14 00:06 jamesplease

Yeah, the script wants to replace all regions' "close" with "destroy" which is hard to work around because views' "close" needs to be replaced with "destroy". Still, the proper replacement step for regions is completely missing.

xMartin avatar Jun 20 '14 12:06 xMartin

Still occurring

alxndr avatar Aug 06 '14 19:08 alxndr

Maybe the proper fix is a message that warns you about this? The regex is pretty stupid.

jasonLaster avatar Aug 10 '14 13:08 jasonLaster

+1. But I dont see how a better regex could fix this. The parser would need to know whether the instance being closed is a view or a region, which seems impossible to me. The tool would have to actually run the whole app and go back and check the prototype of each instance.

But there should definitely be a warning in the intro text to not change close to destroy for regions. And maybe an option to replace close with either destroy or empty on a case by case basis.

omasback avatar Aug 27 '14 22:08 omasback

Agree with @omasback. A warning message + choice for every close is probably best.

It took me 2 minutes to run the upgrade script on my app (Thank you!). I would imagine adding a little more verbosity wouldn't hurt anyone.

infiniteluke avatar Mar 10 '15 19:03 infiniteluke

cool - this is ready for a PR.

jasonLaster avatar Mar 11 '15 15:03 jasonLaster