Skip to content

Comments

Angular 21#365

Merged
dhilt merged 20 commits intomasterfrom
issue-364-Tracking-Warning-on-Angular-21
Feb 16, 2026
Merged

Angular 21#365
dhilt merged 20 commits intomasterfrom
issue-364-Tracking-Warning-on-Angular-21

Conversation

@dhilt
Copy link
Owner

@dhilt dhilt commented Feb 9, 2026

Upgrade ngx-ui-scroll ecosystem to Angular 21 (library, demo app, tests, and related tooling/dependencies).

As part of the migration, fix Angular 21 warning NG0956 by switching item tracking from object identity to stable item.uid, aligned with vscroll persistent item identity updates.

Also expands adapter test coverage to validate uid uniqueness and stability across operations like update/append/prepend/clip/reset/reload/remove.

@dhilt
Copy link
Owner Author

dhilt commented Feb 9, 2026

On issue #364 (track by identity warning).

Plan for possible fixes

  1. Optional external trackBy

Add a config for custom trackBy (on datasource?).
Only used when explicitly enabled (not default).

  1. Stabilize Item object identity in core

Goal: minimize recreation of Item objects.
Do a buffer diff and reuse existing Items, mutating $index, data, size instead of creating new ones.
Touches vscroll core logic, higher regression risk.

  1. Introduce a stable uid on Item

Add a uid field and use track item.uid.
uid must survive “logical continuity” across cycles.
Requires a mechanism to persist/transfer uid (see next item).

  1. Maintain a uid registry by datasource position

Keep a map index -> uid.
Adjust the map on insert/remove/update with proper shifting (fixRight aware).
Gives a stable uid per logical position, independent of user data.
Risk: if data changes at the same index, uid stays the same (position identity, not data identity).

@dhilt dhilt marked this pull request as ready for review February 16, 2026 10:38
@dhilt dhilt force-pushed the issue-364-Tracking-Warning-on-Angular-21 branch from 7b801a3 to 19feea3 Compare February 16, 2026 10:51
@dhilt dhilt force-pushed the issue-364-Tracking-Warning-on-Angular-21 branch from 19feea3 to a6a9e15 Compare February 16, 2026 11:23
@dhilt dhilt merged commit bb476c8 into master Feb 16, 2026
2 checks passed
@dhilt dhilt deleted the issue-364-Tracking-Warning-on-Angular-21 branch February 16, 2026 11:38
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