boardgameio / p2p

Experimental peer-to-peer multiplayer transport for boardgame.io
https://codesandbox.io/s/boardgame-io-p2p-demo-0loyd?file=/src/App.tsx
MIT License
18 stars 7 forks source link

fix: import peerjs correctly (for esinstall to work) #315

Open joust opened 1 year ago

joust commented 1 year ago

esinstall fails with the current version of p2p, because it imports Peer as default, whereas the official site doc states otherwise (see https://github.com/peers/peerjs usage). With this fix, esinstall works

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 5899132099


Totals Coverage Status
Change from base Build 5760693037: 0.0%
Covered Lines: 124
Relevant Lines: 174

đź’› - Coveralls
delucis commented 1 year ago

Thanks for the PR @joust! I wonder if this also depends on the version of Peer JS that is installed 🤔 I know this import style worked previously — although it’s been a long time since I worked on this repo.

I can see in their docs for example that they switched to documenting the default export here: https://github.com/peers/peerjs/commit/d158ea82fa214b54401fd4123e387d1e2796ae4d, but then reverted that commit due to “instability”: https://github.com/peers/peerjs/commit/84e297a719f559ada787a481b2b48a2e7dcb58c7

Were you by any chance able to test that this change didn’t break usage in non-esinstall contexts?