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

chore(perf): initialisation and rendering performance optimisations #2430

Merged
merged 17 commits into from
Aug 8, 2023

Conversation

neSpecc
Copy link
Member

@neSpecc neSpecc commented Jul 31, 2023

Performance optimizations: initialization speed increased, blocks.render() API method optimized. Big documents will be displayed faster.

  • Blocks will be added via a single DocumentFragment instead of a separate insertion.
  • Event listeners are wrapped with requestIdleCallback to bind them after rendering.
  • Removed await from core.ts module validation and initialization since they are not async.
  • Some optimizations added at the Paragraph tool: chore: performance optimization editor-js/paragraph#71
  • Toolbar and Inline Toolbar creation moved to requestIdleCallback

Initialization time with 2700 Blocks:

Before: 2000—3000ms
After: 250—350ms

Initialization Loader has been removed.

It led unnecessary layout, and also people asked about disabling it. It could be easily implemented outside the Editor.

Resolves #2340
Resolves #1305

The blocks.insertMany() API method was added. It allows inserting several Blocks into the specified index.

Just because we now have the BlockManager.insertMany() method. Also, someone asked about it in a Telegram channel.

I'll add tests for it to this PR soon.

Selection style won't override your custom style for ::selection outside the editor.

::selection selector moved to the .codex-editor scope

Resolves #1931

"Editor saving" and "I'm ready" logs removed

Annoying and unuseful.

Plugin cypress-terminal-report

For more detailed reports in cypres terminal output:

image

If tool throws error during render, we will use Stub tool instead of skipping

To save tool's data and let user know that he has that block in a document

BlockManager clear() method improved

Previously, it just removes blocks from .blocks Proxy. Now it destroys blocks instances and emits "block-removed" events.

@neSpecc neSpecc merged commit b399966 into next Aug 8, 2023
6 checks passed
@neSpecc neSpecc deleted the feat/renderer-batching branch August 8, 2023 19:17
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.

loader Optional loader 💡
3 participants