Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Mutation observer for "onChange" event is re-enabled to early when loading large document

オープン
#2,867 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@frankwalter-1 がすでに取り組んでいます。

2024年12月31日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
frontend

調査の方向性

非同期の render() パスと MutationObserver のライフサイクル、特に isMutationBelongsToElement() から調査を開始し、Chrome でプロファイリングを行いながら大きなドキュメントで問題を再現してください。完了条件は、レンダリングが完全に完了するまで observer が非アクティブなままであり、説明されている繰り返しの呼び出しや CPU 負荷が発生しないことです。

索引モデルが issue の本文から書いたものです。

説明

bug important

When replacing the editor contents by calling "render()" the MutationObserver that detects changes should be deactivated and reactivated after the new content has been rendered. It seems the async render() method just uses a 2000ms timer, so when a document takes longer to render the MutationObserver is re-enabled too early and there are hundreds of calls to "isMutationBelongsToElement()" that bay continue multiple seconds and creating 100% cpu load.

Steps to reproduce:

  1. load a document using render()
  2. load another very lange document using render()
  3. look at the Chrome performance monitor or record a performance profile and look at the many calls.

Expected behavior:
when rendering a new document the Editor makes sure that the new content has been fully rendered before re-activating the MutationObserver.

Editor.js version:
2.30.6

Plugins you use with their versions:
not relevant

主要言語
TypeScript
スター
32k
フォーク
2.2k
平均マージ
2日 1時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codex-team/editor.js のほかの issue

codex-team/editor.js の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。