core_components is meant to be modified by the user, at least for css classes
when upgrading phoenix, the file core_components can receive updates but how to cleanly include those in your app if you have already modified it ?
also core_components is pulled from generators with phx.gen.live, but if you modified it, it’s not very practical.
so what would be the way to easely benefit from any upgrade and at the same time be able to modify the copy of your application ?
Maybe this app is helpful for that?
yes it is, but still you need to go though all detailed changes, it is not the case fortunately for the other parts of phoenix.
Core_components, given it is very probably changed by the user is not very upgrade friendly at the moment
Every generated content is really easy to upgrade.
Firstly you need 2 temporary directories let’s call them
new. In both directories you need to call the same generator with exactly same parameters. The only difference is that the project in
old directory would be generated with a older version of specific generator and project in
new directory would be generated with a newer version of said generator.
Secondly you need to compare those directories by software of your choice for example by creating a
.patch file and finally apply changes back to your original project. All you have to do is to fix the conflicts most likely always choosing the old version which would be your custom code.
Sometimes depending on generated content you would need to update your custom code as well, because for example it can contain a deprecated function calls which isn’t anything new when you update your dependency anyway.