Skip to content

Commit

Permalink
Merge pull request #726 from ably/feature/react-native-transport-fix
Browse files Browse the repository at this point in the history
Fix faulty import of JSONP transport to React Native and NativeScript
  • Loading branch information
owenpearson authored Mar 25, 2021
2 parents 989e35c + abeda9a commit cd94ea9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
10 changes: 10 additions & 0 deletions browser/lib/transport/withoutjsonp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file exists for React Native and Nativescript in order to exclude the unsupported JSONP transport from these platforms.
*/
import XHRPollingTransport from './xhrpollingtransport';
import XHRStreamingTransport from './xhrstreamingtransport';

export default [
XHRPollingTransport,
XHRStreamingTransport
];
22 changes: 3 additions & 19 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,9 @@ const nativeScriptConfig = {
'platform-crypto': path.resolve(browserPath, 'lib', 'util', 'crypto'),
'platform-webstorage': path.resolve(browserPath, 'lib', 'util', 'webstorage'),
'platform-msgpack': path.resolve(browserPath, 'lib', 'util', 'msgpack'),
'platform-transports': path.resolve(browserPath, 'lib', 'transport'),
'platform-transports': path.resolve(browserPath, 'lib', 'transport', 'withoutjsonp'),
},
},
module: {
rules: [
{
test: /(jsonptransport\.js|domevent\.js)/,
use: 'null-loader',
},
],
},
node: {
crypto: 'empty',
Buffer: false,
Expand Down Expand Up @@ -166,17 +158,9 @@ const reactNativeConfig = {
'platform-crypto': path.resolve(browserPath, 'lib', 'util', 'crypto'),
'platform-webstorage': path.resolve(browserPath, 'lib', 'util', 'webstorage'),
'platform-msgpack': path.resolve(browserPath, 'lib', 'util', 'msgpack'),
'platform-transports': path.resolve(browserPath, 'lib', 'transport'),
'platform-transports': path.resolve(browserPath, 'lib', 'transport', 'withoutjsonp'),
},
},
module: {
rules: [
{
test: /jsonptransport\.js/,
use: 'null-loader',
},
],
},
node: {
crypto: 'empty',
Buffer: false,
Expand Down Expand Up @@ -267,4 +251,4 @@ module.exports = [
noEncryptionMinConfig,
commonJsConfig,
commonJsNoEncryptionConfig,
];
];

0 comments on commit cd94ea9

Please sign in to comment.