fix(haunted-polymer): add resume/pause lifecycle calls for pion 2.13.0 compatibility#235
Merged
Merged
Conversation
…0 compatibility Pion 2.13.0 changed BaseScheduler._active from defaulting to true to defaulting to false. This is correct behavior - the scheduler should only be active while the element is connected to the DOM. However, hauntedPolymer's custom Scheduler extends BaseScheduler but never called resume() or pause(). It only called update() in connectedCallback and teardown() in disconnectedCallback. With pion 2.13.0, update() silently exits when _active is false, so haunted hooks never execute. This fix adds: - this._scheduler.resume() before this._scheduler.update() in connectedCallback - this._scheduler.pause() before this._scheduler.teardown() in disconnectedCallback This matches the lifecycle pattern used by pion's own component implementation.
cristinecula
approved these changes
Mar 31, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 31, 2026
## [6.20.1](v6.20.0...v6.20.1) (2026-03-31) ### Bug Fixes * **haunted-polymer:** add resume/pause lifecycle calls for pion 2.13.0 compatibility ([#235](#235)) ([941a7b2](941a7b2))
Contributor
|
🎉 This PR is included in version 6.20.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
this._scheduler.resume()beforethis._scheduler.update()inconnectedCallbackthis._scheduler.pause()beforethis._scheduler.teardown()indisconnectedCallbackProblem
Pion 2.13.0 changed
BaseScheduler._activefrom defaulting totrueto defaulting tofalse. This is the correct behavior — the scheduler should only be active while the element is connected to the DOM.However,
hauntedPolymerinhaunted-polymer.tscreates its ownSchedulerextendingBaseSchedulerand never calledresume()orpause(). It only calledupdate()inconnectedCallbackandteardown()indisconnectedCallback.With pion 2.13.0,
update()silently exits when_activeisfalse, so the haunted hook never runs. This breaks allhauntedPolymerconsumers — hooks likeuseOnline,useIndicateEnviroment,useKeybindingsetc. never execute.Solution
This fix adds the proper lifecycle calls that match exactly what pion's own component implementation does in
component.js:Testing