Stop accessing data from window.context in core parts of our logic
Created by: ijsnow
We store data on window.context
. This makes writing unit tests hard because they will fail when trying to access data from there. It is also generally bad practice to extend globals in JS.
We should either:
- Stop storing data there and fetch all data as we do in
siteFlags
- Change code architecture to only access global variables like this and pass it through the react application with react context (not props everywhere like
isLightTheme
). We can then use this info to create things likeeventLogger
on the fly rather than importing it as a global variable. - Both?