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

SlateJS: First time rendering #324

Open
mkoskim opened this issue Jan 21, 2025 · 0 comments
Open

SlateJS: First time rendering #324

mkoskim opened this issue Jan 21, 2025 · 0 comments
Labels
performance Features to improve performance

Comments

@mkoskim
Copy link
Owner

mkoskim commented Jan 21, 2025

Rendering the editor view takes a lot of time. I examined it a bit, and the root reason seems to be the React rendering. What SlateJS does is that it creates a React component from everything, including the text fragments. When you have lots of small fragments (scenes, paragraphs and so on), it results to large number of React components, and it takes a time to render it.

When creating release builds this eases a bit, as the build is somewhat optimized.

There is not much to do if I keep using SlateJS. So, at some point, we might need to consider changing the underlaying editor component to something that performs better with large text blocks. I know there exists some, but most of them can not handle nested structures. With those, you need to have mechanism to "flatten" the nested structure to editor component, and "re-nest" it back when reading the content from editor.

@mkoskim mkoskim added the performance Features to improve performance label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Features to improve performance
Projects
None yet
Development

No branches or pull requests

1 participant