This release focuses on Swift 6.3 compatibility, a substantial rewrite of the editor's highlighting pipeline, and much better responsiveness when editing very large HTML documents.
Added
- Added the HTMLEditorBenchmarks executable target for repeatable performance measurements.
- Added benchmark support for full-plan highlighting, overlap reuse, edit invalidation, visible-highlight remapping, and large-document local repaint paths.
-
Added focused regression tests for:
- planner cache reuse and document-scoped invalidation
- invalid NSRange and UTF-16 edge cases
- quoted and unquoted attribute value highlighting
- visible highlight state remapping
- block-based highlight coverage
- large-document editing and scrolling policies
Changed
- Refactored the editor runtime into smaller focused components, including separate coordinator lifecycle, viewport, editing, policy, coverage, structural-range, and visible-highlight-state files.
- Refactored the syntax highlighter into planner- and builder-based components for clearer separation of scanning, planning, and application.
- Moved the editor to an adaptive runtime model that changes behavior based on document size instead of treating all HTML documents the same way.
Improved
-
Greatly improved large-document editing performance with:
- viewport-first highlighting
- document-scoped planner caches and targeted invalidation
- cached visible-range plans
- block-based highlight coverage tracking
- structural dirty-range alignment around edits
- two-phase large-file editing with immediate micro-pass and deferred wider repaint
- burst-coalesced edit repainting
- scroll-idle semantic highlighting
- deferred binding synchronization for large documents
- allowsNonContiguousLayout enabled automatically in large-file mode
- Improved highlight stability while typing in the middle of very large HTML by preserving visible overlay state and reducing repaint churn around the caret.
- Improved performance tuning and observability for large files with dedicated benchmark coverage and runtime probes.
Fixed
- Fixed compilation and concurrency issues needed for Swift 6.3 compatibility.
- Fixed several editor update-path issues related to coordinator state, highlighting tasks, and main-actor behavior.
-
Fixed highlight regressions and edge cases involving:
- partial tags
- empty input
- large payloads
- attribute-value coloring
- visible highlight loss during large-file editing
- invalid or clipped visible ranges
Notes
- Full-document semantic highlighting is still used for smaller HTML inputs.
- Very large HTML inputs now automatically switch to a more conservative, performance-oriented editing mode to keep scrolling and typing responsive.
Try it on GitHub: https://github.com/makoni/HTMLEditor-SwiftUI