squint-cljs / vite-plugin-squint

A plugin to compile .cljs source code with squint using vite
1 stars 3 forks source link

Demo - Vite + Squint + Solid #11

Closed brandonstubbs closed 4 months ago

brandonstubbs commented 5 months ago

This is the ported vite solid template

@martinklepsch This is where things get interesting, so esbuild will emit React JSX. We will need to be able to emit other types of JSX depending on the project.

https://github.com/amoutonbrady/esbuild-plugin-solid https://github.com/unjs/unbuild also seems to support solid https://github.com/solidjs/vite-plugin-solid/blob/main/src/index.ts#L315-L328 the official plugin is using babel.

But this makes me worry, we are going to become the filter between all these other plugins. We will have to support them all. I wonder if there is a different approach?

brandonstubbs commented 5 months ago

https://esbuild.github.io/content-types/#using-jsx-without-react we could configure esbuild. But I still worry about being the filter. I suspect this is why the HMR is not working in any of the demo's

If we want to support the transformations we could take a jsx option to the plugin that could specify solid for example

But I guess we have to be the filter? 🙃

brandonstubbs commented 5 months ago

See resolution in https://github.com/squint-cljs/vite-plugin-squint/pull/13

martinklepsch commented 4 months ago

Should this still be in draft?

brandonstubbs commented 4 months ago

@martinklepsch yeah at the moment until we get #13 merged then I can fix these other PR's

brandonstubbs commented 4 months ago

HMR is not working, looking into it

brandonstubbs commented 4 months ago

HMR works now, it doesn't keep state during a module reload. But neither do the official templates

brandonstubbs commented 4 months ago

@martinklepsch this ones ready to go if you're happy 🙂

martinklepsch commented 4 months ago

@brandonstubbs Awesome, added a few comments while reviewing the code, nothing that it inherently blocking so I'll let you address whatever you like & merge after. :+1: