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.
What is the purpose of this pull request? (put an "X" next to item)
[X] Documentation update
[X] Bug fix
[ ] New feature
[ ] Other, please explain:
What changes did you make? (Give an overview)
This updates docs to v2's changes, a lot of which went undocumented because well.. I wasn't sure of them.
Notable changes:
instead of using
jsdelivr
we now suggestesm.sh
, they don't actually correctly compile webtorrent YET, but that's likely to change very soon, this is more future-proofing than anything. Upside of esm.sh is that it's packages aren't bundled like when we said to use the built file of webtorrent, meaning module de-duping if they use esm.sh for other modules.added webpack suggestions with browserify in a lot more places, as a proper webpack config will yield an almost 80% smaller bundle size, with links to out webpack config
in some places I used
navigator.serviceWorker.ready
it's not exactly the correct way of registering the worker, but it's simpler and less code, worst case is that streams won't support cancelling instead use 5s timeouts on the first time the service worker is loadedfixed a few issues which I found during writing of the docs and with real-world tests
removed all instances of getBlobURL, mainly because blob url's are browser only, while blobs are now cross-platform, so it's simpler to just tell the user to wrap it themselves, the
URL.createObjectURL
API is sync anywayschanged almost all references of Buffer to Uint8Array, this isn't fully breaking as buffer extends Uint8Array anyways, with one notable exception that Buffer.slice acts like Uint8Array.subarray