Skip to content

Commit

Permalink
fix(un-jsx): disable preact's h pragma to avoid conflicting with no…
Browse files Browse the repository at this point in the history
…rmal minified code

#113
  • Loading branch information
pionxzh committed Feb 16, 2024
1 parent 55e2938 commit a97c8ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ function Foo() {}

inlineTest('jsx with xml namespace',
`
h("f:image", {
jsx("f:image", {
"n:attr": true
});
`,
Expand Down
4 changes: 3 additions & 1 deletion packages/unminify/src/transformations/un-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const DEFAULT_PRAGMA_CANDIDATES = [
'_jsxs', // `import { jsxs as _jsxs } from 'react/jsx-runtime'`
'jsxDEV', // runtime = "automatic" (`jsxRuntime.jsxDEV`) (dev only)
'jsxsDEV', // runtime = "automatic" (`jsxRuntime.jsxsDEV`) (dev only)
'h', // Preact
// FIXME: disabled as it will conflict with minified code
// bring this back when we have a way to tell if the caller is `preact`
// 'h', // Preact
]

const DEFAULT_PRAGMA_FRAG_CANDIDATES = [
Expand Down

0 comments on commit a97c8ea

Please sign in to comment.