4 ms·
Svelte is compiled, but not compiled to html. It is compiled to js. It works like any other client side js framework like react/vue
by rk06 4y ago
Svelte is compiled, but not compiled to html. It is compiled to js. It works like any other client side js framework like react/vue
- ttfkam 4y agoDepends on whether or not the following is set: export const prerender = true; If it is, it IS in fact compiled to HTML. :-) https://kit.svelte.dev/docs/page-options#prerender https://kit.svelte.dev/docs/page-options#prerender Compilers are awesome.
- can_center_divs 4y agoThis assumes you are using SvelteKit, not vanilla Svelte
- ttfkam 4y agonpm create svelte my-app Creates a SvelteKit app now, not plain Svelte. That said, you can easily disable the server-side portion. export const ssr = false;
- can_center_divs 4y agoThe important difference to note compared to React, is that Svelte doesn't virtualize the DOM. It works in the same way vanilla JS works when it comes to DOM manipulation. Even though it is compiled, you are still working closer to the browser. You can still use all vanilla JS DOM manipulation methods in your code and it will work as expected. Which is an enormous advantage over React, at least for me.