Most of our ResourceLoader files are currently named `<group>[/<subgroup>]/<module name>.[less|js]` or `<group>[/<subgroup>]/<module name>.<class name>.js`, e.g. `modules/homepage/ext.growthExperiments.Homepage.less` or `modules/homepage/suggestededits/ext.growthExperiments.Homepage.SuggestedEdits.EndOfQueueWidget.js`. (Add Link modules tend to omit the `<module name>` part.) The long file names can be unwieldy (e.g. the IDE will end up showing some prefix of the file name due to limited space, and that prefix is the same for all files in the module), and the directory structure doesn't give much insight into the module structure. We should come up with a more convenient and more uniform convention.
While asset naming is a bit chaotic in the rest of MediaWiki as well, the most organized parts of the codebase tend to follow one of two conventions:
# use file names like `<module name>/<module name>.<class>.js` and make the class available via the global variable `<module name>.<class>` (this made a lot of sense before ResourceLoader had package support, probably less sensible today)
# use the `packageFiles` option of ResourceLoader, with file names like `<module name>/index.js` for the entry point and `<module name>/<class>.js` for the classes
We should probably pick one of those (probably #2 as it's the more modern convention), make it specific enough to be easy to follow (e.g. where go common files like `Utils.js` and `mixins.less` go? do we want some internal grouping if we end up with huge modules due to ResourceLoader module count performance limits?), and rename our existing modules - that's a lot of renames, but it's mostly just search & replace so the biggest burden is probably in rebasing open patches. We [[https://gerrit.wikimedia.org/r/q/project:mediawiki/extensions/GrowthExperiments++status:open+file:modules|don't have that many of them right now]], so maybe we can get most of them merged and then do this.
Remaining modules:
[] ext.growthExperiments.Help
[] ext.growthExperiments.HelpPanel
[] ext.growthExperiments.HelpPanel.init
[] ext.growthExperiments.SuggestedEditSession (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/747557)
[] ext.growthExperiments.Homepage.Mobile
[] ext.growthExperiments.Homepage.ConfirmEmail (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/747562)
[] ext.growthExperiments.Homepage.Discovery.scripts, ext.growthExperiments.Homepage.Discovery.styles (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/747622)
[] ext.growthExperiments.Homepage.Logger
[] ext.growthExperiments.Homepage.Logging
[] ext.growthExperiments.Homepage.RecentQuestions
[] ext.growthExperiments.Homepage.Impact
[] ext.growthExperiments.Homepage.Mentorship
[] ext.growthExperiments.Homepage.SuggestedEdits
[] ext.growthExperiments.Homepage.StartEditing
[] ext.growthExperiments.PostEdit
[x] ext.growthExperiments.confirmEmail.createAccount (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/743153)
[x] ext.growthExperiments.welcomeSurveyLanguage (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/743144)
[x] ext.growthExperiments.MentorDashboard (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/719247/)
Done via {T289211}:
[x] ext.growthExperiments.AddLink.onboarding
[x] ext.growthExperiments.AddLink
[x] ext.growthExperiments.AddLink.mobile
[x] ext.growthExperiments.AddLink.desktop