You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should be very mindful about the trade-off. It might be that it makes imports looks smaller but it also hides usages of files, can affect refactorings and lead to importing more than what is needed.
I would question if this would solve a real problem for us compared to possible side effects.
It's probably more a code design smell that our features are not cleanly designed if we have a need for Barrel files.
The interest for barrel files now stems from the desire to keep feature changes encapsulated, meaning that if I change one feature, we want to minimise the amount of file changes from outside that feature. Let's talk
A barrel file is a file in a folder that exports all dart files within it.
It greatly reduces the amount of imports in files that need to refer to a feature, improving code legibility.
There's an extension that can generate these files for us.
https://marketplace.visualstudio.com/items?itemName=miquelddg.dart-barrel-file-generator
The text was updated successfully, but these errors were encountered: