plentico / pico

Svelte-like reactive UI compiler written in Go
2 stars 0 forks source link

Logic blocks without # or : #4

Open jimafisk opened 2 years ago

jimafisk commented 2 years ago

Svelte's templating language prefixes conditionals like {#if answer === 42} and {:else} which sometimes confuses folks: https://github.com/htmlx-org/HTMLx/issues/12

Removing the # and : was proposed in Svelte at one point when discussing syntax changes (https://github.com/sveltejs/svelte/issues/1318#issuecomment-379434039), but the core team thought this would making parsing too difficult.

If feasible, it would probably be more familiar for most folks to simply use syntax like {if answer === 42} and {else} and {/if}. The same would go for loops: {each} and {/each}