Skip to content

Commit

Permalink
BREAKING CHANGE: Deprecate webtorrent-hybrid (#195)
Browse files Browse the repository at this point in the history
* fix: update tests to use import.

* BREAKING CHANGE: Deprecate webtorrent-hybrid

This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the "webtorrent" package.

* fix: Update ci to use NodeJS 16 to match package.json

* Update README.md

Update `Deprecated Warning` to `Deprecation Warning`

Co-authored-by: Cas_ <[email protected]>

* fix: re-add WEBTORRENT_ANNOUNCE which is used for adding websocket trackers to magnetURIs which do not already have them.

* feat: update webtorrent-cli to v5

---------

Co-authored-by: Cas_ <[email protected]>
  • Loading branch information
SilentBot1 and ThaUnknown authored Jun 2, 2024
1 parent 98c8d76 commit fe511bf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
os:
- ubuntu-latest
node:
- '14'
- '16'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Deprecation Warning
This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the "webtorrent" package.

# webtorrent-hybrid [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[ci-image]: https://github.com/webtorrent/webtorrent-hybrid/actions/workflows/ci.yml/badge.svg
Expand Down
4 changes: 2 additions & 2 deletions examples/node-download.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const WebTorrent = require('../index')
const fs = require('fs')
import WebTorrent from '../index.js'
import fs from 'fs'

const client = new WebTorrent()

Expand Down
2 changes: 1 addition & 1 deletion examples/node-seed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const WebTorrent = require('../index')
import WebTorrent from '../index.js'

const client = new WebTorrent()
const filePath = __filename
Expand Down
3 changes: 1 addition & 2 deletions lib/global.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { announceList } from 'create-torrent'
import wrtc from 'wrtc'

globalThis.WEBTORRENT_ANNOUNCE = announceList
.map(arr => arr[0])
.filter(url => url.indexOf('wss://') === 0 || url.indexOf('ws://') === 0)

globalThis.WRTC = wrtc
console.warn('webtorrent-hybrid: This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the "webtorrent" package.')
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"bugs": {
"url": "https://github.com/webtorrent/webtorrent-hybrid/issues"
},
"deprecated": "This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the \"webtorrent\" package.",
"dependencies": {
"create-torrent": "^5.0.0",
"webtorrent": "^1.0.0",
"webtorrent-cli": "^4.0.0",
"wrtc": "^0.4.6"
"create-torrent": "^6.0.17",
"webtorrent": "^2.3.0",
"webtorrent-cli": "^5.0.0"
},
"devDependencies": {
"@webtorrent/semantic-release-config": "1.0.10",
"semantic-release": "21.1.2",
"standard": "*"
},
"engines": {
"node": ">=12.20.0"
"node": ">=16"
},
"homepage": "https://webtorrent.io",
"keywords": [
Expand Down

0 comments on commit fe511bf

Please sign in to comment.