dart-lang/dartdoc

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:

And then some other paths that are more like the Flutter SDK libraries:

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.