News for hackers. Stuff that matters.
Re:How I made a website with Svelte by Wolfr_ on Saturday December 28, 2019 @11:01AM (#21899520)
The difference is that Svelte is pre-compiled while Angular will put templates through the renderer while building up the page.
Re:How I made a website with Svelte by IggleSniggle on Saturday December 28, 2019 @11:51AM (#21899921)
Angular has been pre-compiled for years. The AOT compiler has been available since Angular 2, released in 2015. It has also been able to produce stand-alone native web-components since 2018, btw.

It's only recently that it started producing multiple packages simultaneously, however (to serve up a package optimized for the client's web platform).

Re:How I made a website with Svelte by ricardobeat on Saturday December 28, 2019 @01:19PM (#21900605)
Most modern frameworks can be AOT compiled in that sense - React, Vue, Riot - they load JS code only at runtime, but still use templates (VDOM, strings or another representation) as blueprints to update/manipulate the DOM. AFAIK Angular still uses dirty checking; Angular Ivy, yet to be released, will move to something a little closer (incremental-dom), but still not the same.

What Svelte does is precompile the UI update code[1], changing text nodes, attributes, children, targeting DOM nodes directly. Think Prepack[2] vs DOM diffing.

[1] https://svelte.dev/repl/hello-world?version=3.16.7

[2] https://prepack.io/

Re:How I made a website with Svelte by paulddraper on Saturday December 28, 2019 @04:14PM (#21901774)
> Think Prepack

Angular compiler is certainly an optimizing compiler.

> Angular Ivy, yet to be released

Ivy became an opt-in feature of the Angular CLI earlier this year with Angular v8.

> AFAIK Angular still uses dirty checking

Ivy uses "dirty checking" too [1]. AFAIK Ivy and pre-Ivy operate on similar fundamental principals, which is why Ivy is a drop-in replacement.

[1] https://indepth.dev/what-every-front-end-developer-should-kn...

Re:How I made a website with Svelte by paulddraper on Saturday December 28, 2019 @11:04AM (#21899540)
Angular v1 interpreted templates at runtime.

Starting in 2015, Angular v2+ uses an optimizing AOT compiler. [1]

[1] https://angular.io/guide/aot-compiler

Re:How I made a website with Svelte by The_rationalist on Saturday December 28, 2019 @11:02AM (#21899529)
Why does it matter?
Re:How I made a website with Svelte by badfrog on Saturday December 28, 2019 @11:03AM (#21899535)
Much faster initial load.
Re:How I made a website with Svelte by The_rationalist on Saturday December 28, 2019 @11:43AM (#21899857)
Benchs?