๐Ÿ“ข: Avoid Barrels

(A barrel is a file that exports code from other files)

Barrel benefits:
โœ… Shorter import paths
โœ… Support importing many files via one import
โœ… "Hide" modules - Only export some modules for the "public" interface

But, I avoid barrels. Here's why:
๐Ÿšซ Bloats the bundle. Inhibits tree shaking.
๐Ÿšซ Increases memory usage.
๐Ÿšซ Slows tooling (builds, tests, linting). Barrels create more modules to parse.
๐Ÿšซ Slows code navigation ("Find all references" finds the barrel instead of the actual source).
๐Ÿšซ Barrels shorten import paths and group related imports. Sounds nice, but it's an outdated benefit because I don't write imports anymore - my editor reliably auto-imports.