-
Notifications
You must be signed in to change notification settings - Fork 1
Testing no flushing html-mod #28
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: 7474eec The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
avigoldman
commented
Dec 27, 2025
- Remove .js extensions from all imports for consistency - Fix import ordering in string-operations.ts (regular imports before type imports) - Add empty line between import groups as required by linter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove Prettier's import sorting plugin from config-prettier - Update import ordering in string-operations.ts and chaos-monkey.test.ts - ESLint's import/order rule now handles all import organization - Both tools work harmoniously without conflicting changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Condensed from 551 lines to 76 lines: - Removed verbose problem/solution sections - Removed detailed API comparisons - Removed deployment recommendations - Kept only: what it is, why use it, usage, benchmarks, migration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Improved performance by only updating affected portions of the AST instead of walking the entire tree on every operation. **What changed:** - Added `updateFromElement()` method for targeted AST updates - Only walks affected subtrees: element + descendants, ancestors, and following siblings - Falls back to full tree update when element is removed from tree **Performance:** - Reduced complexity from O(n) to O(depth + children + following_siblings) - Maintains all existing performance gains (still 2-4x faster than stable) - Zero regressions across 715 tests **Testing:** - Added 13 new tests specifically for the optimization - Tests verify correctness: only affected nodes updated, preceding siblings unchanged - Edge cases: deep nesting, wide trees, element removal, moving elements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Refreshed performance numbers after targeted AST update optimization. All benchmarks still show experimental winning 10/10. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Use correct export name: HtmlModElement instead of HtmlElement - Remove unused 'sibling' variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Removed excessive inline comments that explain low-level mechanics instead of high-level intent, matching the minimal comment style of the rest of the codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
nunofgs
approved these changes
Dec 29, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental Auto-Flush Implementation for HTML-Mod
This PR introduces the experimental auto-flush implementation that eliminates manual
flush()calls by automatically synchronizing the AST after every modification.🎯 Key Results
📊 Performance Summary
Experimental wins: 10/10 benchmarks
🔧 What Changed
Core Implementation
API Improvements
flush()calls requiredflush()method still exists for backward compatibility (but does nothing)Dataset API (Both Versions)
datasetproperty toHtmlModElementDOMStringMapinterfaceConfiguration Fixes
@trivago/prettier-plugin-sort-importsfrom@ciolabs/config-prettierimport/orderrule now handles all import organization🧪 Test Coverage
702 tests passing across 13 test suites:
Stress Testing Highlights
📝 Documentation
packages/html-mod/src/experimental/README.md🔄 Changes
@ciolabs/html-mod/experimental📦 Changesets
experimental-auto-flush.md- Main feature additionprettier-eslint-fix.md- Config fix for import ordering🚀 Recommendation
Use experimental for ALL use cases. It's faster than stable in every scenario - from batch processing to interactive visual editors. The only reason to use stable is backward compatibility with existing code.
The experimental version is production-ready, universally faster, and represents the future direction of the html-mod library.
See
packages/html-mod/src/experimental/README.mdfor complete details.