From 549c7308bebebd215dca0ee64a15b34faadfdac6 Mon Sep 17 00:00:00 2001 From: Andrew Bulat Date: Thu, 10 Oct 2024 08:20:50 +0100 Subject: [PATCH] Expose EventEmitter class on BaseClient to be used by plugins Plugins can't import EventEmitter class directly as that would increase the bundle size of a plugin --- src/common/lib/client/baseclient.ts | 2 ++ src/common/lib/client/modularplugins.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/lib/client/baseclient.ts b/src/common/lib/client/baseclient.ts index 0b37e1617..be2cde205 100644 --- a/src/common/lib/client/baseclient.ts +++ b/src/common/lib/client/baseclient.ts @@ -17,6 +17,7 @@ import { MsgPack } from 'common/types/msgpack'; import { HTTPRequestImplementations } from 'platform/web/lib/http/http'; import { FilteredSubscriptions } from './filteredsubscriptions'; import type { LocalDevice } from 'plugins/push/pushactivation'; +import EventEmitter from '../util/eventemitter'; type BatchResult = API.BatchResult; type BatchPublishSpec = API.BatchPublishSpec; @@ -179,6 +180,7 @@ class BaseClient { Logger = Logger; Defaults = Defaults; Utils = Utils; + EventEmitter = EventEmitter; } export default BaseClient; diff --git a/src/common/lib/client/modularplugins.ts b/src/common/lib/client/modularplugins.ts index e5a173665..d51f03e53 100644 --- a/src/common/lib/client/modularplugins.ts +++ b/src/common/lib/client/modularplugins.ts @@ -10,8 +10,8 @@ import { fromValuesArray as presenceMessagesFromValuesArray, } from '../types/presencemessage'; import { TransportCtor } from '../transport/transport'; -import * as PushPlugin from 'plugins/push'; -import * as LiveObjectsPlugin from 'plugins/liveobjects'; +import type * as PushPlugin from 'plugins/push'; +import type * as LiveObjectsPlugin from 'plugins/liveobjects'; export interface PresenceMessagePlugin { presenceMessageFromValues: typeof presenceMessageFromValues;