Closed ticky closed 7 years ago
Looks like there may yet be some specificity bugs in devongovett/regexgen#17! 😅
Thanks for your work on this so far! I’m open to this :)
Let’s get the open regexgen issue resolved first.
Thanks for your positivity and feedback, @mathiasbynens! I suspect the upstream change this relies on is very nearly ready, now! :smile:
regexgen got updated, and I’ve bumped the dependency version in this PR to match, and everything still looks solid! 😃
I’ve updated this based on your feedback, @mathiasbynens! It no longer duplicates the source files on-disk, instead tweaking the Babel config so the two versions are built from the single source, and updating the supplementary files to match. 😸
Thanks for your work on this, @ticky!
No problem – thanks so much for accepting it :smile:
This is a PR to include the updated behaviour I put together in devongovett/regexgen#17 in emoji-regex.
In addition to the existing exports, which are always compiled down to UCS-2 codepoints, this allows instead importing
emoji-regex/unicode
oremoji-regex/unicode/text
, which retrieve UTF-8 versions of the same regexes, compatible with modern Node versions, as well as some current browsers.In order to achieve this, it updates the
inject-sequences
command to convert the sequences to UCS-2 as well as UTF-8, and adds additional files in which to use the UTF-8 version. Likewise, it updates the Babel configuration for these files to toggle theuseUnicodeFlag
option oftransform-unicode-property-regex
.It also updates
.gitignore
to support these new changes, and not attempt to ignore the original source files.Todo:
regexgen
dependency once devongovett/regexgen#17 drops!