[GreenDonut] Re-add Page<T>.Items#9420
Conversation
There was a problem hiding this comment.
Pull request overview
Reintroduces an Items collection on Page<T> in GreenDonut and wires it through page implementations and EF paging helpers to avoid re-materializing items from entries. Also updates the v16 migration guide headings and removes a migration note about ToBatchPageAsync’s valueSelector.
Changes:
- Add
Page<T>.Itemswith optional constructor-provided backing store and fallback derivation fromEntries. - Thread the optional
itemsparameter throughValueCursorPage,ElementCursorPage, and EFToPageAsync/CreateValueCursorPage. - Documentation formatting updates in the HotChocolate v16 migration guide (including removal of a
ToBatchPageAsyncnote).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md | Adjusts migration guide headings/sections; removes a ToBatchPageAsync migration note. |
| src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs | Re-adds Items to Page<T> with lazy derivation and new ctor parameter. |
| src/GreenDonut/src/GreenDonut.Data.Primitives/ValueCursorPage.cs | Pass-through support for optional precomputed items. |
| src/GreenDonut/src/GreenDonut.Data.Primitives/ElementCursorPage.cs | Pass-through support for optional precomputed items. |
| src/GreenDonut/src/GreenDonut.Data.EntityFramework/Extensions/PagingQueryableExtensions.cs | Captures immutable items once and passes through to avoid re-derivation when Items is accessed. |
Comments suppressed due to low confidence (1)
src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs:111
Page<T>.Itemshas been reintroduced, but there are existingPageTestscovering cursor behavior and empty pages without any assertions around the newItemsproperty. Adding a couple of tests thatItemsmatches the original input (forPage.Create(...)) and is correctly derived fromEntrieswould help prevent regressions.
public ImmutableArray<T> Items => _items ??= CreateItemsFromEntries(Entries);
/// <summary>
/// Gets the number of items in this page.
/// </summary>
public int Count => Entries.Length;
/// <summary>
/// Gets the item at the specified index.
/// </summary>
/// <param name="index">
/// The zero-based index of the item.
/// </param>
public T this[int index] => Entries[index].Item;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9420 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
76f30de to
8288515
Compare
8288515 to
b65ee19
Compare
No description provided.