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.
Sorry, just copy&paste it from CHANGELOG because I want to sync it.
V2
The main goals of the second version:
es6
and latest tools;Breaking changes
Drop ES5 supports
If you need to support es5, you can recompile the lib from the sources or use the latest version from the v1 branch like
npm i peerjs@1
.Remove
webrtc-adapter
package fromdependencies
The modern browsers mostly works good without any additional libs like webrtc-adapter.
You can increase cross browsers support by manually add
webrtc-adapter
package to your project:npm install webrtc-adapter
Then import it as soon as possible. For example, you have an entry point for your application in the file
index.tsx
. So, lets add the import:See more: https://github.com/webrtcHacks/adapter
Remove browser detection features from the library.
The
browser
field was removed from theutil
classand the
OFFER
packet.The
main
field ofpackage.json
now points to the non minified version.Today, most projects use bundlers with a minification step. Sometimes, double minification can lead to issues.
If you want to use the minified version, use it directly from the
dist
folder like:Use
ESBuild
as bundler.Parcel 1 was a good choice years ago, but now esbuild seems like simple and good solution!
Another changes
devDependencies
Prettier
for the code style