Rethink singleton docs
As discussed in the team call, I believe our singleton guidelines aren't developer friendly.
https://docs.gitlab.com/ce/development/fe_guide/design_patterns.html#singletons
GitLab is aaaaaaall about the ability the iterate rapidly. Let's reflect this in our development guidelines by rating the simplest practises the highest.
My opinon
Currently, our best singleton is a hack with boilerplate, our good singleton is not terrible, but the final result has a number of inheritance-related problems (it also has an import sideeffect, but its not the worst sideeffect because it should be calling a sideeffect-less constructor). The bad singleton is the simplest out of all them, as well as being the closest to a singleton that javascript can get.
Please share your opinions. I understand that there may be cases where the pattern we use would be better as some sort of class.
How do you think these docs should be written? Should we give a single recommended pattern or should we offer a number of patterns and rank them?