Remove Unused Elements on Deploy

On our radar

It would be very nice to have a check box when deploying from environment to environment which would allow you to remove unused elements in all applications. Similar to how the feature works within Service Studio

I find it very helpful having everything at hand when developing  but once deployed to test or production environments there is no need for the extra baggage.

Created on 31 Jul 2018
Comments (9)

Changed the category to 1CP

I like the sentiment (I am in favor of ANYTHING that makes "Remove Unused Elements" happen more often!), but it also means that your PROD code is different from your DEV code, which is objectionable (especially in a DevOps world with containers and CI/CD with containers).


Changed the status to
On our radar

Hi Oliver!

Thank you for the idea!

We have been thinking about this topic for a while.

@Oliver and @Justin, can you share a few scenarios where you see cleaning of unused elements for multiple modules/applications/solutions to be most useful? What about the granularity - all vs a subset of existing modules/applications/solutions?

Stoyan -

Just remove ALL unused elements from everything being deployed. Keep the compiled code size as small and efficient as possible. There is no reason to have all of those extra dependencies compiled in.



Don't you think that removing all unused references, by default, whenever something gets published might result in some loss of development speed? E.g. system actions or silk elements that might be needed shortly afterwards, but are not currently in use?

I agree with Justin, the choice to remove all unused elements once you go from a Development environment into a Test or Live environment would be great. Whilst also keeping these elements in your development environment for the exact reason you mentioned Stoyan. 

Many thanks,


Great to hear this feedback Oliver!

The only thing I am not entirely aligned with is the "clearing references" when staging to PRD. I believe that whatever reaches PRD must have been validated, as is, in previous environments. It would introduce too much risk to be making changes (as benign as these might be) to applications/solutions in the process of these going Live.

Yes, that's why this should be done when deploying to ANY environment through Lifetime. That way it gets tested in QA.

Also, this idea has nothing to do with development speed, because it is NOT about doing it in dev, it's about doing a deployment BETWEEN environments (a Lifetime deployment).


Cheers Justin! Really clarifying this!