dart-lang / http2

A HTTP/2 implementation for dart.

Home Page:https://pub.dev/packages/http2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rename the main library to "http2.dart"

nex3 opened this issue · comments

It's a strong convention among Dart packages to have a top-level library with the same name as the package (usually as the only top-level library). It's confusing that this package is named http2 but the top-level library is named transport.dart rather than http2.dart.

This was intentional. The transitive closure of transport.dart can be made independent of dart:io if necessary. The package might nonetheless provide some helpers which use features of dart:io (e.g. Socket, ...). So http2.dart could re-export transport.dart and other helpers. (see e.g. the comment Would it be possible for this to be implemented in such a way as to optionally support use with the Chrome sockets API?)

On the other hand, in 99% of cases one doesn't care, so we could also rename it.

Maybe the best thing to do would be to rename it for now, and then if it becomes necessary to have an IO-free library in the future re-add transport.dart and export it from http2.dart.

Let's pick the best name, without worrying too much about cases like Chrome sockets APIs.