Style guide should specify what should be exported by a library #1349
Comments
This is probably a bit out of scope for the style guide, but I agree it would be useful to document somewhere. (And, in this case, the answer is no, you don't generally need to export a library just because a type from it is in your public API.) |
Yea just wasn't sure what the logic is for exporting other libraries that are outside your package. It seemed like in general it was a don't export anything outside your jurisdiction but there's no docs with guidelines anywhere. |
Lasse, Florian, Natalie, Bob... they have this kind of knowledge. It'd be good to have a library design guide of some sort. |
Article would be great too. |
This is true except when the library is in your package. You should make sure that any types defined in package-private libraries but used in your public API are exported as part of that public API. |
This issue was moved to dart-lang/site-www#67 |
Its not clear from the style guide what is acceptable to export by a library.
As a contrived example lets say I have a package foo that uses a package bar.
If a client of Foo is likely to use doBar its not clear if there should be an `export 'package:bar/bar.dart' in foo.dart, or if the library consumer should assume that if they want to use the method that they will then need to add bar to their pubspec and import it separately.
The text was updated successfully, but these errors were encountered: