Skip to content

unicode-segmenter@0.17.0

Choose a tag to compare

@github-actions github-actions released this 06 Jul 23:16
· 22 commits to main since this release
f4abccc

Minor Changes

  • 483ff75: Rewrite the grapheme segmenter with flat lookup tables and pair-rule dispatch.

    • Bundle: −31% minified, −34% min+gzip, −26% min+brotli, −10% Hermes bytecode
    • Runtime: fastest in the ecosystem on every benchmark case, ~1.1x faster on Hermes
    • Memory: −44% retained heap, no retained per-range JS objects

    Also fixes several segmentation bugs where results diverged from Intl.Segmenter:

    • GB11: ZWJ joined non-pictographic characters (e.g. '👍‍a'), double ZWJ, and SpacingMark-interrupted Extend* sequences; ExtPic after a Prepend never armed the rule
    • GB9c: InCB=None characters (matras, ZWNJ) did not reset the conjunct sequence; consonants after a Prepend never started one
    • Unassigned U+D7FC..U+D7FF were treated as Hangul T

    The public API is unchanged. The internal _incb_data module is removed
    (its data is folded into the grapheme table), and all modules now share a
    single flat-table binary search — general/emoji predicates get 27–36%
    faster with 65% less retained heap.