Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: Use ES class; drop inherits dep #530

Merged
merged 1 commit into from
Sep 7, 2019
Merged

BREAKING: Use ES class; drop inherits dep #530

merged 1 commit into from
Sep 7, 2019

Conversation

feross
Copy link
Owner

@feross feross commented Aug 6, 2019

Use an ES class so we can drop the inherits dependency. All the WebRTC environments we support have supported ES classes for a long time.

All usages of Peer() must be replaced with new Peer() now. This was always the way code examples in the readme have been written.

I know this is a lot of code to review. The only transformations I made were:

  • Remove inherits dep.
  • Use an ES class
  • Convert all self to this
  • Remove all lines with var self = this
  • Convert all anonymous functions to fat arrow syntax.

For: brave/brave-browser#5490

Use an ES class so we can drop the `inherits` dependency. All the WebRTC environments we support have supported ES classes for a long time.

All usages of `Peer()` must be replaced with `new Peer()` now. This was always the way code examples in the readme have been written.
Copy link
Collaborator

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, I wish vanilla JS also supported proper properties on classes.
self -> this is a really welcome change 👍

@feross
Copy link
Owner Author

feross commented Aug 17, 2019

I wish vanilla JS also supported had proper properties on classes

It's stage 3. Should be possible relatively soon. https://github.com/tc39/proposal-class-fields

@feross feross merged commit db77c2c into master Sep 7, 2019
@feross feross deleted the es-class branch September 7, 2019 20:40
FredZeng pushed a commit to FredZeng/simple-peer that referenced this pull request Oct 14, 2023
BREAKING: Use ES class; drop `inherits` dep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants