Sawtaytoes / reactjs-solidjs-bridge

Render Solid.js components in React.js and visa versa.
MIT License
117 stars 4 forks source link

[Feature request] Type declarations #4

Open danieltroger opened 1 year ago

danieltroger commented 1 year ago

Would be amazing to have some typescript type declarations for this

Sawtaytoes commented 1 year ago

That's true. I wrote this long before I'd learned TypeScript. Feel free to add them!

I haven't had time to work on this library, and using SolidJS at work is getting farther and farther away based on the tech stack at my current job.

danieltroger commented 1 year ago

I see. Sad that you can't use solid :( What are you using instead?

Going without type declarations right now but if I write some later I'll add them here.

Sawtaytoes commented 1 year ago

I'm using React only because that's what's established where I work.

vladnicula commented 1 year ago

would you accept/merge a complete "translation" to typescript? I don't promise anything, but if we decide to adopt your package I might have to do it for work anyway.

divinespear commented 1 year ago

You can start with command: tsc --declaration --rootDir src --outDir dist --noEmit false --emitDeclarationOnly --allowJs false --checkJs false

many errors while running (is it expected maybe?) but d.ts files are made.

Sawtaytoes commented 1 year ago

I started fixing up the SolidJS side of things since I started a SolidJS project and need to render React components.

I converted most of the project to TypeScript in the master branch (forgot to make a feature branch). I also converted to Vite because it wasn't working right with the original Webpack implementation.

SolidJS is not playing nicely with the ReactJS though. Not sure how to get both to work. It's something to do with the Vite plugins. If I can fix that, I think it's in a "good enough" state.