refactor(core)!: remove interactiveNodes & the built-in pointer hit-test#57
Merged
Conversation
…ture BREAKING CHANGE: removes the node `interactive` prop and the Stage pointer hit-test API (`getNodeFromPosition`, `findNodesAtPoint`). `Stage.interactiveNodes` was a Set that nodes added themselves to (via the `interactive` setter) but were never removed from on destroy — a strong-ref leak that pinned every destroyed interactive node for the life of the session. Rather than patch the leak, this removes the whole feature, which existed only to back the rarely-used built-in pointer hit-test. Removed: - `Stage.interactiveNodes`, `Stage.findNodesAtPoint`, `Stage.getNodeFromPosition` - the exported `Point` type (only used by those hit-test signatures) - `CoreNode` `interactive` getter/setter, the `interactive` prop on `CoreNodeProps` (and thus the public `INodeProps`), its constructor handling and its default in `resolveNodeDefaults` - `pointInBound` in core/lib/utils (dead once the hit-test was removed) - the `detect-touch` example (a demo of this feature) Apps that relied on the built-in hit-test should implement point-in-bounds testing against their own node references in application code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
SolidTV has it's own useMouse and touch detection. |
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.
Why
Stage.interactiveNodesis aSet<CoreNode>that nodes add themselves to via theinteractivesetter — but nothing ever removes them (nodeleteexists anywhere, andCoreNode.destroy()doesn't touch it). Since the Set holds a strong reference, every destroyed interactive node — and its whole subtree of props/transforms/texture refs — is pinned for the life of the session. On a long-lived embedded session this leaks one node per destroyed interactive node, and also slows every hit-test as the Set grows.This was flagged as a HIGH-severity leak in the audit behind #56. Per direction, rather than patch the accounting we're removing the whole feature, which existed only to back a rarely-used built-in pointer hit-test.
What's removed
Stage.interactiveNodes,Stage.findNodesAtPoint(),Stage.getNodeFromPosition()Pointtype (only used by those hit-test signatures)CoreNodeinteractivegetter/setter, theinteractiveprop onCoreNodeProps(and therefore the publicINodeProps), its constructor handling, and its default inStage.resolveNodeDefaultspointInBound()incore/lib/utils— dead once the hit-test was gone (not part of the publicexports/)examples/tests/detect-touch.ts— a demo of this exact feature (examples auto-discover via glob, so no registry edit needed; it had no visual-regression snapshot)node.interactive/interactive: truein props no longer exists.renderer.stage.getNodeFromPosition()andfindNodesAtPoint()are gone.Pointtype is no longer exported.Apps that relied on the built-in hit-test should do point-in-bounds testing against their own node references in application code (the engine no longer maintains a global interactive registry).
Testing
pnpm buildclean; full unit suite green (266 tests); lint clean (lint-staged on commit).🤖 Generated with Claude Code