U4-8200 - Remove any unused/unreferenced JS and CSS files in Umbraco_Client and Umbraco

Created by Shannon Deminick 17 Mar 2016, 12:49:18 Updated by Shannon Deminick 23 Mar 2016, 09:23:44

Tags: Unscheduled Community Contrib

Subtask of: U4-5419

This will be easy to do but will require ensuring that these files are definitely not in use. This can be done by searching for the file name within all files in the whole solution to see if they are referenced/used anywhere.


Jan Skovgaard 21 Mar 2016, 14:56:29

@Shandem I'd like to look into this...but must admit I can't remember, which of the src folders are compiled to umbraco_client and umbraco folders? - Is it Umbraco.Web, Umbraco.Web.ui and Umbraco.web.ui.client?

Shannon Deminick 21 Mar 2016, 15:17:39

The Umbraco.Web.UI.Client is the angular project... you won't need to do anything there (yet). We just need to clear out all unused client files from the Umbraco.Web.UI/Umbraco and Umbraco.Web.UI/Umbraco_Client folders.

Jan Skovgaard 21 Mar 2016, 16:24:48

@Shandem Ah yes of course!

Say that there is a stylesheet in a folder like /Panel and that inside the folder there are also images, which are only referenced in the stylesheet. Should I delete the entire /Panel folder if the stylesheet in it is not referenced anywhere? I don't suppose it makes much sense to leave the folder in the project then?

Shannon Deminick 21 Mar 2016, 16:32:43

We want to get rid of everything that we can :) So if /Panel/* isn't used to power anything in the back office, then kill it. We're not worried about backwards compat here. Make sure that you have the developer tools open in chrome (or whatever) when you are removing files since you can clearly see if there are some assets that are being requested that you've removed and in that case we need to figure out if we need those assets or not. Make sense?

Jan Skovgaard 21 Mar 2016, 21:54:43

PR here https://github.com/umbraco/Umbraco-CMS/pull/1190

Shannon Deminick 22 Mar 2016, 11:11:52

Great!!!!!! All tested and merged in. I updated the csproj file with the removed entries too. There's a few ysods in the back office due to other changes I've made but for the most part it looks like all editors and dialogs still work with these removed.

I'll leave this open since there might be some more stuff to remove too.

Jan Skovgaard 22 Mar 2016, 11:48:48

Yay! Ah yes, forgot to do the builds before comitting and pushing :) - Before I started deleting stuff I gave Umbraco a spin to see if som 404's already existed and if something was acting weird for some reason before hand - Just so I would not have any doubts whether I caused an issue or if it was already there before I began deleting stuff like a mad man. Seemed that there is some "punycode" stuff missing before I started. I did a search in all files in visual studio for each file and removed those that had 0 references anywhere - I also tried to delete other files and folders to see if it would have an impact and it did so left them in for now - In some cases it files were referenced in some .aspx and .cs files, which could seem to be unused legacy. But turns out it was still in use. So in the current state I don't think there is more that can be removed before some of those files referencing what's left are gone - But I'll be happy to have another look later on :) Just let me know.

Shannon Deminick 23 Mar 2016, 09:23:37

I've fixed the puny code thing :) Ok, i'll close for now, great work mate!!!

Priority: Up for grabs

Type: Task

State: Fixed


Difficulty: Easy


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 8.0.0

Sprint: Sprint 11

Story Points: