modelsbuilder / ModelsBuilder.Original

The Community Models Builder for Umbraco
MIT License
114 stars 49 forks source link

Way to make LiveAppData only generate when the CMS doctype save event happens? #120

Closed zpbd closed 7 years ago

zpbd commented 8 years ago

It seems that when one developer makes a doctype change on his or her machine, the other developers get doctype changes on their local builds. This causes confusion when they want to commit files as they have changes that they aren't expecting having not done anything in the CMS.

I expected LiveAppData to generate the files when you hit "Save" but only on that particular instance. I assume ModelsBuilder is just watching for doctype changes though rather than hooking into the event, since it seems to propagate out on all the other developer instances.

Is there any workaround for this? We may have to go back to the Visual Studio tool approach otherwise, which I don't like, as front-end developers particularly are confused by doctype changes on their instances.

zpqrtbnk commented 8 years ago

Live models (whether it is Dll, AppData...) rebuilt on the "site" by listening to the (distributed) events. So in case of eg a load-balanced environment, where multiple servers hook into the same database to constitute one "site", models are re-generated on all servers.

If one dev modifying models impacts the other devs... does that mean that all your devs work on the same database, therefore creating some sort of load-balanced dev environment?

In this case I'm not sure how to deal with it, as dealing with "local but not distributed events" would require some refactoring both of ModelsBuilder and Umbraco Core.

What's wrong with the VS extension though?

zpbd commented 7 years ago

Hi @zpqrtbnk, Thanks for the explanation, I can see why it's doing what it's doing now. In answer to your question, yes all of our devs work on the same database (unless they are working on a significantly different branch which would have it's own database). If the site is blind as to whether an event is "distributed" or from the CMS user hitting save on the local machine, then I can see why there's no straightforward solution.

There's nothing "wrong" with the VS extension, we just don't find it as convenient and we find it speeds up development to automate things, and also makes sure that developers keep minor changes checked in that they might otherwise forget. Purely a quality of life thing.

zpqrtbnk commented 7 years ago

Closing this one