I'm currently working on this web app using EmberJS. This app will have two version -- a UK and a US version. They both vary slightly in specific content, but overall will remain VERY similar. For instance, instead of displaying in the dashboard X, Y, Z features, it might be X, Z, and A. I would like to know the best code structure to avoid duplicate code and for it to be easily maintainable.
My current thoughts on how to solve this are to load different files for the specific parts that will be different. For instance, I have a plan.html page, but within it I have an elements view. The elements view is the part that is different in both versions. In this case, I'd like to have two files elements-view-us and elements-view-uk, both which contain the elements view, but with different the content. This way I can just load the correct file depending on the version that is requested. Would this be a good solution or is there a better one? Thanks.
That's a good solution easy to test, very little duplication.
Most of this should be handled at deploy time tho, deploy certain files onto us servers/ certain to uk severs. Unless it will all be hosted on the same server, then i like approach 1 with bundling etc