In T350417 we built out the client preferences UI using a mustache template.
In T350195 we built out the client preferences UI using vanilla JS DOM manipulation.
In order to maintain consistency across the js & server-rendered versions of the UI, we should unify these implementations.
We can do that by using the Mustache template in the JS implementation.
This work involves:
- Loading the Mustache.js library on the client
- Loading the mustache template on the client
- Parsing the template with the library
- Attaching the necessary event handlers to the template and appending it to the DOM
Open questions
- The mustache.js library is about 8kb of JS (not insignificant). Does this need a specialized loading strategy, e.g. loading this on dropdown click?
- If we load this on click, do we need an intermittent dropdown state before the library & template loads?