webtorrent icon indicating copy to clipboard operation
webtorrent copied to clipboard

ES8 Target

Open DiegoRBaquero opened this issue 3 years ago • 5 comments

  • [ ] addr-to-ip-port
  • [ ] bep53-range
  • [ ] bittorrent-dht
  • [ ] bittorrent-peerid
  • [ ] bittorrent-protocol
  • [ ] bittorrent-tracker
  • [ ] bittorrent-lsd
  • [ ] create-torrent
  • [ ] fs-chunk-store
  • [ ] instant.io
  • [ ] ip-set
  • [ ] load-ip-set
  • [ ] lt_donthave
  • [ ] magnet-uri
  • [ ] node-bencode
  • [ ] parse-torrent
  • [ ] render-media
  • [ ] string2compact
  • [ ] torrent-discovery
  • [ ] torrent-piece
  • [ ] ut_metadata
  • [ ] ut_pex
  • [ ] webtorrent
  • [ ] webtorrent-cli
  • [ ] webtorrent-desktop
  • [ ] webtorrent-fixtures
  • [ ] webtorrent-hybrid
  • [ ] webtorrent.io

Things we can use:

  • const / let
  • async / await
  • classes
  • block-scoped variables
  • arrow functions
  • Array.includes
  • template literals
  • de-structuring
  • ESM

DiegoRBaquero avatar May 08 '21 16:05 DiegoRBaquero

👍 Was a while since i worked in webtorrent but it dosen't seems new to me apart from ESM? Would like to see more use of

  • for-await-of
  • symbol.asyncIterator
  • less use of Buffer and more use of Uint8Array, TextEncoder/decoder and DataView

basically less connected to node's core modules https://www.youtube.com/watch?v=6EDaayYnw6M

jimmywarting avatar May 08 '21 17:05 jimmywarting

For the first two, they are supported in ES9 (2018), which we don't plan to support YET, because it drops Firefox 78 support. Less use of Buffer is def on the way :)

DiegoRBaquero avatar May 08 '21 17:05 DiegoRBaquero

Example https://github.com/webtorrent/bittorrent-tracker/commit/e5994d2ebdec10fe2165e31f5b498382eeeaaf5f

DiegoRBaquero avatar Jun 15 '21 01:06 DiegoRBaquero

Example https://github.com/webtorrent/bittorrent-protocol/commit/3d3e244319036583230d64824ce1388287233e02

DiegoRBaquero avatar Jun 23 '21 17:06 DiegoRBaquero

Hey @DiegoRBaquero I would like to work on it do you have any suggestions on which section I can work on refactoring. Thanks!

king-11 avatar Oct 06 '21 07:10 king-11