Skip to content

Commit

Permalink
Move remaining static properties from BaseRealtime to DefaultRealtime
Browse files Browse the repository at this point in the history
These properties are only used by the tests and are not part of the
public API. Let’s move them out of BaseRealtime to make it more
tree-shakable.
  • Loading branch information
lawrence-forooghian committed Oct 26, 2023
1 parent c18d6a0 commit 0cabc49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/common/lib/client/baserealtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ProtocolMessage from '../types/protocolmessage';
import { ChannelOptions } from '../../types/channel';
import ClientOptions from '../../types/ClientOptions';
import * as API from '../../../../ably';
import ConnectionManager from '../transport/connectionmanager';
import { ModulesMap } from './modulesmap';

/**
Expand Down Expand Up @@ -40,10 +39,6 @@ class BaseRealtime extends BaseClient {
Logger.logAction(Logger.LOG_MINOR, 'Realtime.close()', '');
this.connection.close();
}

static Utils = Utils;
static ConnectionManager = ConnectionManager;
static ProtocolMessage = ProtocolMessage;
}

class Channels extends EventEmitter {
Expand Down
7 changes: 7 additions & 0 deletions src/common/lib/client/defaultrealtime.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import BaseRealtime from './baserealtime';
import ClientOptions from '../../types/ClientOptions';
import { allCommonModules } from './modulesmap';
import * as Utils from '../util/utils';
import ConnectionManager from '../transport/connectionmanager';
import ProtocolMessage from '../types/protocolmessage';

/**
`DefaultRealtime` is the class that the non tree-shakable version of the SDK exports as `Realtime`. It ensures that this version of the SDK includes all of the functionality which is optionally available in the tree-shakable version.
Expand All @@ -9,4 +12,8 @@ export class DefaultRealtime extends BaseRealtime {
constructor(options: ClientOptions) {
super(options, allCommonModules);
}

static Utils = Utils;
static ConnectionManager = ConnectionManager;
static ProtocolMessage = ProtocolMessage;
}

0 comments on commit 0cabc49

Please sign in to comment.