snabbdom icon indicating copy to clipboard operation
snabbdom copied to clipboard

Support new @babel/preset-react automatic runtime

Open whisper-bye opened this issue 3 years ago • 2 comments

As the title says, feature request.

{
  "plugins": [
    [
      "@babel/plugin-transform-react-jsx",
      {
        "runtime": "automatic", // defaults to classic
        "importSource": "jsx"
      }
    ]
  ]
}

Refs: [1] https://babeljs.io/docs/en/babel-preset-react [2] https://zh-hant.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html

whisper-bye avatar May 07 '21 09:05 whisper-bye

What should we have to do for this? At least providing snabbdom/jsx-runtime and snabbdom/jsx-dev-runtime modules and exporting jsx and jsxs functions? Support for fragments is also necessary?

ryota-ka avatar Jun 27 '21 18:06 ryota-ka

I am not 100% sure, but I don't think support for fragments is required, just exporting a jsx function should be enough. snabbdom already has that one, so it should not be hard to reexport it from the relevant modules

jvanbruegge avatar Jul 01 '21 13:07 jvanbruegge