In short, fixes a problem with how module importing and resolution was working for the app directory.
We were mixing two things which was a bad combo...
index.ts style indexing in all our subdirectories
"Unwrapped" code -- code statements defined at the top level (not wrapped in functions or class definitions), which executes as soon as the module is first loaded.
This means if anyone imported anything from the app index, they were running core redux code at import time. This lead to some weird race conditions where redux thought it was getting undefined reducers. This didn't cause production bugs, just console errors, but still pointed to a troubling cocktail.
We're going to keep using the index convention for now, which means that all code in indexed directories should be thoughtfully wrapped (unless it's just exporting constant static values, e.g.)
What Does This PR Add/Change?
In short, fixes a problem with how module importing and resolution was working for the
app
directory.We were mixing two things which was a bad combo...
index.ts
style indexing in all our subdirectoriesThis means if anyone imported anything from the
app
index, they were running core redux code at import time. This lead to some weird race conditions where redux thought it was getting undefined reducers. This didn't cause production bugs, just console errors, but still pointed to a troubling cocktail.We're going to keep using the index convention for now, which means that all code in indexed directories should be thoughtfully wrapped (unless it's just exporting constant static values, e.g.)
Testing Instructions
yarn start
)Issues
Related to #
Closes #10