Having an index barrel with all available exports can be very useful for readability and makes it easier to move/rename the implementation files. (Think __init__.py indexes in python.) It also allows for implicit private exports which can be more easily respected by a module consumer.
That said, export * from 'foo' introduces magic that may in fact produce more opaque code instead. Prefer explicitly exporting the relevant symbols as an actual index.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sorta. Don't do that... with a blanket export.
Having an index barrel with all available exports can be very useful for readability and makes it easier to move/rename the implementation files. (Think
__init__.py
indexes in python.) It also allows for implicit private exports which can be more easily respected by a module consumer.That said,
export * from 'foo'
introduces magic that may in fact produce more opaque code instead. Prefer explicitly exporting the relevant symbols as an actual index.