Repository navigation
Lower property escapes without removing Unicode flags (#59633) - #59633
Merged
Merged
Conversation
|
@andrewdacenko has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128332799. |
javache
requested changes
Oct 29, 2026
javache
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
javache
approved these changes
Oct 29, 2026
javache
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary: ## Why Hermes builds can support Unicode regex mode without enabling Unicode property escapes. Leaving property escapes in the generated code then causes invalid-escape compilation errors. Lowering the entire Unicode regex instead also removes code-point semantics, which can make a valid astral letter match the surrogate category. ## What The stable and canary presets expand Unicode property escapes in regex literals while retaining the Unicode flag. Ordinary Unicode regexes, class syntax and other profile options stay intact. Other profiles retain their existing transforms. Matching maps are generated normally from the transformed AST; no profile or source-map subtarget is changed. ## How Select Babel's property-escape transform using its default Unicode-flag mode for the Hermes V1 profiles, declare its direct dependency and regenerate the preset expectations. Regression tests exercise the actual transformer and Metro's source-map consumer, including astral letters, property complements, emoji, Unicode categories, normalization and the original position of a call after an expanded regex. Changelog: [General][Fixed] - Retain Unicode regex semantics while lowering property escapes for Hermes builds Reviewed By: javache Differential Revision: D128332799
andrewdacenko
force-pushed
the
export-D128332799
branch
from
October 30, 2026 14:14
cbed26d to
fa5c782
Compare
Collaborator
|
This pull request was successfully merged by @andrewdacenko in 6e22123 When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Why
Hermes builds can support Unicode regex mode without enabling Unicode property escapes. Leaving property escapes in the generated code then causes invalid-escape compilation errors. Lowering the entire Unicode regex instead also removes code-point semantics, which can make a valid astral letter match the surrogate category.
What
The stable and canary presets expand Unicode property escapes in regex literals while retaining the Unicode flag. Ordinary Unicode regexes, class syntax and other profile options stay intact. Other profiles retain their existing transforms. Matching maps are generated normally from the transformed AST; no profile or source-map subtarget is changed.
How
Select Babel's property-escape transform using its default Unicode-flag mode for the Hermes V1 profiles, declare its direct dependency and regenerate the preset expectations. Regression tests exercise the actual transformer and Metro's source-map consumer, including astral letters, property complements, emoji, Unicode categories, normalization and the original position of a call after an expanded regex.
Changelog:
[General][Fixed] - Retain Unicode regex semantics while lowering property escapes for Hermes builds
Reviewed By: javache
Differential Revision: D128332799