Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Update events to v3 #74

Merged
merged 2 commits into from
Jan 17, 2019
Merged

Update events to v3 #74

merged 2 commits into from
Jan 17, 2019

Conversation

goto-bus-stop
Copy link
Contributor

@goto-bus-stop goto-bus-stop commented Feb 15, 2018

Matches the Node 10 API. v1 matched Node 4, and some new methods have
since been introduced (notably prepend[Once]Listener). v2 matched
Node 8, but since then Node 10 has added .off().

The major bump to v2 was because:

  • There is a breaking change in the listeners() method regarding
    once() listeners events: unwrap #once listeners in #listeners nodejs/node#6881
    I think it's super unlikely to affect anyone, but there you go.
  • The gzipped size almost doubled from 1.1KB to 2.1KB. It'll shrink a
    bit in future releases because some patches have since landed in
    Node that remove some code, but it'll still be bigger than it was
    because of the new methods.

The major bump to v3 was because:

  • Support for pre-ES5 environments was dropped (eg. IE8)
  • The new .off() method is a common name that could cause collisions
    with userland implmentations if users modified the EventEmitter
    prototype. This again is unlikely to hurt anyone, because even if they
    did define their own .off() on the EventEmitter prototype, it would
    99% certainly be doing the same thing.

Deets:
https://github.com/Gozala/events/releases/tag/v2.0.0
https://github.com/Gozala/events/releases/tag/v3.0.0

Matches the Node 8 API. v1 matched Node 4, and some new methods have
since been introduced (notably `prepend[Once]Listener`).

The major bump in `events` was because:

 - There is a breaking change in the `listeners()` method regarding
   `once()` listeners nodejs/node#6881
   I think it's super unlikely to affect anyone, but there you go.
 - The gzipped size almost doubled from 1.1KB to 2.1KB. It'll shrink a
   bit because some patches have since landed in Node that remove some
   code, but it'll still be bigger than it was because of the new
   methods.

Deets:
https://github.com/Gozala/events/releases/tag/v2.0.0
@jsf-clabot
Copy link

jsf-clabot commented Feb 15, 2018

CLA assistant check
All committers have signed the CLA.

@goto-bus-stop
Copy link
Contributor Author

Updated to events v3, which matches the Node 10 API, including the new .off() method.

@goto-bus-stop goto-bus-stop changed the title Update events to v2 Update events to v3 May 25, 2018
@TuurDutoit
Copy link

How is this coming along? Any updates?
I'm asking because I opened a related issue in the Parcel repo: parcel-bundler/parcel#1657

@mgroenhoff
Copy link

I would really like to see this one merged 😄

@kwypchlo
Copy link

@jhnns @sokra @bmeurer or any maintainer, is there any hold back on this? I had to add specific resolution override to get v3 features.

@sokra sokra merged commit 4bdd0d8 into webpack:master Jan 17, 2019
@sokra
Copy link
Member

sokra commented Jan 17, 2019

Thanks

@goto-bus-stop goto-bus-stop deleted the events-2 branch January 17, 2019 12:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants