The release 2.5.0 contains an unintended issue, where events is implied as provider for EventEmitter.
However this was due to an assumption that RN simply bundles node's events as they don't contain any native bindings. However, this is not the case and the events that may have been used is actually a derivative from the npm registry:
This PR attempts to solve this by using React Natives' NativeEventEmitter and wrapping it to contain the on and off functions to preserve the original API.
Tests
During test environment it falls back to events which is then supplied by Node, since we use Node to run the tests.
and then build your app. Please make sure you have no events in your dependencies' ordevDependenciesor any other dependencies (optional, peer) inpackage.json`
Problem description
The release 2.5.0 contains an unintended issue, where
events
is implied as provider forEventEmitter
.However this was due to an assumption that RN simply bundles node's
events
as they don't contain any native bindings. However, this is not the case and theevents
that may have been used is actually a derivative from the npm registry:https://www.npmjs.com/package/events
This is insufficient as it still requires an external dependency. Futhermore it raises errors on new installations: https://github.com/meteorrn/meteor-react-native/pull/116#issuecomment-1688830377
Solution
This PR attempts to solve this by using React Natives'
NativeEventEmitter
and wrapping it to contain theon
andoff
functions to preserve the original API.Tests
During test environment it falls back to
events
which is then supplied by Node, since we use Node to run the tests.How to test in your setup?
You can simply install this via
and then build your app. Please make sure you have no
events
in yourdependencies' or
devDependenciesor any other dependencies (optional, peer) in
package.json`Any issues reported are much appreciated!