Open
Conversation
Owner
|
Lines 5 to 12 in 5b372f7
We can remove all of this: <script src="https://cdn.jsdelivr.net/npm/web-streams-polyfill@2.0.2/dist/ponyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/streamsaver@2.0.3/StreamSaver.min.js"></script>
<script>
import streamSaver from 'streamsaver'
const streamSaver = require('streamsaver')
const streamSaver = window.streamSaver
</script>and replace it with: <script type="importmap">
{
"imports": {
"streamsaver/StreamSaver.js": "https://cdn.jsdelivr.net/npm/streamsaver@3/StreamSaver.min.js"
}
}
</script>
<script type="module">
// either one works fine, the later one requires importmaps or a web bundler.
import streamSaver from 'https://cdn.jsdelivr.net/npm/streamsaver@3/StreamSaver.min.js'
import streamSaver from 'streamsaver/StreamSaver.min.js'
const uInt8 = new TextEncoder().encode('StreamSaver is awesome')
...
</script>
// StreamSaver can detect and use the Ponyfill that is loaded from the cdn.
streamSaver.WritableStream = streamSaver.WritableStream
streamSaver.TransformStream = streamSaver.TransformStream
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Author
@jimmywarting , i did some small changes, feel free to complete the rest :) |
Repository owner
deleted a comment from
erjonify
Nov 11, 2023
Repository owner
deleted a comment from
erjonify
Nov 11, 2023
jimmywarting
approved these changes
Nov 11, 2023
|
If you're using next.js, etc., make sure you dynamically bring in streamSaver.js. the way to do this is to |
|
Will it ever be merged? :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #185