Virtualization Roadmap #4007
zbeyens
started this conversation in
Feature Requests
Replies: 1 comment 5 replies
-
I am trying to use Virtualization to optimize large text, but recently when I was browsing the PR of slatejs, I found that @12joan optimized the rendering by Experimental chunking optimisation and other performance improvements. Will paltejs follow up on this experimental feature? This will determine whether I will continue to try to use Virtualization. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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