Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve performance of Table node #211

Merged
merged 18 commits into from
May 18, 2024
Merged

Conversation

stone-lyl
Copy link
Collaborator

@stone-lyl stone-lyl commented May 16, 2024

Before After
image image
image image

After the table receives over 10K items, try scrolling through the table to see the performance.

10000-scroll.mp4

- Refactor ItemCollection to ensure headers and rows fallback to empty arrays
- Include useMemo and useReactTable hooks for optimizing re-renders
- Integrate virtualization with useVirtualizer for large data sets
- Extracted TableHandleComponent for better code modularity
- Created LoadingComponent to improve readability when data fetch is pending
- Cleaned up redundant code and improved logic for rendering table & cells
- Added unique id and custom cell rendering logic to table headers
- Adjusted virtualizer estimateSize and container height for consistency
- Simplified cell rendering and upgraded header z-index for visibility
- Adjust TRUNCATE_CELL_LENGTH for cell content truncation length
- Implement defaultColumn sizing for consistent column behavior
- Increased TRUNCATE_CELL_LENGTH constant from 15 to 50 characters
- Removed width full restriction to improve component flexibility
- Cleaned up flex and grid usage for better performance
- Set default viewport size in Cypress configuration
- Refactor TableNodeComponent tests for readability and maintenance
Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
data-story-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 9:19am

@ajthinking ajthinking merged commit ee18027 into ajthinking:main May 18, 2024
2 checks passed
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.

None yet

2 participants