-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayBuffer / Blob constructor conflict #56
Comments
There is no "blob" concept in Elm, so I would rather not expose a function like this in Elm itself. Is there any way to detect if it is an IE browser and do this trick only in that situation? E.g. If elm/file#7 fixes elm/file#5 as well, why is this preferable to that? |
yeah.. the naming is kinda tricky, but I'll try to clear up what is happening. It is a cross-cutting concern of elm/http and elm/file. The underlying js thing that happened To summarize,
This might be a decent approach, but BlobBuilder is a deprecated api interface. I'm not sure how much y'all care about that - elm/file#7 For context, this is not a serious issue for our app. The OG bug report for this was elm/file#5 The application scenario was: Our code was changed to do this I was helping out with troubleshooting the original bug report on our end. I do not have a strong feeling about whether this code should be accepted. I did think it was worth a conversation. |
Closing this issue at Evan's request as the SSCCE is here. |
I think it makes sense to use #58 as the canonical statement of this problem. Thanks again for creating that! |
We have a situation where we fetch binary data with http, then prompt the user, then use Download.bytes to allow the user to save the file.
In IE11, using
expectBytesResponse
yieldsInvalidStateException
b/c Blobs cannot be initialized from array buffers. This is because expectBytesResponse setsxhr.responseType = 'arraybuffer'
.Run this in IE11 to see the Blob constructor issue in isolation.
new Blob( new ArrayBuffer([123]), { type: 'application/*' } );
We were able to solve the problem by creating a new expect factory function like this.
We really don't want people to use Elm.Kernel inside of their application code so I'm gonna submit a PR to add this to the library.
Please let me know what you think. :)
The text was updated successfully, but these errors were encountered: