Mutation observer for "onChange" event is re-enabled to early when loading large document
@frankwalter-1 đang làm issue này rồi.
Từ ngày 31/12/2024.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ luồng render() bất đồng bộ và vòng đời của MutationObserver, đặc biệt là isMutationBelongsToElement(), rồi tái hiện vấn đề với một tài liệu lớn trong khi profiling bằng Chrome. Được xem là hoàn tất khi observer vẫn không hoạt động cho đến khi quá trình rendering hoàn tất hoàn toàn, không có các lần gọi lặp lại và mức tải CPU đã mô tả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:
- load a document using render()
- load another very lange document using render()
- 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
- Ngôn ngữ chính
- TypeScript
- Star
- 32k
- Fork
- 2.2k
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codex-team/editor.js
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
codex-team/editor.js#3037 ·
-
Floating Promise Anti-Pattern & Premature Caret in Multi-Block PasteCó thể đã có người làm @anshurajbisoyi98-ctrl đã nhận 14 ngày trước. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codex-team/editor.js#3032 · 1 bình luận ·
-
Silent Data Loss & Broken Error Contract in Saver.save()Có thể đã có người làm @Sion612 đã nhận 24 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
codex-team/editor.js#3030 ·
-
Complete Omission of block.destroy() in Blocks CollectionCó thể đã có người làm @Minhal128 đã nhận 23 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
codex-team/editor.js#3029 ·
-
Bug: Link cannot be removedCó thể đã có người làm @prathmeshyelne đã nhận 130 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
codex-team/editor.js#3005 · 1 bình luận ·
Tất cả issue của codex-team/editor.js
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jbacalso24/mimry#459 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
architecture help wanted hive/claimed-by-architect origin/architect stage/030-pr-in-progress tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kubestellar/console#24422 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: backends type: docs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 83/100
schlessera/brain-kit#2383 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent duplicate providers tool triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày