From c7e70c80f0b096c99e5161c4c9b5949738e1a6ac Mon Sep 17 00:00:00 2001 From: Boshen Date: Sun, 14 Apr 2024 19:40:24 +0800 Subject: [PATCH] fix(transformer): deserialize ReactJsxRuntime with camelCase (#2972) --- crates/oxc_transformer/src/react/options.rs | 1 + tasks/transform_conformance/babel.snap.md | 53 +-------------------- 2 files changed, 3 insertions(+), 51 deletions(-) diff --git a/crates/oxc_transformer/src/react/options.rs b/crates/oxc_transformer/src/react/options.rs index 2f544c22c..1860ba913 100644 --- a/crates/oxc_transformer/src/react/options.rs +++ b/crates/oxc_transformer/src/react/options.rs @@ -115,6 +115,7 @@ impl ReactOptions { /// Auto imports the functions that JSX transpiles to. /// classic does not automatic import anything. #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] pub enum ReactJsxRuntime { Classic, /// The default runtime is switched to automatic in Babel 8. diff --git a/tasks/transform_conformance/babel.snap.md b/tasks/transform_conformance/babel.snap.md index 0ed67457e..a4dcc1422 100644 --- a/tasks/transform_conformance/babel.snap.md +++ b/tasks/transform_conformance/babel.snap.md @@ -1,4 +1,4 @@ -Passed: 129/392 +Passed: 178/392 # All Passed: * babel-plugin-transform-react-jsx-source @@ -138,83 +138,36 @@ Passed: 129/392 * regression/another-preset-with-custom-jsx-keep-source-self/input.mjs * regression/runtime-classic-allow-multiple-source-self/input.mjs -# babel-plugin-transform-react-jsx (47/156) +# babel-plugin-transform-react-jsx (96/156) * autoImport/after-polyfills-compiled-to-cjs/input.mjs * autoImport/auto-import-react-source-type-module/input.js * autoImport/complicated-scope-module/input.js -* autoImport/import-source/input.js * autoImport/import-source-pragma/input.js * autoImport/react-defined/input.js -* pure/false-default-pragma-classic-runtime/input.js * pure/false-pragma-comment-automatic-runtime/input.js * pure/false-pragma-comment-classic-runtime/input.js * pure/false-pragma-option-automatic-runtime/input.js -* pure/false-pragma-option-classic-runtime/input.js -* pure/true-default-pragma-classic-runtime/input.js * pure/true-pragma-comment-automatic-runtime/input.js * pure/true-pragma-comment-classic-runtime/input.js * pure/true-pragma-option-automatic-runtime/input.js -* pure/true-pragma-option-classic-runtime/input.js -* pure/unset-default-pragma-classic-runtime/input.js * pure/unset-pragma-comment-automatic-runtime/input.js * pure/unset-pragma-comment-classic-runtime/input.js * pure/unset-pragma-option-automatic-runtime/input.js -* pure/unset-pragma-option-classic-runtime/input.js -* react/adds-appropriate-newlines-when-using-spread-attribute/input.js * react/arrow-functions/input.js -* react/assignment/input.js -* react/concatenates-adjacent-string-literals/input.js -* react/does-not-add-source-self/input.mjs -* react/dont-coerce-expression-containers/input.js -* react/duplicate-props/input.js -* react/flattens-spread/input.js -* react/handle-spread-with-proto/input.js * react/honor-custom-jsx-comment/input.js * react/honor-custom-jsx-comment-if-jsx-pragma-option-set/input.js -* react/honor-custom-jsx-pragma-option/input.js -* react/jsx-with-retainlines-option/input.js -* react/jsx-without-retainlines-option/input.js * react/optimisation.react.constant-elements/input.js * react/pragma-works-with-no-space-at-the-end/input.js -* react/proto-in-jsx-attribute/input.js * react/should-add-quotes-es3/input.js -* react/should-allow-constructor-as-prop/input.js -* react/should-allow-deeper-js-namespacing/input.js -* react/should-allow-elements-as-attributes/input.js -* react/should-allow-js-namespacing/input.js * react/should-allow-jsx-docs-comment-with-pragma/input.js -* react/should-allow-nested-fragments/input.js * react/should-allow-no-pragmafrag-if-frag-unused/input.js * react/should-allow-pragmafrag-and-frag/input.js -* react/should-avoid-wrapping-in-extra-parens-if-not-needed/input.js -* react/should-convert-simple-tags/input.js -* react/should-convert-simple-text/input.js * react/should-disallow-spread-children/input.js * react/should-disallow-valueless-key/input.js * react/should-disallow-xml-namespacing/input.js -* react/should-escape-xhtml-jsxattribute/input.js -* react/should-escape-xhtml-jsxtext/input.js -* react/should-handle-attributed-elements/input.js -* react/should-handle-has-own-property-correctly/input.js -* react/should-have-correct-comma-in-nested-children/input.js -* react/should-insert-commas-after-expressions-before-whitespace/input.js -* react/should-not-add-quotes-to-identifier-names/input.js -* react/should-not-allow-jsx-pragma-to-be-anywhere-in-comment/input.js -* react/should-not-mangle-expressioncontainer-attribute-values/input.js -* react/should-not-strip-nbsp-even-coupled-with-other-whitespace/input.js -* react/should-not-strip-tags-with-a-single-child-of-nbsp/input.js -* react/should-properly-handle-comments-between-props/input.js -* react/should-quote-jsx-attributes/input.js -* react/should-support-xml-namespaces-if-flag/input.js * react/should-throw-error-namespaces-if-not-flag/input.js -* react/should-transform-known-hyphenated-tags/input.js * react/should-warn-when-importSource-is-set/input.js * react/should-warn-when-importSource-pragma-is-set/input.js -* react/this-tag-name/input.js -* react/weird-symbols/input.js -* react/wraps-props-in-react-spread-for-first-spread-attributes/input.js -* react/wraps-props-in-react-spread-for-last-spread-attributes/input.js -* react/wraps-props-in-react-spread-for-middle-spread-attributes/input.js * react-automatic/arrow-functions/input.js * react-automatic/concatenates-adjacent-string-literals/input.js * react-automatic/does-not-add-source-self-automatic/input.mjs @@ -242,10 +195,8 @@ Passed: 129/392 * removed-options/invalid-use-builtins-true/input.js * removed-options/invalid-use-spread-false/input.js * removed-options/invalid-use-spread-true/input.js -* runtime/classic/input.js * runtime/invalid-runtime/input.js * runtime/pragma-runtime-classsic/input.js -* sourcemaps/JSXText/input.js * spread-transform/transform-to-babel-extend/input.js * spread-transform/transform-to-object-assign/input.js