codex-team / codex-team/editor.js

💡Render thousands of blocks freezes the app

Open
#1,191 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

**1. Describe a problem.**
Hi.
First of all, great editor, very powerfull across platforms.

We have a situation, where we need to render thousands of blocks, like so:
![image](https://user-images.githubusercontent.com/42002579/84062423-a283f680-a995-11ea-8edd-3f672a454ae4.png)

That one has a bit over a thousand blocks, but we have several that has much morer than that.
Loading that freezes the app for a few seconds, making impossible to click anything even outside the Editor. When the memory used to load that kind of data by the Editor is released, then the app works again.

This is because the Editor does a .map(), which loads the whole data, instead of (maybe) load it in chunks relative to the scroll.

**2. Describe the solution you'd like. Mockups are welcome.**
Render blocks depending on the scroll. Like FlatList on React Native, which renders content relative to the actual scroll, and there's an option to even remove sub clipped views.

**3. Are there any alternatives?**
I can't think of any yet. Or, at least, none that can be done without modyfing the Editor's Core.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.