HorusGoul / vite-plugin-stylex

Vite Plugin for StyleX
MIT License
111 stars 11 forks source link

Vue and SvelteKit #3

Closed walmartwarlord closed 7 months ago

walmartwarlord commented 7 months ago

Since it's named vite-plugin-stylex, I expect it to work on other vite projects. I tried it with Vue, it works. Not sure about SvelteKit and other frameworks. Are you planning on supporting them as well?

HorusGoul commented 7 months ago

Since it's named vite-plugin-stylex, I expect it to work on other vite projects. I tried it with Vue, it works. Not sure about SvelteKit and other frameworks. Are you planning on supporting them as well?

StyleX itself is framework agnostic, so this plugin should attempt to be as compatible as possible. I'm not familiar with how those frameworks expect vite plugins to treat their source files and if it's going to be compatible with the official StyleX babel plugin this project uses under the hood.

It's early to say, but let's let people experiment with it and see how it goes. Trying this with Remix is next on my to-do list.

HorusGoul commented 7 months ago

@walmartwarlord SvelteKit support added in v0.3.0!

Vue works because it follows the SPA approach by default. Nuxt probably doesn't work out of the box given that every framework that has something to do with SSR requires some work on the plugin side, but shouldn't be hard to add. I'll create an issue for it.

As for other frameworks, I need to revisit Qwik and Astro with the new approach, then try Solid Start, and possibly even Angular lol.

Closing this one for now, but keep in mind there's also work happening in the official StyleX repository (https://github.com/facebook/stylex) to support Vite, many of us are exploring different approaches to make a plugin for vite work well.

Thanks! :smile: