Open Reprevise opened 10 months ago
CC @brianquinlan
Seems rather complicated, and not necessarily well suited to be implemented in pure Dart.
Using an existing native implementation can be both more efficient and more consistent.
And it's not something that needs to be in the platform libraries. Definitely not in dart:io
, possibly dart:convert
, but a separate package is a much better fit. We don't have any compression algorithms on the platform libraries today.
I'd like to see HttpClient
support Brotli as well (in addition to gzip), so if it were to be added to a package, would that still be possible?
We don't have any compression algorithms on the platform libraries today.
We do support gzip: https://api.dart.dev/stable/3.2.4/dart-io/gzip-constant.html And (as @Reprevise mentions) HttpClient supports Gzip-encoded responses by default.
Would be cool to support brotli here.
The Dart team should consider adding the Brotli compression format from Google to the language. There are a number of implementations in different languages in the official repository.
While there are a couple of community packages that deal with Brotli, the one implemented in pure Dart has some unresolved issues and es_compression uses FFI. A pure Dart implementation would be ideal, in addition to official support from the Dart team.