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

feat(#101) split hook methods in mixins to maximize atomicity and type safety #102

Merged
merged 6 commits into from
Oct 24, 2024

Conversation

francescovallone
Copy link
Owner

@francescovallone francescovallone commented Oct 24, 2024

Description

Proposed mixins and methods that will expose:

OnRequestResponse: onRequest, onResponse;
OnBeforeHandle: beforeHandle (valid also for route);
OnAfterHandle: afterHandle (valid also for route);
OnTransform: transform (valid only for route);

We reduce the overhead of the request handler because it won't have to iterate through all the hooks but only through the hooks with that specific mixin.

Fixes #101

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 95.04132% with 6 lines in your changes missing coverage. Please review.

Project coverage is 90.67%. Comparing base (290dea8) to head (6219282).
Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
packages/serinus/test/core/hook_test.dart 92.98% 4 Missing ⚠️
...ckages/serinus/lib/src/http/internal_response.dart 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #102      +/-   ##
===========================================
+ Coverage    90.30%   90.67%   +0.36%     
===========================================
  Files           77       79       +2     
  Lines         2910     2981      +71     
===========================================
+ Hits          2628     2703      +75     
+ Misses         282      278       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@francescovallone francescovallone merged commit 3d0e95c into develop Oct 24, 2024
6 checks passed
@francescovallone francescovallone deleted the feat/101 branch October 24, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant