luis901101 / oauth_webauth

BSD 3-Clause "New" or "Revised" License
15 stars 17 forks source link

Remove http package dependency #14

Closed frederikstonge closed 1 year ago

frederikstonge commented 1 year ago

Package is unused and cause dependency conflicts with newest versions (http: ^1.1.0)

luis901101 commented 1 year ago

http package is used in OAuthConfiguration to support custom httpClient, so this plugin references the http package, because of that, it's required to be included in the dependencies in pubspec.yaml, no matter if http package is already a transitive dependency, it has to be a direct dependency of this plugin, otherwise the plugin publication fails with the following error:

Package validation found the following error:
* line 4, column 1 of lib/src/base/model/oauth_configuration.dart: This package does not have http in the `dependencies` section of `pubspec.yaml`.
    ╷
  4 │ import 'package:http/http.dart' as http;
    │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
Sorry, your package is missing a requirement and can't be published yet.
For more information, see: https://dart.dev/tools/pub/cmd/pub-lish.

What could be done is to allow a wider range of http version in the dependency so the plugin can be compatible with packages that already migrated to the new version of http as well as others that hasn't yet. Something like:

http: '>=0.13.0 <2.0.0'
frederikstonge commented 1 year ago

http package is used in OAuthConfiguration to support custom httpClient, so this plugin references the http package, because of that, it's required to be included in the dependencies in pubspec.yaml, no matter if http package is already a transitive dependency, it has to be a direct dependency of this plugin, otherwise the plugin publication fails with the following error:

Package validation found the following error:
* line 4, column 1 of lib/src/base/model/oauth_configuration.dart: This package does not have http in the `dependencies` section of `pubspec.yaml`.
    ╷
  4 │ import 'package:http/http.dart' as http;
    │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
Sorry, your package is missing a requirement and can't be published yet.
For more information, see: https://dart.dev/tools/pub/cmd/pub-lish.

What could be done is to allow a wider range of http version in the dependency so the plugin can be compatible with packages that already migrated to the new version of http as well as others that hasn't yet. Something like:

http: '>=0.13.0 <2.0.0'

Updated :)

luis901101 commented 1 year ago

Already published v4.0.1+3