Replies: 1 comment
-
Just wait for Svelte 5. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using Svelte in many many projects for quite some time now and I'm absolutely loving it. It's simple way of build UI's and handling state is amazing. Also the way templating works in svelte is amazing.
However..
The only downside that still confuses me is that the compiler still generates a big chunk of code for something even as simple as a single element or just a loop. Compared to the output Solidjs generates which is extremely small and uses DOMExpressions for building reactive UI's this could be very interesting. Now you could be wondering "Why don't you just use Solid instead?" and ofcourse I could just hop to any other framework of choice, but why switch when having all the great things in Svelte I wouldn't have anywhere else?
A possible solution
Now I've been experimenting with various options, such as extending the Svelte compiler and trying to generate my own markup or optimized javascript but this proves rather challenging since Svelte generates your runtime based on your code/templates and doesn't really have it's own runtime specifically. So extending the compiler would mean writing your own framework which isn't really the ideal solution.. What could be an interesting solution, is that the compiler would be exposed as public API where users could modify or extend the compiler based on their needs. Since Svelte is well integrated with Vite and Vite is extendable in such way aswell with plugins, this could make the Svelte compiler generate a much more interesting runtime.
I would like what the creators/community thinks about this as I'm not sure if anyone else has had the same problem.
Beta Was this translation helpful? Give feedback.
All reactions