Adapt to react-native's changes to ReactNativeBridgeEventPlugin #199
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.
Fixes #191
ReactNativeBridgeEventPlugin got removed here: facebook/react-native@906dde0
We used to rely on ReactNativeBridgeEventPlugin to register gesture specific event types. Without it, react will throw an error whenever gesture event gets dispatched as the even type would not be recognized by the react event system.
To fix that I had to find a way to inject event type configuration. The most robust solution I have found was to override event config of RCTView. A view that is a baseclass for all the other components in the system. Adding gesture handler event types to RCTView configuration guarantees that these will be properly registered in event registry before any event gets dispatched.
This change renders whole idea of "DummyViewManager" obsolete. The role of "DummyViewManager" was at first to export event type configuration to JS and let react consume that view configuration to register new event types.
This changed when view manager lazy loading got introduced and the configuration wouldn't be parsed unless at least one instance of the "DummyView" got mounted.
To overcome this issue we started relying on ReactNativeBridgeEventPlugin to force register new event types. But we still needed dummy view manager on Android as it has been used by CustomEventNamesResolver to translate event registration name ("topGestureHandler" to "onGestureHandler").
The latter has been resolved by changing the registration and event name to be the same by ditching weird "topXXX" prefix. We now only use "onGestureHandler..." as a prefix for events which does no longer require us to have event configuration on the native side.