You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you bind to the buffered property of an <audio> element, for instance, the value that comes from this property has the type Array<{ start: number; end: number; }>. If you use that type on a bound variable, however, svelte-check will report its incompatibility with TimeRanges, which is what the type of this property should be.
<scriptlang="ts">
let buffered:Array<{ start:number; end:number; }>; // Type error!
</script>
<audiobind:buffered />
Opinion on these types
In my opinion, this conversion from TimeRanges to a custom type is unjustified. Yes, TimeRanges is ridiculous, but it's standardized. Learning to operate this new type (the documentation of which is buried deep within the tutorial) is an unpleasant experience by itself. In this regard, I really like the approach of the Remix web framework that goes to great lengths to ensure transferability of knowledge. This type conversion is one of the few examples where knowledge of Svelte is not tranferable, and in my opinion it trumps the convenience of writing a for .. of loop instead of an index-based one.
Describe the bug
When you bind to the
buffered
property of an<audio>
element, for instance, the value that comes from this property has the typeArray<{ start: number; end: number; }>
. If you use that type on a bound variable, however,svelte-check
will report its incompatibility withTimeRanges
, which is what the type of this property should be.Opinion on these types
In my opinion, this conversion from
TimeRanges
to a custom type is unjustified. Yes,TimeRanges
is ridiculous, but it's standardized. Learning to operate this new type (the documentation of which is buried deep within the tutorial) is an unpleasant experience by itself. In this regard, I really like the approach of the Remix web framework that goes to great lengths to ensure transferability of knowledge. This type conversion is one of the few examples where knowledge of Svelte is not tranferable, and in my opinion it trumps the convenience of writing afor .. of
loop instead of an index-based one.Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-8p9wht?file=src/routes/index.svelte
Logs
System Info
StackBlitz doesn't play well with `envinfo`, but it's a fresh install, so all the versions are the latest
Severity
annoyance
The text was updated successfully, but these errors were encountered: