I'm considering migrating a pretty large project from -default-isolation=nonisolated to -default-isolation=MainActor.
Is there automatic tooling available for that, similar to -enable-upcoming-feature NonisolatedNonsendingByDefault:migrate? I could not find anything, but this is not a task I would risk to do manually.
Any particular reason for the migration? AFAIK, this isn't a default that will change in a future language version (new projects in Xcode excepted). In my experience, MainActor default isolation, especially at scale, is even more invasive than nonisolated. So what advantages are you looking for here?
As far as I’m aware, no such tooling exists, I wouldn’t even be sure how it could work in this case. All the upcoming features that support migration, to my knowledge, should be listed here. As @Jon_Shier mentioned, I would advise against trying to attempt the migration if there isn’t a particular pressing reason for it. If your project isn’t strictly domain-separated it will be, quite honestly, a nightmare and you will give up eventually (from my own experience).
I have a suspicion that we have much more @MainActor-isolated entities than nonisolated. So -default-isolation=MainActor should save some boilerplate code. But it is hard to judge, because it is hard to scan source code for entities that need to be explicitly marked as nonisolated. I was imagining that I could number of @MainActor attrobites before the migration, run the migration tool, and then count number of nonsiolated attributes after. And by comparing the two to draw conclusion which one is a better default.