Skip to content

Commit

Permalink
feat(napi/transform)!: rename TransformOptions::react to jsx.
Browse files Browse the repository at this point in the history
part of #6156
  • Loading branch information
Boshen committed Oct 1, 2024
1 parent c3c3447 commit 95098dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion napi/transform/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export interface TransformOptions {
/** Configure how TypeScript is transformed. */
typescript?: TypeScriptOptions
/** Configure how TSX and JSX are transformed. */
react?: JsxOptions
jsx?: JsxOptions
/** Enable ES2015 transformations. */
es2015?: ES2015BindingOptions
/**
Expand Down
4 changes: 2 additions & 2 deletions napi/transform/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct TransformOptions {
pub typescript: Option<TypeScriptOptions>,

/// Configure how TSX and JSX are transformed.
pub react: Option<JsxOptions>,
pub jsx: Option<JsxOptions>,

/// Enable ES2015 transformations.
pub es2015: Option<ES2015BindingOptions>,
Expand All @@ -45,7 +45,7 @@ impl From<TransformOptions> for oxc_transformer::TransformOptions {
Self {
cwd: options.cwd.map(PathBuf::from).unwrap_or_default(),
typescript: options.typescript.map(Into::into).unwrap_or_default(),
react: options.react.map(Into::into).unwrap_or_default(),
react: options.jsx.map(Into::into).unwrap_or_default(),
es2015: options.es2015.map(Into::into).unwrap_or_default(),
..Self::default()
}
Expand Down
2 changes: 1 addition & 1 deletion napi/transform/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test(
return <button onClick={() => setCount(count + 1)}>count is {count}</button>;
};
`,
{ react: { refresh: {} } },
{ jsx: { refresh: {} } },
),
{
code: 'var _s = $RefreshSig$();\n' +
Expand Down

0 comments on commit 95098dd

Please sign in to comment.