-
-
Notifications
You must be signed in to change notification settings - Fork 202
Performance: Remove avatarUrl convert overhead in DevIndex Contributor Model #9309
Description
The DevIndex backend spider engine fetches raw avatar_url from the GitHub REST API. Previously, the DevIndex.model.Contributor was performing an expensive convert operation on instantiation to map this into a full URL format under the avatarUrl field.
To optimize performance for 50k+ records, this ticket removes the convert overhead. The model now maps the raw ID string into the avatarUrl field directly.
Consequently, the UI components (GitHubUser, GitHubOrgs, and ProfileContainer) have been updated to smartly detect if avatarUrl is a full HTTP string or just an ID, dynamically constructing the https://avatars.githubusercontent.com/... link at render time. This maintains compatibility for both the highly optimized DevIndex app and general framework usage.
Changes:
apps/devindex/model/Contributor.mjs: Removedconvertoverhead foravatarUrlandorganizations.apps/devindex/view/home/ProfileContainer.mjs: UpdatedgetAvatarUrl()to handle raw IDs.src/component/GitHubUser.mjs: Updated URL construction logic.src/component/GitHubOrgs.mjs: Updated URL construction logic.src/grid/column/GitHubUser.mjs: MappedavatarUrlfromrecord.avatarUrl.