Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dio] 💡 Improve comments #1772

Merged
merged 31 commits into from
Jul 23, 2023
Merged

[dio] 💡 Improve comments #1772

merged 31 commits into from
Jul 23, 2023

Conversation

AlexV525
Copy link
Member

@AlexV525 AlexV525 commented Mar 28, 2023

  • adapters
  • dio
  • transformers
  • cancel token
  • dio error
  • dio mixin
  • form data
  • headers
  • multipart file
  • interceptors
  • options
  • parameters
  • response
  • redirect record

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

@AlexV525 AlexV525 added the e: documentation Improvements or additions to documentation label Mar 28, 2023
Copy link
Contributor

@ueman ueman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First batch of feedback. Great work so far! That must have been really tedious

dio/README.md Outdated Show resolved Hide resolved
dio/lib/dio.dart Outdated Show resolved Hide resolved
dio/lib/src/adapter.dart Outdated Show resolved Hide resolved
dio/lib/src/adapters/browser_adapter.dart Outdated Show resolved Hide resolved
dio/lib/src/adapters/browser_adapter.dart Outdated Show resolved Hide resolved
dio/lib/src/cancel_token.dart Outdated Show resolved Hide resolved
dio/lib/src/cancel_token.dart Outdated Show resolved Hide resolved
@AlexV525
Copy link
Member Author

Thanks for the review @ueman. I was attending some offline meetings and paused the OSS work for about 2-3 weeks. Will continue soon, maybe the next Monday.

Copy link
Contributor

@ueman ueman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second batch.

/// dio.options.headers = {HttpHeaders.userAgentHeader: 'dio', 'common-header': 'xx'};
/// ```
/// 2. create and config it:
/// The abstraction class users can use directly by the unnamed constructor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you're trying to say.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The abstracted class for users to easily make HTTP request. ? The idea is to tell them this is a simple class they can use directly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to say that it's an abstract class. Dart & Flutter use this pattern too in various places and they never mention something like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, I don't have a strong opinion on this. Feel free to merge anyway

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to write this to keep it simple: Dio enables you to make HTTP requests easily.

dio/lib/src/dio.dart Outdated Show resolved Hide resolved
dio/lib/src/dio.dart Outdated Show resolved Hide resolved
dio/lib/src/dio.dart Outdated Show resolved Hide resolved
dio/lib/src/dio_mixin.dart Outdated Show resolved Hide resolved
dio/lib/src/options.dart Show resolved Hide resolved
dio/lib/src/response.dart Show resolved Hide resolved
dio/lib/src/response.dart Outdated Show resolved Hide resolved
dio/lib/src/transformer.dart Outdated Show resolved Hide resolved
dio/lib/src/transformer.dart Outdated Show resolved Hide resolved
@AlexV525 AlexV525 linked an issue Apr 25, 2023 that may be closed by this pull request
# Conflicts:
#	dio/lib/src/adapters/io_adapter.dart
#	dio/lib/src/dio_exception.dart
#	dio/lib/src/dio_mixin.dart
#	dio/lib/src/options.dart
#	dio/test/basic_test.dart
#	dio/test/cancel_token_test.dart
#	dio/test/stacktrace_test.dart
@AlexV525
Copy link
Member Author

All code comments are updated (probably).

# Conflicts:
#	dio/lib/src/transformers/sync_transformer.dart
@AlexV525 AlexV525 marked this pull request as ready for review July 10, 2023 03:03
@AlexV525 AlexV525 requested a review from a team as a code owner July 10, 2023 03:03
dio/lib/src/adapter.dart Outdated Show resolved Hide resolved
@AlexV525 AlexV525 requested review from kuhnroyal and ueman July 12, 2023 02:23
Signed-off-by: Alex Li <[email protected]>
@AlexV525
Copy link
Member Author

@ueman I'll be waiting until you've confirmed the above comments are resolved.

@AlexV525 AlexV525 merged commit 04ca761 into main Jul 23, 2023
31 checks passed
@AlexV525 AlexV525 deleted the improve-comments branch July 23, 2023 17:01
Comment on lines -308 to -329
@override
Future<Response> download(
String urlPath,
dynamic savePath, {
ProgressCallback? onReceiveProgress,
Map<String, dynamic>? queryParameters,
CancelToken? cancelToken,
bool deleteOnError = true,
String lengthHeader = Headers.contentLengthHeader,
Object? data,
Options? options,
}) {
throw UnsupportedError(
'download() is not available in the current environment.',
);
}

/// Make http request with options.
///
/// [uri] The uri.
/// [data] The request data
/// [options] The request options.
Copy link

@mbfakourii mbfakourii Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexV525
Why is the ‍download removed?!

I think this must be a broken change, we encountered problems in the implementation of the packages!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been moved to specific adapters with more precise exceptions thrown, and it hasn't actually done anything before.

Filed PR for this: #1916

Copy link

@mbfakourii mbfakourii Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been moved to specific adapters with more precise exceptions thrown, and it hasn't actually done anything before.

Filed PR for this: #1916

Yes, but at least it would have been better if the developers were informed. Anyway, thanks for solving the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extra data gets lost in ResponseBody
4 participants