export let myProp = 10
work in any JS module? I thought it was quite standard. Maybe I'm mistaken, JS/TS is not my first language, but I think it's pretty obvious what it's doing.In any case,
let { myProp = 10 } = $props
does not even remotely work like it would in JS. It's literally a compiler directive.That is, $props is not an object. The string "$props" is a compile-time directive that declares myProp to be a prop. It's not destructuring $props, it's declaring myProp. "$props" is a magic incantation defined within the Svelte compiler.
I mean, this is my point really. It's using JS syntax but it's no longer obvious what it's doing.
To your point, given that Svelte compiles the code anyway, I don't understand why they couldn't have kept the existing syntax ("vibe") and just changed the semantics. Why come up with some brand new, syntactically-compatible- but semantically-incompatible-with-JS, syntax?