feat(lit-query): add render method to query controllers#10791
feat(lit-query): add render method to query controllers#10791EskiMojo14 wants to merge 10 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a typed rendering utility and a ChangesRender Method Feature
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/framework/lit/guides/mutations.md (1)
172-185:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winImport
nothingin the example snippet.This example uses
nothing(Line 179) but the imports shown in this guide only includehtml/LitElement, so copy-pasting the snippet can fail.Proposed doc fix
-import { LitElement, html } from 'lit' +import { LitElement, html, nothing } from 'lit'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/framework/lit/guides/mutations.md` around lines 172 - 185, The example uses the special sentinel nothing in the render() example but the shown imports only include html/LitElement; update the snippet imports to also import nothing (e.g., from 'lit') so copy-pasting works and the pending template can return nothing; ensure the updated example shows nothing alongside html/LitElement imports and keep addTodo.render(...) and the pending/error/success handlers unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/lit-query/src/createMutationController.ts`:
- Line 72: Update the JSDoc in createMutationController.ts: replace the phrase
"query result" with "mutation result" in the comment for the accessor inside
createMutationController (the JSDoc that begins "/** Renders the query result
... */") so the description correctly refers to mutation results.
In `@packages/lit-query/src/createQueryController.ts`:
- Line 19: The import in createQueryController.ts incorrectly treats
RendererResult and ResultRenderers as runtime values; change the import to use
type-only qualifiers for RendererResult and ResultRenderers (e.g., import type {
RendererResult, ResultRenderers } from './render.js') while keeping renderResult
as a normal import, and apply the same type-only import change in
createMutationController.ts and createInfiniteQueryController.ts so all three
modules import those two symbols as types only.
---
Outside diff comments:
In `@docs/framework/lit/guides/mutations.md`:
- Around line 172-185: The example uses the special sentinel nothing in the
render() example but the shown imports only include html/LitElement; update the
snippet imports to also import nothing (e.g., from 'lit') so copy-pasting works
and the pending template can return nothing; ensure the updated example shows
nothing alongside html/LitElement imports and keep addTodo.render(...) and the
pending/error/success handlers unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bf4f14c7-08aa-4d27-a0e7-1ce5aa4b29b2
📒 Files selected for processing (13)
.changeset/crisp-sloths-sneeze.mddocs/framework/lit/guides/infinite-queries.mddocs/framework/lit/guides/mutations.mddocs/framework/lit/guides/queries.mdpackages/lit-query/src/createInfiniteQueryController.tspackages/lit-query/src/createMutationController.tspackages/lit-query/src/createQueryController.tspackages/lit-query/src/index.tspackages/lit-query/src/render.tspackages/lit-query/src/tests/infinite-and-options.test.tspackages/lit-query/src/tests/mutation-controller.test.tspackages/lit-query/src/tests/query-controller.test.tspackages/lit-query/src/tests/render.test.ts
🎯 Changes
see #10711 - adds a render method based on the query status, based on the Tasks API
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
New Features
rendermethod to query, mutation, and infinite-query controllers for state-based rendering (pending/error/success).Documentation
Exports
Tests
renderbehavior across statuses and edge cases.Chores