Skip to content

refactor(core)!: remove interactiveNodes & the built-in pointer hit-test#57

Merged
chiefcll merged 1 commit into
mainfrom
chore/remove-interactive-nodes
Jun 4, 2026
Merged

refactor(core)!: remove interactiveNodes & the built-in pointer hit-test#57
chiefcll merged 1 commit into
mainfrom
chore/remove-interactive-nodes

Conversation

@chiefcll
Copy link
Copy Markdown
Contributor

@chiefcll chiefcll commented Jun 4, 2026

Why

Stage.interactiveNodes is a Set<CoreNode> that nodes add themselves to via the interactive setter — but nothing ever removes them (no delete exists anywhere, and CoreNode.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()
  • the exported Point type (only used by those hit-test signatures)
  • CoreNode interactive getter/setter, the interactive prop on CoreNodeProps (and therefore the public INodeProps), its constructor handling, and its default in Stage.resolveNodeDefaults
  • pointInBound() in core/lib/utils — dead once the hit-test was gone (not part of the public exports/)
  • 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)

⚠️ Breaking changes

  • node.interactive / interactive: true in props no longer exists.
  • renderer.stage.getNodeFromPosition() and findNodesAtPoint() are gone.
  • The Point type 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 build clean; full unit suite green (266 tests); lint clean (lint-staged on commit).
  • No new tests — this is a pure removal; existing suites still pass and no test referenced the feature.
  • No visual-regression impact (no snapshot existed for the removed example).

Note: I hit stale incremental dist-vitest/ artifacts locally (compiled test files lingering from another branch's build) producing phantom failures — purged with a clean rebuild. CI builds fresh, so it's unaffected.

🤖 Generated with Claude Code

…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>
@chiefcll
Copy link
Copy Markdown
Contributor Author

chiefcll commented Jun 4, 2026

SolidTV has it's own useMouse and touch detection.

@chiefcll chiefcll merged commit d3b571e into main Jun 4, 2026
1 check passed
@chiefcll chiefcll deleted the chore/remove-interactive-nodes branch June 4, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant