Repository navigation
Split ResourceDonut's two ways of answering a hit into compositions - #330
Conversation
A donut page is stored either as its rendered template with placeholders or, when its renderer encodes embedded requests, as the body it returned. ResourceDonut told the two apart by a null body and branched on it in refresh() and render(). Each is now a DonutCompositionInterface: DonutTemplate reads every hole again into the template, DonutBody renders the body again with its requests put back. ResourceDonut keeps the storage state and the CacheStoreException boundary. create() renders the template view for the response itself, so render() is gone and DonutRepository::write() no longer calls it.
|
@coderabbitai review |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #330 +/- ##
===========================================
Coverage 100.00% 100.00%
+ Complexity 878 876 -2
===========================================
Files 121 123 +2
Lines 1965 1952 -13
===========================================
- Hits 1965 1952 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Action not completed
|
ResourceDonutanswered a hit in one of two ways and told them apart by a null$body. Each way is now its own@internalDonutCompositionInterface:DonutTemplate– the page is stored as its rendered view with a placeholder for each hole; a hit reads every hole again into it.DonutBody– the page's renderer encodes embedded requests (e.g. JSON), so it is stored as the body it returned; a hit renders that body again with its requests put back.ResourceDonutkeeps the storage state (lifetime, tags, Last-Modified, content hash) and theCacheStoreExceptionboundary around recomposition. Its constructor takes 7 arguments instead of 11.create()now leaves the rendered view on the response itself, soResourceDonut::render()is removed.ResourceDonutstays the type ofResourceStorageInterface::getDonut()/saveDonut(), andResourceDonut::placeholder()is unchanged.No behavior change; the existing suite covers both compositions.
🤖 Generated with Claude Code
Summary by CodeRabbit