yusukebe / hono-jsx-dom-with-vite

13 stars 2 forks source link

What is the difference from “hono-jsx-dom-examples” repository? #1

Closed 0xBADDCAFE closed 3 months ago

0xBADDCAFE commented 3 months ago

Referring to the Client Component, I set jsxImportSource": "hono/jsx/dom" in the tsconfig.json of the project created with npx create hono@latest. The build will succeed, but JSX will error on VSCode.

Even in hono-jsx-dom-examples, jsxImportSource": "hono/jsx/dom" is set in tsconfig.json, but there is no JSX error in 4.0.0-rc3 used here. In this hono-jsx-dom-with-vite repository, jsxImportSource": "hono/jsx" is set as is and esbuild jsxImportSource: 'hono/jsx/dom' options are added in vite.config.ts. In this case, the build is successful and there are no errors in VSCode.

I want to know which config should I use. What is the difference between “hono-jsx-dom-examples” (or the settings on the Client Component page) and “hono-jsx-dom-with-vite”?

yusukebe commented 3 months ago

Hi @0xBADDCAFE

In almost all cases, you should use jsxImportSource": "hono/jsx". If you want to optimize the build for client components, you can use jsxImportSource": "hono/jsx/dom" for esbuild or Vite.

0xBADDCAFE commented 3 months ago

I got it, thank you for quick response.