I like Svelte, actually. I think it's quite powerful and comes with a nifty toolkit. I just don't enjoy working with frameworks that view the DOM as a hostile environment from which devs need protecting.
Comments
Log in with your Bluesky account to leave a comment
I believe the opposite
The further a superset moves away from the base language, the more difficult it becomes to integrate with the ecosystem
This is why TypeScript won, because it adds only the minimum necessary to accomplish a specific goal
Among the syntaxes that unite js and html out there, I think svelte is the one that tries the hardest to maintain the separation between what is the base language and what is an addition
And tries to add as little as possible to achieve its goal
The js is vanilla except for the few explicit runes, the html is also pure except for the interpolations and control flow
The css is pure except for the global keyword
You can literally copy code from codepen and paste it into a component or import a .html file as a svelte component
I also found writing in Svelte made me understand HTML and CSS so much better. If I had to I could not use the framework at all and still make a very functional site.
I didn't feel that way at all after writing React for 2 years.
Agreed but with a few caveats:
- the semantics of the script and style elements is not 1-1
- valid HTML is not always valid Svelte (inline handlers, omitted tags etc)
I think the value svelte adds is worth the more complex compile step (was already going to compile TS anyway). Scoping my CSS, bringing reactivity and reusable components with a very minimal syntax, and basic control flow in HTML are very worthwhile.
to me svelte felt more like html and if you know html, css and js and wrote static sites with /src/index.html with included css and js. then you can write svelte pretty confedently, astro is awesome because it very similar to svelte
In the sense that Svelte, like React, you must either code within the walls of the framework, or be good enough with the DOM as a platform that the framework is just perpetually in the way. JavaScript (and Typescript) and the DOM are powerful enough; don't obscure them with tooling.
Okay: Given the complexity of the DOM platform, I don't find Svelte helps me reason about it sufficiently to justify introducing an alien syntax and (in the case of Sveltekit) precompiled code to the client.
You hit the DOM, you're hitting instances of HTMLElement in a heavily object-oriented way.
I am also a huge fan of working directly with the real code inside frontends. at least for the dev mode. build steps just add hidden magic & create a debugging nightmare.
Comments
The further a superset moves away from the base language, the more difficult it becomes to integrate with the ecosystem
This is why TypeScript won, because it adds only the minimum necessary to accomplish a specific goal
And tries to add as little as possible to achieve its goal
The css is pure except for the global keyword
You can literally copy code from codepen and paste it into a component or import a .html file as a svelte component
I didn't feel that way at all after writing React for 2 years.
- the semantics of the script and style elements is not 1-1
- valid HTML is not always valid Svelte (inline handlers, omitted tags etc)
Plus if you know HTML/CSS it’s a small change.
You hit the DOM, you're hitting instances of HTMLElement in a heavily object-oriented way.