fix(lit-virtual): add setOptions to VirtualizerController for reactive option updates - #1253
fix(lit-virtual): add setOptions to VirtualizerController for reactive option updates#1253waterWang wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesLit virtualizer option updates
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/lit-virtual/tests/index.test.tsParsing error: "parserOptions.project" has been provided for 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 |
Description
Fixes #1251
() never calls after the initial construction, so reactive option updates (a changed , , , etc.) never reach the underlying instance.
Root cause
The constructor captures options once and passes them to . The lifecycle method only calls without re-applying options. Every other framework adapter (, ) calls before every .
Fix
Added method to — stores the options on the instance, merges with new partial options, and calls + . Matches the pattern used by 's and 's injectable.
Stored as a private field — enables the method to merge partial updates with the base options (including defaults from and subclass constructors).
Consumer usage
Changes
Summary by CodeRabbit
New Features
Tests