Not a bug Stale files in /js directory

This isn't something we'll be addressing via a bug report (if ever).

We do not have a reliable and safe way of programmatically removing content from the js directory without potentially affecting shared dependencies, add-ons, styles, or user uploaded scripts.

Such things currently would have to be cleaned up manually, unfortunately, and I don't particularly see a reasonable way going forwards of handling that differently, at least not in the short term.

It's something we're aware of, but rather than keeping the bug report open, I think we'll just set the expectation that this probably isn't something that's going to change.
 
Are builds done via pipeline? If so, it should be fairly easy to automate this task by labeling each package with a known list of dependencies. If including package A and it has dependencies B and C, then ABC are stored. Otherwise, all others not in list are removed.

Sure, might take a few mins now to label those dependencies of existing packages, but I don't follow the logic that this is a manual task on each build.
 
That's not really the issue. We know what is included in each release, of course, but what we don't know necessarily is what has been added to in various places by others.

For example, we would have no way of knowing if js/vendor/videojs is what we added and then removed many moons ago, or something added by an add-on or style. Nothing exactly to stop admins from uploading their own scripts there either, which is significantly more likely to happen for client scripts than it would be for PHP code.
 
we would have no way of knowing if js/vendor/videojs is what we added and then removed many moons ago, or something added by an add-on or style.
Sure, people will have their own js files, but those should be known by the add-on they install in addon.json? for what is not known, personally I would see that beneficial to be flagged so I can go and make it known that it should be there.

The concern of my ask is XF 2.3 is shipping with stale and potentially unused js files even on a new/fresh install, which IMO shouldn't be the case.
 
We don't ship unused/stale files in new releases. Every new release only includes files relevant for that version.

Stale files happen as a result of many upgrades over time.

In terms of videojs there is one file that we do ship (which probably isn't as relevant as it was) which was done deliberately to ensure an old swf file (back from the Flash days!) was overwritten to mitigate a potential XSS issue. It's an empty file. Similar thing with swfupload.

If you have/had files related to videojs then this would have been from an old version of XF (pre-XF 2.3) or from an add-on/style.
 
Not trying to beat a dead horse/mix the pot, but some of the other files I see in the /js are all jquery, which I would have thought were 2.2 references, not XF 2.3; so it seems like those would no longer be needed?

Irrespective of me trying to use VideoJS, I am surprised that it wasn't up to date, regardless if the package is used fully or only in a subset of regard.
 
We no longer used VideoJS as of the release of 2.1. Sometimes files may stick around for a release cycle or two for backwards compatibility reasons, as was the case for VideoJS. It was removed in XF 2.3.

A minimal version of jQuery remains in XF 2.3 and beyond (and will probably be kept up to date) so that it can still be utilised by add-on developers - it prevents a situation where add-on developers are all including their own versions of jQuery where needed, and can benefit from a single canonical version that can be cached and used from a single source.
 
Ah, I see. So, the reason why I have VideoJS is because I was on 2.2 and the upgrade to 2.3 doesn't remove them? Is there a way to find which ones are probably unused as a housecleaning step for myself?
 
Look at what files are shipped in the download, ascertain extraneous ones are not added as a result of actions by yourself, add-ons or styles, and delete what you feel isn't needed.
 
Ah, I see. So, the reason why I have VideoJS is because I was on 2.2 and the upgrade to 2.3 doesn't remove them? Is there a way to find which ones are probably unused as a housecleaning step for myself?
Anything you found during this process would be helpful for other admins as part of the clean up effort.
 
Back
Top Bottom