Potential library path conflicts
srawlins opened this issue · 0 comments
The code that determines the path of the HTML file for a library is mostly contained in Library.dirName
, which quickly branches on whether a library is anonymous. The Flutter SDK uses library
directives with names, so they end up with pretty paths at api.flutter.dev
:
However, all of the other package docs that are also located at api.flutter.dev have much longer paths, seeming to use the route for anonymous libraries:
- package-boolean_selector_boolean_selector/package-boolean_selector_boolean_selector-library.html; see the lack of library directive.
- package-clock_clock/package-clock_clock-library.html; see the lack of library directive.
And then some other paths that are more like the Flutter SDK libraries:
- async/async-library.html; see the anonymous library directive (although maybe the one at api.flutter.dev is just old, as it was unnamed recently.
- flutter_test/flutter_test-library.html; see the named library directive.
Anyways, since Flutter just bundles together a few dozen dependencies at api.flutter.dev, whose library names are not controlled by Flutter, there is real potential for collisions. And the names that are preferred for api.flutter.dev are the ones with potential collisions, e.g. "animation/animation-library.html". I can easily imagine two libraries from different packages choosing the name, "async" or "element" or "testing" for a library.