-
Notifications
You must be signed in to change notification settings - Fork 958
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
[lit-labs/observers] add base class #3386
base: main
Are you sure you want to change the base?
Conversation
Focus of this change was to tackle the simple cases and remove all the duplicated logic.
🦋 Changeset detectedLatest commit: 3d70087 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultslit-element-list
render
update
update-reflect
lit-html-kitchen-sink
render
update
nop-update
lit-html-repeat
render
update
lit-html-template-heavy
render
update
reactive-element-list
render
update
update-reflect
|
b6b3719
to
094f560
Compare
import { | ||
ObserverController, | ||
type ObserverControllerConfig, | ||
} from './observer_controller.js'; |
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.
nit: I noticed a lot of other lit packages use kebab case instead of snake case for file naming. Is it worth changing the names of these controllers to normalize consumption with the remainder of the lit repo?
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.
I just did this here: #3771
Lit's When using |
Issue: #2350
This PR adds a base class to IntersectionController, ResizeController, and MutationController.
Fixed a bug where we accept a ResizeController config and then never use it. Fixed by passing the config to
ResizeController.observe
which was not previously done.The rest of this change is only a refactor. Adding a new base class
ObserverController
.To support adding the base class some properties needed their visibility changed from
private
toprotected
.Size
With this PR:
On
main
:Test plan
Tested by ensuring all tests continue passing unchanged.