Ngx-admin: How to use ng2-admin considering future updates

Created on 15 Apr 2017  路  2Comments  路  Source: akveo/ngx-admin

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [x ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?

None of he above

  • What is the current behavior?

For "normal" ng-components like ng2-toasty and such, it's safe to integrate them into a project, as they're easy to replace and upgrade and won't have much impact when they're upgraded. This is essentially because they're implemented as is. No changes would be made.

Ng2-admin is more of a bootstrap and will be modified by users. Like changing the theme, removing pages, changing the config.

So it's not safe to do a simple git pull as it will erase all changes made. What would be the correct strategy to use such package then? Never update? Or do a tough comparison and then manually merge changes?

Here are no 'override' settings where users can make their changes so... (open for ideas)

question

Most helpful comment

I would recommend taking keeping copies of each ng2-admin you utilize, and comparing them against each other to capture changes, then merging those changes into your custom version.

To further illustrate, let's say you have:

Cloned from source:
->ng2-admin-2017-03-01
->ng2-admin-2017-04-01

Your custom version
->ng2-admin-custom (let's say this last synced with above 2017-03-01)

In the above scenario, if you want to pick up changes til 04-01, I would suggest comparing 03-01 vs 04-01, and then doing a similar folder comparison of 04-01 vs custom, and apply all changes since 03-01 to your custom folder that you haven't deliberately overridden.

Tips for this approach to work:

  1. don't customize / refactor details that are better left alone, especially structural things like folder names and hierarchy. If ng2-admin is a key part of your source code, you want to make future comparisons easy. e.g. don't touch app/theme folder and related hierarchy. keep nga.module sections in tact (don't sort imports alphabetically, but rather append new imports modules etc.)
  2. And of course, always keep a copy of ng2-admin that was last synced with your custom.

Hopefully that helps?

All 2 comments

I would recommend taking keeping copies of each ng2-admin you utilize, and comparing them against each other to capture changes, then merging those changes into your custom version.

To further illustrate, let's say you have:

Cloned from source:
->ng2-admin-2017-03-01
->ng2-admin-2017-04-01

Your custom version
->ng2-admin-custom (let's say this last synced with above 2017-03-01)

In the above scenario, if you want to pick up changes til 04-01, I would suggest comparing 03-01 vs 04-01, and then doing a similar folder comparison of 04-01 vs custom, and apply all changes since 03-01 to your custom folder that you haven't deliberately overridden.

Tips for this approach to work:

  1. don't customize / refactor details that are better left alone, especially structural things like folder names and hierarchy. If ng2-admin is a key part of your source code, you want to make future comparisons easy. e.g. don't touch app/theme folder and related hierarchy. keep nga.module sections in tact (don't sort imports alphabetically, but rather append new imports modules etc.)
  2. And of course, always keep a copy of ng2-admin that was last synced with your custom.

Hopefully that helps?

Assuming you are using git for your source control:
I found a very good solution to this on a similar starter project on github.

Just add another remote to starter repository:
git remote add starter https://github.com/akveo/ng2-admin.git

And every time you want to merge latest changes from starter to your project do:
git pull starter master

It does not override your changes made to the starter, a merge is made automatically or required to do manually.

The only "downside" of this that in your commit tree you'll see starter commits too.

Also I did this before I started editing project, so test it on backup first :).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

myurAgarwal picture myurAgarwal  路  3Comments

argnist picture argnist  路  4Comments

xandatspain picture xandatspain  路  3Comments

PatrickHuetter picture PatrickHuetter  路  3Comments

mignam picture mignam  路  3Comments