ko-jsx icon indicating copy to clipboard operation
ko-jsx copied to clipboard

Are JSX type necessary? Or can they be re-exported from Solid instead?

Open trusktr opened this issue 4 years ago • 2 comments

For example, this file:

https://github.com/ryansolid/ko-jsx/blob/0aaefed7d13ef33b34bd5c6d4fb4103841b15ad0/src/jsx.d.ts#L7

Is it a duplicate of what Solid has? If so, would it make sense to remove this and have people just point jsxImportSource to Solid's JSX types?

trusktr avatar Jul 06 '21 20:07 trusktr

These are same types. But in general, I was building these as separate projects. So it is setup so the jsxImportSource is ko-jsx. No separate imports etc.

ryansolid avatar Jul 07 '21 04:07 ryansolid

What I found works for lume/element (custom elements with Solid JSX templating) is to just re-export the stuff, and it works fine:

https://github.com/lume/element/blob/master/src/jsx-runtime.ts

The user can then set jsxImportSource to @lume/element. ko-jsx can re-export the same way.

I believe all projects should be developed with this sort of re-use in mind: a single source of truth is easier to understand and to work with. Someone who wants to make a pull request is not going to be confused as to where a modification needs to be made. Etc.

trusktr avatar Nov 18 '21 05:11 trusktr