Repository navigation
feat: add TinyFlashList, a minimal FlashList with cell recycling - #3
Merged
Merged
Conversation
mdjastrzebski
force-pushed
the
claude/minimal-flash-list
branch
from
October 6, 2026 11:12
c7483ef to
a2c61f7
Compare
mdjastrzebski
changed the base branch from
claude/minimal-flat-list-api-mkmand
to
main
October 6, 2026 11:12
MiniFlashList keeps FlashList v2's core mechanisms in small, readable files: - LinearLayoutManager: a layout for every item, estimates from the average measured size, binary search for the items in an offset range. - computeEngagedRange: viewport plus drawDistance on each side. - RenderStack: recycle keys reused across items of the same type. - A layout effect that measures cells synchronously before paint and re-renders until the layout settles. The example app can switch between NaiveList and MiniFlashList. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zUjsSmEnFHTMD6LrCrjyQ
Explain recycling and the four render steps in plain language, and itemize what is implemented from FlashList and what is not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zUjsSmEnFHTMD6LrCrjyQ
mdjastrzebski
force-pushed
the
claude/minimal-flash-list
branch
from
October 6, 2026 12:08
db505c9 to
2d870d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
TinyFlashList, a minimal version of FlashList v2 (refs/flash-list). It keeps FlashList's core mechanisms and puts each one in a small file a reader can follow:offset,size) for every item. Unmeasured items use the average measured size. Binary search finds the items in an offset rangelayout-manager.tsLayoutManager.ts,LinearLayoutManager.ts,findVisibleIndex.tsdrawDistance(250 px) on each sideengaged-indices.tsEngagedIndicesTracker.tsgetItemTyperender-stack.ts,ViewHolder.tsxRenderStackManager.ts,ViewHolder.tsxmeasureLayout(Fabric) and re-renders until nothing moves (max 10 passes)TinyFlashList.tsx,measure-layout.tsRecyclerView.tsx,measureLayout.tsViewHolder.tsxViewHolder.tsxTinyFlashList.tsxRecyclerViewManager.tssrc/TinyFlashList/README.mdexplains the algorithm in plain language and itemizes what is and is not implemented from FlashList. The main omissions are velocity projection and the direction-skewed buffer, progressive first render, bounded relayout,keyExtractorand scroll anchoring, the recycle-pool limit, and the rest of the API.Other changes
measure-layout.web.ts: react-native-web'smeasureLayoutis async, so on web DOM sizes are read directly (FlashList does the same).TinyFlashListtab. Every 20th row is a section header, which givesgetItemTypetwo types to work with.Known limitations
renderItemmust be stable, becauseViewHolderis memoized.useRecyclingState.Testing
yarn typecheck,yarn lintandyarn test(59 tests) pass on the rebased branch.🤖 Generated with Claude Code
https://claude.ai/code/session_014zUjsSmEnFHTMD6LrCrjyQ