3 ms·
Recently did some framework shipping and wanted to plug Svelte despite not having deployed it yet. The approach of using a compiler instead of a framework make
by kohtatsu 7y ago
Recently did some framework shipping and wanted to plug Svelte despite not having deployed it yet.
The approach of using a compiler instead of a framework makes a lot of sense and I personally believe it's the best way forward.
I recommend watching the talk here; https://svelte.dev/blog/svelte-3-rethinking-reactivity https://svelte.dev/blog/svelte-3-rethinking-reactivity
- thinkloop 7y ago> The approach of using a compiler instead of a framework makes a lot of sense I agree, I wish it wasn't an entire framework though and more of a front-end library like react. I've learnt long ago not to invest too much into a single tool.
- buzzerbetrayed 7y agoI feel like you just agreed with him and disagreed with him. How can a compiler be a front end library? Svelte can target web components, which allows you to use it in just a portion of a web page, just like react.
- thinkloop 7y agoI should've said "rendering engine" rather than "front-end library", to still be able to use things like redux, css processors, etc. But your comment made me realize that may not actually make sense. I'm still generally hesitant when a single framework takes over the entire chain.
- noway421 7y agoApparently scheduling/skipping renders is hard with this approach, since render function gets compiled away and becomes hardcoded DOM calls in the result bundle. React with Suspense takes a different approach here and allows to suspend renders, skip slow renders (I think) till they're ready, prioritise keyboard input, etc. It's essentially a similar tradeoff as in AOT vs JIT. Even though AOT brings the compilation step forward, JIT would have much more runtime context for better performance.
- pier25 7y agoYeah, but in truth you might never need Suspense when using Svelte. Reacts needs Suspense because it's quite slow and bloated in comparison. See this video Rich Harris made when comparing a visualization use case: https://twitter.com/Rich_Harris/status/1200807516529147904 https://twitter.com/Rich_Harris/status/1200807516529147904
- buzzerbetrayed 7y agoI’ve been using Svelte for nearly all my personal projects for a while and I absolutely love it. The only thing I really wish it had was typescript support, which I think is in the works.
- anonymousCar 7y agoCurious that Vue threads on HN always have some upvoted post about svelte
- pier25 7y agoTotally agree. I've used Vue, React, Preact, Mithril, Inferno, Imba, and Angular for the past 6 years. I started doing front end in the late 90s btw. I tried Svelte for a small project last year and liked it. A couple of weeks ago I evaluated it more seriously and decided to go with it for my current big project. I was initially attracted to Svelte by the performance and small bundle sizes but was concerned about all the custom syntax, single file components, and the pragmatic magical approach. But oh boy after using it for a couple of days you become super productive really fast. I think this is actually its best feature.