Skip to content

perf: add trackBy to channel ngFor and cache anyXtream()#391

Closed
wowitsjack wants to merge 1 commit intoFredolx:mainfrom
wowitsjack:perf/home-improvements
Closed

perf: add trackBy to channel ngFor and cache anyXtream()#391
wowitsjack wants to merge 1 commit intoFredolx:mainfrom
wowitsjack:perf/home-improvements

Conversation

@wowitsjack
Copy link

@wowitsjack wowitsjack commented Mar 7, 2026

Full source available at FredTV-Next, my personal fork with all features integrated.

Summary

  • Add trackBy: trackByChannelId to the channels *ngFor loop, preventing Angular from destroying and recreating all channel tile DOM nodes on every array reassignment (search, filter change, page load)
  • Cache anyXtream() result as isAnyXtream property, set once when Sources are loaded, instead of calling the method on every change detection cycle (it iterates the entire Sources map each time)

Test plan

  • Navigate between views, search, filter by media type, verify channel tiles render correctly
  • Verify Xtream-specific UI (Series filter checkbox) still shows/hides correctly based on source types
  • Check for smoother scrolling and reduced jank on large channel lists

@CLAassistant
Copy link

CLAassistant commented Mar 7, 2026

CLA assistant check
All committers have signed the CLA.

- Add trackBy function on the channels *ngFor to prevent full DOM
  re-render when the channel array is reassigned (search, filter,
  page load)
- Cache anyXtream() result as a property instead of calling it on
  every change detection cycle (it iterates the Sources map each time)
@wowitsjack wowitsjack force-pushed the perf/home-improvements branch from c7e6bbd to ba123bf Compare March 7, 2026 00:38
@wowitsjack
Copy link
Author

wowitsjack commented Mar 7, 2026

Agreed, signed

@wowitsjack wowitsjack force-pushed the perf/home-improvements branch 2 times, most recently from 1e4a7d6 to ba123bf Compare March 7, 2026 15:54
@wowitsjack
Copy link
Author

Superseded by #396 + #397 which contribute the full FredTV-Next codebase as a proper 2-part stack.

@wowitsjack wowitsjack closed this Mar 7, 2026
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.

2 participants