http
http copied to clipboard
Investigate ways to reduce bundle size on web
Since we now recommend package:http as instead of the web specific APIs, we should investigate ways to reduce the bundle size added by using the package.
Using just the top-level read function in https://github.com/dart-lang/dartdoc/pull/3613/commits/a845d390104dd7862979c1b192f4b5d933959873, increased my -O4 bundle size by 75KB.
A lot of this comes from the internal use of MediaType from package:http_parser and its dependencies for parsing (package:source_span). Particularly package:source_span and its highlighting, reporting, and prettifying Uris.
Windows Uri parsing is showing up a bit despite being unused as well. I opened https://github.com/dart-lang/sdk/issues/54474 to track a fix for this in the core libraries.