It's a ridiculously simple header-theme-only plugin.
------------
const stagingTheme = document.createElement('style');
stagingTheme.innerHTML = `
html {
--header-title-content: "Staging";
--header-background-color: #FFE4DB; //(yes, I know, it's horrible)
--header-text-color: #000
}
`;
document.head.appendChild(stagingTheme);
----------
But no, it was missing the Gerrit.install() call.
I wrapped it in
Gerrit.install(plugin => {
<theme code here>
});
and it stopped complaining (no more timeout, works as expected).
Thanks for spotting the silly mistake, Ben!
What threw us off was that the old documentation for the RegisterStyleModule includes the Gerrit.install(), but the new one [1] does not.
It is however mentioned at the top of the same file [2].
BR
Rikard
[1]
https://gerrit-review.googlesource.com/c/gerrit/+/331259/1/Documentation/pg-plugin-dev.txt#107[2]
https://gerrit-review.googlesource.com/c/gerrit/+/331259/1/Documentation/pg-plugin-dev.txt#27