Marionette.Upgrade
Marionette.Upgrade copied to clipboard
Region close => empty
Region's close is empty, not destroy
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.
Still occurring
Maybe the proper fix is a message that warns you about this? The regex is pretty stupid.
+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.
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.
cool - this is ready for a PR.