Skip to content
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

feat(napi/transform)!: rename TransformOptions::react to jsx. #6211

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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