-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add option to disable jsx -> htm conversion #93
Comments
Ooooh so this is 100% a bug in the npm resolution. Does it happen on master? |
Yeah happens on |
Ah interesting, yeah that's kinda a funky case. A thought: what if we had the HTM plugin detect |
@developit ohh I like that very much! That's much better than my proposed solution!! 👍 |
I just thought of another idea: we could use the new |
@developit That sounds even better and more future proof. Love that 👍 |
I'm using
wmr
in the test suite for our Preact Devtools extension and I need to verify that it works with a range of Preact versions.To do so I've set up multiple aliases:
And than we can use that with standard imports:
This works really well except for when I use JSX. JSX is transpiled to
htm
template strings, but by adding aimport htm from "htm/preact"
import, an additional version of Preact is pulled in.To solve this I can come up with two options:
createElement
callsThis is arguable the more verbose version, but it works. The parsing performance benefit of tagged template strings doesn't really come to play in my set up, so I'm good with
createElement
calls.htm.bind(h)
calls into every fileAnother option could be to drop the
htm/preact
import and initialize thehtm
constructor anew in each file:html
calls, but don't injecthtm.bind(h)
automaticallyThis closely ties to 2) and is probably a lot more flexible for the end user. Essentially he'd need to make sure that an
html
function is present in the module scope themselves.The text was updated successfully, but these errors were encountered: