Re:Thoughts on Svelte
by rk06 on Monday March 27, 2023 @01:38PM
(#35329727)
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
[ Parent
| on HN ]
Depends 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#prerenderCompilers are awesome.
Re:Thoughts on Svelte
by can_center_divs on Wednesday March 29, 2023 @01:29AM
(#35353023)
This assumes you are using SvelteKit, not vanilla Svelte
npm 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;
Re:Thoughts on Svelte
by can_center_divs on Wednesday March 29, 2023 @01:31AM
(#35353035)
The 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.