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
Change Request: Replace graphemer
with Intl.Segmenter
#17835
Comments
Probably related to orling/grapheme-splitter#26 |
https://github.com/flmnt/graphemer/blob/master/tests/GraphemeBreakTest.txt |
Per MDN - Intl.Segmenter() constructor, it expects a Does that mean that we could have different behavior in different environments? For example, linting passes locally but then fails on CI because the default locale is different? |
Hmm. There may be differences depending on locale. https://github.com/tc39/proposal-intl-segmenter/blob/master/README.md#why-should-we-pass-a-locale-and-options-bag-for-grapheme-boundaries-isnt-there-just-one-way-to-do-it |
@ota-meshi are you still interesting in working on this? Are you still doing research? |
I haven't looked into it much since then. Perhaps the language in which the problem seems to be a language that is unfamiliar to me so I am having trouble understanding it 😓 |
If that's the case, shall we close this? |
What do you think is the best way to resolve the issue of incompatibility with Unicode v15.1? |
Can we specify |
That idea sounds good to me! At least I don't think the behavior will change depending on the environment. |
I like the idea of using |
I think we're at the point where we either need someone to prototype this or we should close this issue. Any volunteers? |
I went ahead and prepared a draft: #18110. One problem that hasn't been discussed yet is that |
Ooh, great catch! I agree, we should definitely hold off until Firefox supports this. |
Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update. |
Blocked by Firefox implementing Intl.Segmenter, so not stale. |
|
I'd definitely prefer using |
ESLint version
v8.55.0
What problem do you want to solve?
Related to #17725 (comment)
If we use the new Node.js we can use
Intl.Segmenter
instead ofgraphemer
.Intl.Segmenter
can be used to reduce ESLint's dependency packages.What do you think is the correct solution?
Replace
graphemer
withIntl.Segmenter
.before:
after:
Participation
Additional comments
I tested the compatibility of
graphemer
andIntl.Segmenter
. The test case in thegraphemer
repository did not change the result even if I replaced it withIntl.Segmenter
.However, "अनुच्छेद" in the README has a different result.
graphemer
:'अ', 'नु', 'च्', 'छे', 'द'
Intl.Segmenter
:'अ', 'नु', 'च्छे', 'द'
(It is not known whether this is a bug or intentional.)See #17835 (comment)The results will change, but I think it will be accepted by users as a minor breaking change if included in ESLint v9.
Repositories used for testing:
https://github.com/ota-meshi/graphemer/tree/compat-intl-segmenter
Commit:
ota-meshi/graphemer@de301e6
The text was updated successfully, but these errors were encountered: