Open connorshea opened 5 years ago
Agreed, ideally we shouldn't be committing generated source files. I think we'd need to add rebuilding the minified JS to the installer or have something in the command line so you can pull down and install from the repo.
Interestingly, most of the files have counterparts in the jssource
directory, but not all of them. I formatted most of the files in my pull request, but I'm not sure if it makes sense to even merge the PR given that the source files are already in the repo.
@Dillon-Brown would changing the installation system to minify the JS be particularly difficult? That'd allow us to just remove most of this code.
@connorshea I imagine it shouldn't be too difficult. We already have all the functionality to do this already, just need to be called during installation. It looks like there are around 613 files to remove here :O
O.O
Earlier today I opened #7332 to fix some minified JavaScript that was in the FP_Events module, and that made me curious to see if there were any other files that were commited to the git repo with minification. It looks like there are quite a few.
A lot are in the
include/
directory, and I won't include them in this list just because them being minified sort of makes sense (we should really still fix it, though).For example
install/
, e.g.install/license.js
,install/oc_install.js
,install/site_config.js
etc. Though there are corresponding source files injssource/src_files/install
it looks like? The minified versions probably shouldn't be in the repo, instead they should be generated on-release.modules/calendar/Cal.js
(#7332)modules/ACLRoles/ACLRoles.js
(#7332)modules/AM_ProjectTemplates/jsclass_scheduler.js
modules/Campaigns/DetailView.js
(#7332)modules/Campaigns/WebToLead.js
(#7332)modules/Campaigns/wizard.js
(#7332)modules/Connectors/Connector.js
(#7332)modules/Contacts/Contact.js
(#7332)modules/Documents/documents.js
(#7332)modules/EAPM/EAPMEdit.js
(#7332)modules/EmailTemplates/EmailTemplate.js
(#7332)modules/FP_events/duration_dependency.js
(#7332)modules/FP_events/jsclass_scheduler.js
(#7332)modules/Meetings/duration_dependency.js
modules/Meetings/jsclass_scheduler.js
modules/MergeRecords/Merge.js
(#7332)modules/Leads/Lead.js
(#7332)modules/InboundEmail/InboundEmail.js
(#7332)modules/Home/tour.js
(#7332)modules/Project/jsclass_scheduler.js
modules/Schedulers/Schedulers.js
(#7332)modules/Studio/studio.js
(#7332)modules/Studio/studiodd.js
(#7332)modules/Studio/studiotabgroups.js
(#7332)modules/Studio/ygDDListStudio.js
modules/UpgradeWizard/upgradeWizard.js
modules/Users/DetailView.js
(#7332)modules/Users/login.js
modules/Users/PasswordRequirementBox.js
modules/Users/UserEditView.js
modules/Users/User.js
service/utils/SugarRest.js
Note: I found these by searching for
var
in VS Code and then looking through the results for lines that looked likevar this;var that;var them;var spaghetti;
. This list probably isn't comprehensive.Most (all?) of these are from the 'Initial Commit' to the repo 6 years ago. I'm not sure if the original SugarCRM files exist somewhere that we can use, or if they were minified in the Sugar repo as well. Assuming we can't recover them from a copy of the Sugar CE repo, the best solution would probably be to do what I did in #7332 and just reformat the files using Prettier.