-
Notifications
You must be signed in to change notification settings - Fork 123
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
✨ Restructure interceptors #547
✨ Restructure interceptors #547
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #547 +/- ##
===========================================
- Coverage 93.52% 92.85% -0.67%
===========================================
Files 12 22 +10
Lines 463 490 +27
===========================================
+ Hits 433 455 +22
- Misses 30 35 +5 ☔ View full report in Codecov by Sentry. |
…structure_interceptors
…structure_interceptors # Conflicts: # chopper/lib/src/http_logging_interceptor.dart
…structure_interceptors
…structure_interceptors
…structure_interceptors # Conflicts: # chopper/lib/chopper.dart
…some values which could be private
…structure_interceptors # Conflicts: # chopper/lib/chopper.dart
@Guldem I'll prep a pre-release PR for this baby |
@Guldem I've been using this PR in a large scale app for a week now and I just can't reiterate on how amazing this piece of work is. Thanx 🙏 |
Glad to hear, thanks! |
# chopper ## 8.0.0 - Restructure interceptors ([#547](#547)) - Add per-request timeout ([#604](#604)) # chopper_generator ## 8.0.0 - Restructure interceptors ([#547](#547)) - Add per-request timeout ([#604](#604)) ## 3.0.0 - Require Chopper ^8.0.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Job Guldemeester <job@dutchcodingcompany.com>
Restructuring interceptors
This PR/Draft contains the current progress/experimenting on restructuring interceptors. See #544 for more information on the proposal. Any feedback/help is welcome!
Description
Refactor interceptors into a chain of interceptors. This will reduce the amount of different type interceptor interfaces to 1. A
Interceptor
will be responsible for both theRequest
and theResponse
if needed.Specifying a interceptor would look like this:
All
Interceptor
are chained so theRequest
will first go down the chain of interceptors and in the last step the network call is make. TheResponse
will then go back through the chain of interceptors.Besides user created interceptors some of the internal logic have been refactor into
InternalInterceptor
.InternalInterceptors:
Progress
HeadersInterceptor
,CurlInterceptor
andHttpLoggingInterceptor
to use new interface.Breaking changes