Skip to content

chore: improve speed - #567

Merged
yowainwright merged 2 commits into
mainfrom
improve-speed
Nov 3, 2026
Merged

yowainwright merged 2 commits into
mainfrom
improve-speed

Conversation

@yowainwright

Copy link
Copy Markdown
Owner

Proposed Changes

Speeds up multi-element truncation by batching DOM writes and height reads for independent layouts, while preserving Shave’s API and using sequential processing for coupled layouts. Keeps zero runtime dependencies.


Read about referenced issues here. Replace words with this Pull Request's context.

@socket-security

socket-security Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

@yowainwright

Copy link
Copy Markdown
Owner Author

@greptile

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0614b5a) to head (8ddc169).

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #567      +/-   ##
===========================================
+ Coverage   98.93%   100.00%   +1.06%     
===========================================
  Files           2         2              
  Lines          94       126      +32     
  Branches       33        43      +10     
===========================================
+ Hits           93       126      +33     
+ Partials        1         0       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge and address the earlier float-wrapping issue.

Summary

Shave batches text changes and height reads for independent targets, while keeping sequential work for coupled layouts.

  • Shave batches truncation work for independent elements.
  • The package builds Shave with Rolldown in its existing output formats.
  • CI and test setup use the updated project toolchain.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resolve target elements] --> B{Targets pass batching checks?}
  B -->|Yes| C[Create one search per target]
  B -->|No| D[Create one sequential search]
  C --> E[Write candidates]
  D --> E
  E --> F[Read target heights]
  F --> G{More candidates needed?}
  G -->|Yes| E
  G -->|No| H[Hide remaining text and restore styles]
Loading

Reviews (2) · Last reviewed commit: "chore: code cov" · Reviewed by Greptile

Comment thread src/shave.ts Resolved
@yowainwright

Copy link
Copy Markdown
Owner Author

@greptile

@yowainwright
yowainwright merged commit a9278a6 into main Nov 3, 2026
12 checks passed
@yowainwright
yowainwright deleted the improve-speed branch November 3, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant