Skip to content

Simplify Table internals & enhance React integration#57

Merged
shudv merged 4 commits into
mainfrom
shudv/next
Dec 24, 2025
Merged

Simplify Table internals & enhance React integration#57
shudv merged 4 commits into
mainfrom
shudv/next

Conversation

@shudv
Copy link
Copy Markdown
Owner

@shudv shudv commented Dec 24, 2025

Simplify Table internals & enhance React integration

Summary

Simplifies Table implementation by removing complex incremental view updates in favor of straightforward memoization refresh, while enhancing the React useTable hook with automatic memoization management.

Changes

Core (Table.ts)

  • 🗑️ Removed _applyViewUpdate incremental merge algorithm — replaced with simpler _refreshMemoization that rebuilds sorted arrays on change
  • 🗑️ Removed _keyComparator helper and _allocateEmptyArray utility
  • 🗑️ Removed default partition (__DEFAULT_PARTITION__) concept — partition() now requires explicit name
  • ✨ Simplified entries() iterator to derive values from keys

React Integration (useTable.tsx)

  • ✨ Added memo parameter (default: true) to control memoization
  • ✨ Auto-memoizes table on mount, un-memoizes on unmount
    Tests
  • ✅ Added lifecycle test suite verifying subscribe/memo called once on mount
  • ✅ Added memoization test suite for opt-in/opt-out behavior
  • 🔧 Reorganized existing tests into renders describe block

Demo

  • 🎨 New simplified PerfApp for performance comparison
  • 📸 Added demo GIF to README

Breaking Changes

  • partition() no longer accepts empty call — must provide partition name

@shudv shudv changed the title wip Simplify Table internals & enhance React integration Dec 24, 2025
@shudv shudv merged commit 9592c12 into main Dec 24, 2025
1 check passed
@shudv shudv deleted the shudv/next branch December 24, 2025 23:09
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