From 96f4cf8bd3af9a8525cab7a68d5f081947c7467d Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Thu, 3 Aug 2023 05:30:37 -0300 Subject: [PATCH] Remove redundant static properties from BaseRealtime These already exist in its superclass BaseClient. --- src/common/lib/client/baserealtime.ts | 5 ----- src/platform/nativescript/index.ts | 4 ++-- src/platform/nodejs/index.ts | 4 ++-- src/platform/react-native/index.ts | 4 ++-- src/platform/web-noencryption/index.ts | 4 ++-- src/platform/web/index.ts | 4 ++-- src/platform/web/modules.ts | 1 - 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/common/lib/client/baserealtime.ts b/src/common/lib/client/baserealtime.ts index fb7e888bb0..7164c04b7d 100644 --- a/src/common/lib/client/baserealtime.ts +++ b/src/common/lib/client/baserealtime.ts @@ -10,8 +10,6 @@ import { ChannelOptions } from '../../types/channel'; import ClientOptions from '../../types/ClientOptions'; import * as API from '../../../../ably'; import ConnectionManager from '../transport/connectionmanager'; -import Platform from 'common/platform'; -import Message from '../types/message'; import { ModulesMap } from './modulesmap'; /** @@ -45,10 +43,7 @@ class BaseRealtime extends BaseClient { static Utils = Utils; static ConnectionManager = ConnectionManager; - static Platform = Platform; static ProtocolMessage = ProtocolMessage; - static Message = Message; - static Crypto?: typeof Platform.Crypto; } class Channels extends EventEmitter { diff --git a/src/platform/nativescript/index.ts b/src/platform/nativescript/index.ts index 5f8fee9253..be9941dc66 100644 --- a/src/platform/nativescript/index.ts +++ b/src/platform/nativescript/index.ts @@ -1,4 +1,5 @@ // Common +import BaseClient from '../../common/lib/client/baseclient'; import { DefaultRest } from '../../common/lib/client/defaultrest'; import { DefaultRealtime } from '../../common/lib/client/defaultrealtime'; import Platform from '../../common/platform'; @@ -29,8 +30,7 @@ Platform.Config = Config; Platform.Transports = Transports; Platform.WebStorage = WebStorage; -DefaultRest.Crypto = Crypto; -DefaultRealtime.Crypto = Crypto; +BaseClient.Crypto = Crypto; Logger.initLogHandlers(); diff --git a/src/platform/nodejs/index.ts b/src/platform/nodejs/index.ts index ca7e40e0d8..eb67752641 100644 --- a/src/platform/nodejs/index.ts +++ b/src/platform/nodejs/index.ts @@ -1,4 +1,5 @@ // Common +import BaseClient from '../../common/lib/client/baseclient'; import { DefaultRest } from '../../common/lib/client/defaultrest'; import { DefaultRealtime } from '../../common/lib/client/defaultrealtime'; import Platform from '../../common/platform'; @@ -25,8 +26,7 @@ Platform.Config = Config; Platform.Transports = Transports; Platform.WebStorage = null; -DefaultRest.Crypto = Crypto; -DefaultRealtime.Crypto = Crypto; +BaseClient.Crypto = Crypto; Logger.initLogHandlers(); diff --git a/src/platform/react-native/index.ts b/src/platform/react-native/index.ts index c7bf713567..88dae850da 100644 --- a/src/platform/react-native/index.ts +++ b/src/platform/react-native/index.ts @@ -1,4 +1,5 @@ // Common +import BaseClient from '../../common/lib/client/baseclient'; import { DefaultRest } from '../../common/lib/client/defaultrest'; import { DefaultRealtime } from '../../common/lib/client/defaultrealtime'; import Platform from '../../common/platform'; @@ -29,8 +30,7 @@ Platform.Config = Config; Platform.Transports = Transports; Platform.WebStorage = WebStorage; -DefaultRest.Crypto = Crypto; -DefaultRealtime.Crypto = Crypto; +BaseClient.Crypto = Crypto; Logger.initLogHandlers(); diff --git a/src/platform/web-noencryption/index.ts b/src/platform/web-noencryption/index.ts index 5c813474b8..e10ae425c2 100644 --- a/src/platform/web-noencryption/index.ts +++ b/src/platform/web-noencryption/index.ts @@ -1,4 +1,5 @@ // Common +import BaseClient from '../../common/lib/client/baseclient'; import { DefaultRest } from '../../common/lib/client/defaultrest'; import { DefaultRealtime } from '../../common/lib/client/defaultrealtime'; import Platform from '../../common/platform'; @@ -24,8 +25,7 @@ Platform.Config = Config; Platform.Transports = Transports; Platform.WebStorage = WebStorage; -DefaultRest.Crypto = null; -DefaultRealtime.Crypto = null; +BaseClient.Crypto = null; Logger.initLogHandlers(); diff --git a/src/platform/web/index.ts b/src/platform/web/index.ts index 7c984e304e..ea6fb1b53e 100644 --- a/src/platform/web/index.ts +++ b/src/platform/web/index.ts @@ -1,4 +1,5 @@ // Common +import BaseClient from '../../common/lib/client/baseclient'; import { DefaultRest } from '../../common/lib/client/defaultrest'; import { DefaultRealtime } from '../../common/lib/client/defaultrealtime'; import Platform from '../../common/platform'; @@ -27,8 +28,7 @@ Platform.Config = Config; Platform.Transports = Transports; Platform.WebStorage = WebStorage; -DefaultRest.Crypto = Crypto; -DefaultRealtime.Crypto = Crypto; +BaseClient.Crypto = Crypto; Logger.initLogHandlers(); diff --git a/src/platform/web/modules.ts b/src/platform/web/modules.ts index 8054981daf..d924eab04e 100644 --- a/src/platform/web/modules.ts +++ b/src/platform/web/modules.ts @@ -28,7 +28,6 @@ Platform.Transports = Transports; Platform.WebStorage = WebStorage; BaseClient.Crypto = Crypto; -BaseRealtime.Crypto = Crypto; Logger.initLogHandlers();