-
Notifications
You must be signed in to change notification settings - Fork 131
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
Normative: disallows UnicodeEscapeSequence #139
base: main
Are you sure you want to change the base?
Conversation
npx esbuild --loader=jsx <<< 'const x = <video></\u0076ideo>'
|
Thanks for catching this! Since implementation already diverged on this, I think we need some discussion and reach a consensus before making this change. |
Actually only typescript accepts Unicode escape sequences. Maybe a LGTM from the Typescript team is enough. |
Happy to disallow this from the TypeScript side |
hi! Since TypeScript merges microsoft/TypeScript#48609, now this is consistent behavior across the most common transpilers in the ecosystem, that is disallows UnicodeEscapeSequence in JSXIdentifier. I think this PR can be merged now. I don't know who I can ping because Huxpro has left Meta. Maybe @sebmarkbage? Please take a look, thanks! |
Thanks @Jack-Works! @sebmarkbage actually left before me 😂. I'm supportive of this change. Maybe @poteto can take a look? |
For the following code:
TypeScript: accept this syntax
TypeScript: reject this syntax after microsoft/TypeScript#48609
Babel: syntax error
swc: syntax error
esbuild:
npx esbuild --loader=jsx <<< 'const x = <video></\u0076ideo>'
Suggested change
Disallows UnicodeEscapeSequence in the JSXIdentifier
Another path
Allow UnicodeEscapeSequence but require them to match in the opening and the closing tag, which means
<video></\u0076ideo>
is a syntax error (tag mismatch) but<\u0076ideo />
is OK.