Skip to content

Version Packages#136

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
changeset-release/main
Open

Version Packages#136
github-actions[bot] wants to merge 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

unicode-segmenter@0.18.0

Minor Changes

  • a6b246a: Add unicode-segmenter/grapheme-counter, a standalone fast counter for extended grapheme clusters.

    countGraphemes() from the new entry returns exactly the same result as the one in unicode-segmenter/grapheme, but runs the boundary rules directly without allocating segment objects or slicing strings:

    • 4~7x faster counting on V8, ~4x on Hermes, with zero allocation
    • Standalone entry (4,852 bytes minified, 2,353 bytes gzipped); doesn't carry the segmenter code, and the segmenter entry doesn't carry the counter - even without tree-shaking
    • The countGraphemes() wrapper in unicode-segmenter/grapheme is unchanged and stays as the convenience API

@pkg-pr-new

pkg-pr-new Bot commented Jul 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/unicode-segmenter@136

commit: e0217a4

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a6b246a) to head (e0217a4).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #136   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines         1005      1005           
=========================================
  Hits          1005      1005           

☔ 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.

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing changeset-release/main (e0217a4) with main (a6b246a)

Open in CodSpeed

@cometkim

Copy link
Copy Markdown
Owner

I'm debating whether or not to release this.

The fast alternative to the countGraphemes API in unicode-segmenter.

It avoids the iterator protocol overhead of count-only paths, uses no heap, and is at least 4 times faster per segment.

However, most of the code overlaps with the full segmenter. I could either completely replace the existing API with this or provide a separate "lite entry" with the same API.

While it is a good alternative in most cases where only counting is needed, I am concerned that splitting API entries for a snippet that is only 100-200 bytes after compression seems overdesigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant