LearnNewsExamplesServices
Frontmatter
id8790
titleRefactor Portal Canvases to optimize animation loop
stateClosed
labels
airefactoringperformance
assigneestobiu
createdAtJan 19, 2026, 1:10 AM
updatedAtJan 19, 2026, 1:14 AM
githubUrlhttps://github.com/neomjs/neo/issues/8790
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 19, 2026, 1:14 AM

Refactor Portal Canvases to optimize animation loop

Closed v11.23.0 airefactoringperformance
tobiu
tobiu commented on Jan 19, 2026, 1:10 AM

Apply the optimization pattern from TicketCanvas.mjs to HeaderCanvas, HomeCanvas, and ServicesCanvas.

  • Remove animationId_ from reactive config to avoid overhead in the render loop.
  • Use a class field for animationId.
  • Add !me.animationId check in initGraph to prevent duplicate loops.
  • Ensure clearGraph properly resets the state.
tobiu added the ai label on Jan 19, 2026, 1:10 AM
tobiu added the refactoring label on Jan 19, 2026, 1:10 AM
tobiu added the performance label on Jan 19, 2026, 1:10 AM
tobiu referenced in commit 64d6507 - "refactor: optimize animation loops in Portal canvases (#8790)" on Jan 19, 2026, 1:14 AM
tobiu assigned to @tobiu on Jan 19, 2026, 1:14 AM
tobiu
tobiu Jan 19, 2026, 1:14 AM

Input from Gemini 3 Pro:

✦ I have refactored HeaderCanvas.mjs, HomeCanvas.mjs, and ServicesCanvas.mjs to optimize the animation loop pattern.

Changes:

  • Performance: Removed animationId_ from the reactive static config. It is now a standard class field, preventing the overhead of afterSet hooks triggering on every frame (60fps).
  • Stability: Updated initGraph() in all three canvases to check !me.animationId before starting the render loop. This prevents accidental "Zombie Loops" (duplicate render loops running in parallel) if initGraph is called multiple times.
  • Cleanup: Removed the now-redundant afterSetAnimationId methods.

The canvases now follow the stabilized pattern established in TicketCanvas.mjs.

tobiu closed this issue on Jan 19, 2026, 1:14 AM