DEV Community

Discussion on: The React Hooks Announcement In Retrospect: 2 Years Later

Collapse
 
ryanfiller profile image
ryanfiller

This is the first I've heard of JSX-Lite. It's a very cool idea, but I don't think it really "compiled to Svelte" how I would have hoped...

Collapse
 
ryansolid profile image
Ryan Carniato

To be fair I believe it is still in alpha. I think there are a lot of rough pieces right now, but it is interesting they've conceptually have a means to pull off this sort of thing by identifying the similarities in state management. There are a number of edge cases I believe in terms of execution timing, so we will see as it develops, but the idea seems promising.

Collapse
 
ryanfiller profile image
ryanfiller

Yeah, for sure. It's a very cool idea. I really hope it pans out. I moved my personal projects off of React and onto Svelte, I really miss JSX vs their template syntax.

Thread Thread
 
ryansolid profile image
Ryan Carniato

Where I stand these days is Svelte is great, but I don't want to give up the good parts from React.

My personal slant is what lead SolidJS to use explicit syntax with JSX while doing the compilation/reactive no-VDOM thing. Turns out it is really performant being explicit while harnessing the flexibility of JSX.

Collapse
 
steve8708 profile image
Steve Sewell

Thanks for taking a look and great catch - try this to see how to accomplish what you are going for

JSX Lite has some basic rules that must be followed that we are working on docs and an eslint plugin to catch and guide to the right practices we properly support

Collapse
 
ryanfiller profile image
ryanfiller

Yeah, this makes sense. To be fair, I didn't read the docs so it makes sense now that what I was trying didn't work. I may still try this out for one of my Svelte projects.