-
Notifications
You must be signed in to change notification settings - Fork 4
!fix(viewer): pass *Context
into viewer.Render
#50
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
Conversation
Reviewer's Guide by SourceryThis pull request updates the Sequence diagram for the updated rendering processsequenceDiagram
participant App
participant Context
participant Viewer
participant ResponseWriter
App->>Context: Creates Context
App->>Viewer: Calls Render(ctx, data)
activate Viewer
Viewer->>Context: Accesses Request data
Viewer->>Context: Accesses Response data
Viewer->>ResponseWriter: Writes content
deactivate Viewer
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cnlangzi - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a method to the
Context
to return aNewResponseWriter
to avoid duplication in the tests. - It looks like
Context.values
is nowContext.Values
, so update the comment to reflect this change.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Here's the code health analysis summary for commits Analysis Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #50 +/- ##
==========================================
+ Coverage 94.00% 94.13% +0.12%
==========================================
Files 54 54
Lines 2203 2200 -3
==========================================
Hits 2071 2071
+ Misses 98 96 -2
+ Partials 34 33 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Changed
func(*Context,any) error
inViewer
. It bringsContext
into template.Bind
Fixed
Added
Tests
Tasks to complete before merging PR:
make unit-test
to check for any regressions 📋make lint
to check for any issuesSummary by Sourcery
Pass the
*Context
object to viewerRender
methods, enabling access to request and response information within viewers. Update the contribution guidelines to use the Apache 2.0 license and add badges to the README.Enhancements:
*Context
to theRender
methods of all viewers.Context
to useValues
instead ofvalues
.*Context
inapp.HandleFile
andapp.HandlePage
handlers.*Context
when calling viewerRender
methodsDocumentation: