DEV Community

Andrey Hugh
Andrey Hugh

Posted on

That's why I can't use Svelte

Since the OpenSource era beginning, the modern developing environment is built from small and independent pieces. This is our power and our weakness. An average Web app can contain dozens or even hundreds of separate technologies. And this brings the power to replace some parts of it without touching another.

This is especially true for the React related ecosystem: you are supposed to pick every single piece yourself and then build them up. This is hard, but this is powerful.

Say, you are not tied to Babel to compile JSX, you can pick some another transpiler/compiler or even language such as Kotlin. Or you can use no JSX with hyperscript.

But, in Svelte it looks like you don't have the freedom to control every part of your stack. You can't even use TypeScript, which gains popularity every day, and is de facto standard in some companies. There is some work is in progress on it, but is far from finish I'm afraid.

Svelte TS issue

I hope this will change in the future, but today it feels a deal-breaking thing.

Top comments (3)

Collapse
 
catalactics profile image
Joshua Pelealu

(From the future here) I'd say Svelte has done a really GREAT JOB at giving user as much freedom as possible:

  • Svelte now officially supports TypeScript yay!!!!
  • Because of it's support of svelte-preprocessor, you can use SCSS, SASS, Less, TailwindCSS, Bootstrap, etc... using PostCSS.
  • Svelte now lets you customize your bundler. You can use the default rollup, but they let you use Webpack with documentations given.
  • Recently they have anounced SvelteKit which will use Snowpack for Development environment.
Collapse
 
steveblue profile image
Stephen Belovarich

IMHO its alright for a JavaScript framework to only be compatible with certain tools.

Remember Svelte is a framework founded by an engineer at The NY Times. Svelte was probably first and foremost created to aid in the majority of use cases found in the static content hosted by The NY Times. To that end, Svelte is brilliant. It keeps the size of the bundle down. If your job is coding charts and graphics that have to be viewable on many devices and be extremely performant, vanilla JS is the way to go IMHO. Svelte brings some sanity to that way of working. Official TypeScript support would be nice, but there are probably ways you can still build with TypeScript in your own project.

Collapse
 
csaltos profile image
Carlos Saltos

Well, now you can use svelte-preprocess to use Svelte with PostCSS, SCSS, Less, Stylus, CoffeeScript, TypeScript, Pug and much more, please give it a check to -> github.com/sveltejs/svelte-preprocess it's really cool !!

Also here a short video about more detail about using TypeScript with Svelte -> dev.to/cvng/enable-typescript-in-s...

So, Svelte is OpenSource and OpenSource is freedom, enjoy !! ;) :)