Skip to content

Replace graphemesplit by compatible standard Intl.Segmenter - #33

Open
IagoSRL wants to merge 2 commits into
EthanRutherford:masterfrom
IagoSRL:nodeps-standard-intl-e18e
Open

Replace graphemesplit by compatible standard Intl.Segmenter#33
IagoSRL wants to merge 2 commits into
EthanRutherford:masterfrom
IagoSRL:nodeps-standard-intl-e18e

Conversation

@IagoSRL

@IagoSRL IagoSRL commented Jul 7, 2026

Copy link
Copy Markdown

Intl.Segmenter is Baseline 2024 Newly Available; at Node since v16, 2021.

With this change, there is no production/distribution dependencies.

All tests passes unchanged.

Following recommendations to reduce packages as in e18e.

Copilot AI review requested due to automatic review settings July 7, 2026 10:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the external graphemesplit dependency with the platform-provided Intl.Segmenter to perform grapheme segmentation, reducing distribution/runtime dependencies while keeping fuzzy matching’s grapheme-aware normalization behavior.

Changes:

  • Swapped graphemesplit import for an Intl.Segmenter-based split() implementation.
  • Removed graphemesplit from dependencies (and pruned lockfile entries).
  • Updated package metadata/lockfile versioning accordingly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/fuzzy.js Reimplements grapheme splitting using Intl.Segmenter instead of graphemesplit.
package.json Removes the graphemesplit runtime dependency.
package-lock.json Removes graphemesplit and its transitive dependencies from the lockfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fuzzy.js
Comment on lines +2 to +3
const segmenter = new Intl.Segmenter(undefined, {granularity: "grapheme"});
const split = (str) => [...segmenter.segment(str)].map((segment) => segment.segment);
Comment thread package.json
Comment on lines 52 to 54
"rollup-plugin-copy": "^3.3.0"
},
"dependencies": {
"graphemesplit": "^2.4.1"
}
}
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.

2 participants