Refactor : Optimize Random Sorting for Contributors.
Currently, the contributor avatars in community file are randomized using -
However, this method produces non-deterministic results, meaning the order changes on every build. This leads to inconsistent static builds and unnecessary re-renders in production.
Proposed fix - Use a deterministic shuffle algorithm (like Fisher-Yates) to ensure stable randomization across builds.
function shuffleArray(array) { let m = array.length, i; while (m) { i = Math.floor(Math.random() * m--); [array[m], array[i]] = [array[i], array[m]]; } return array; }
const contributors = shuffleArray( imageData.filter( (c) => c.login !== 'the-json-schema-bot[bot]' && c.login !== 'dependabot[bot]' ) ).slice(0, 60);
Please assign this issue to me, I’d like to work on this improvement. @Utkarsh-123github @vtushar06
Thanks for the suggestion, @SHASHI9705! This seems like a neat optimization for build consistency. Since it doesn’t have a major impact on user-facing behavior, I think we could possibly revisit it later when there’s a broader focus on performance or build stability.
Utkarsh-123github — what do you think? Should we go ahead with this now or keep it for a later milestone?