-
Notifications
You must be signed in to change notification settings - Fork 664
feature(rome_js_parser): JSX support in .js files #2674
Conversation
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
🎉 Fixed (2):
|
Deploying with Cloudflare Pages
|
@@ -34,12 +34,12 @@ use super::typescript::parse_ts_type_arguments; | |||
// test jsx jsx_element_as_statements | |||
// <div /> | |||
|
|||
// test_err jsx_or_type_assertion | |||
// test_err cjs jsx_or_type_assertion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we verify if typescript enables JSX for cjs
too? I don't see why it should be disabled, considering that server rendering is a thing now with react.
You can probably use
// SCRIPT
// ... test code
To force run the test with JSX disabled and in script mode
value_token: IDENT@28..31 "div" [] [], | ||
}, | ||
type_arguments: missing (optional), | ||
expression: JsxTagExpression { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to still be parsed out as JSX. Can we change the test back to be parsed with JSX disabled (so that the snapshot doesn't change)
!bench_parser |
Parser Benchmark Results
|
130c61e
to
17a117b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I address the review feedback. We should be good to merge now
Enable JSX by default for all javascript files (not typescript)
Summary
Addresses #2625. Because TypeScript allows JSX in
.js
files by default, we allow the same. Also makes adoption easier because many users have React components in a.js
file.Test Plan
The existing tests for JSX should suffice.