by jc4p · 9y ago · 0 comments
I have a couple questions just off the homepage that I didn't quite really get answered:
- Can I use webpack? Can I add this into my current webpack flow?
- Can I use TypeScript?
- How does this compare to preact? Note that their homepage has a lot more info than this one: https://preactjs.com/
If you visit the REPL you can click on the 'output' button to see some sample output code: https://svelte.technology/repl
> Can I use webpack?
Yep, there's a webpack loader: https://github.com/sveltejs/svelte-loader
> Can I use TypeScript?
Integration with things like TypeScript is on the nice-to-have list — we have an issue here: https://github.com/sveltejs/svelte/issues/58
> How does this compare to preact?
Last time I checked, Svelte was faster. Need to get some automated benchmarks up and running, and compare sizes (and parse & startup time) for equivalent non-trivial apps.
- Unsure
- Preact is essentially a lightweight implementation of React. As such, it requires a runtime, albeit an incredibly small one, to dynamically render HTML from JSX (Edit: Well, compiled JSX. Essentially hyperscript function calls.).
Svelte components compile at buildtime to pure es5, so you can just run it directly on the client without a runtime.
There are benefits and drawbacks to each method, but that's the gist of their main differences.
If I use Svelte to make my site, is the expectation that the data is being loaded in the cacheable HTTP call or is it a SPA?