Fix faulty import of JSONP transport to React Native and NativeScript #726
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.
Resolves an issue which would cause the library to throw an error on import in React Native and NativeScript.
To summarise, the issue was that each platform was using an array of 'Transports' and explicitly initialising each one as soon as the library is loaded, but it was also using
null-loader
to omit the JSONP platform from React Native and NativeScript builds so it was essentially attempting to initialise an empty module as if it were a Transport. This PR adds a separate array of transports without JSONP to fix this error.This PR would also allow React Native users to use the
ably
NPM module directly since the recent work around ES6 modules displaces the need for theably-js-react-native
wrapper.