Virtualization Roadmap #4007
zbeyens
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Disclaimer: AI-generated
Below is a practical, incremental roadmap you could follow to integrate virtualization into a fork of slate-react. The overall theme is to start small (read‐only, minimal selection) and progressively add features from simple to complex, each time ensuring you have a “production-usable slice.”
0. Fork PlateStatic into PlateStaticVirtual
Since PlateStatic is read-only by design, we’ll start by adding virtualization there:
PlateStaticVirtual.tsx
fromPlateStatic.tsx
.react-window
orreact-virtualized
) in place of<Children>
.Goal:
<PlateStaticVirtual/>
that can handle thousands of nodes in read-only mode with good performance.1. Fork and Simplify (Read-only + Single-Block)
Goal: A fork of
slate-react
that only displays static (non-editable) content, with a single top-level block per line, using virtualization for rendering.<Element>
,<Text>
), but do not attach selection or input event handlers.virtua
) in place of the standard “recursive children” logic.Milestone:
2. Expand to Multi-Block + Basic Scrolling
Goal: Support nested blocks and multiple levels in the read-only tree, still with virtualization.
<VList>
for deeply nested structures).Milestone:
3. (Optional) Minimal Single-Block Selection
Goal: Let the user highlight text with the mouse and see the highlight, but keep the doc read-only.
slate-react
.Challenges:
Milestone:
4. Full Multi-Block Selection (Still Read-only)
Goal: Let the user select text across multiple blocks.
Cmd+A
, do you show all blocks highlighted or just a partial “some blocks are selected but not rendered”? (You decide based on performance vs user expectations.)Milestone:
5. Add Basic Editing in One Block at a Time
Goal: Introduce text input for a single block, but no multi-block editing.
onBeforeInput
,onInput
, composition logic for just one “active” block.Milestone:
6. Full Multi-Block Editing (Basic Features)
Goal: Expand from one-block editing to typical multi-block editing.
Milestone:
7. Edge Cases & Advanced Features
Potential “stretch” tasks:
Recommended Dev Strategy
Create a Fork
slate-react
except the rendering pipeline and a minimal read-only flow.Iterate with Clear Milestones
Focus on Test Coverage
Start Minimal:
Push to Production in Steps
Beta Was this translation helpful? Give feedback.
All reactions