From f6256646efc0a8d82d8ac8a81559e1565891ceb6 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Tue, 17 Oct 2023 23:25:33 -0400 Subject: [PATCH] (core) Remove deprecated code Summary: The removed code is no longer reachable now that a new version of the plugin API is being served by Grist on production. Test Plan: Existing tests. Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D4081 --- app/client/components/CustomView.ts | 1 - app/client/components/WidgetFrame.ts | 10 +--------- app/plugin/grist-plugin-api.ts | 2 ++ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/client/components/CustomView.ts b/app/client/components/CustomView.ts index d5599cd9..953edb14 100644 --- a/app/client/components/CustomView.ts +++ b/app/client/components/CustomView.ts @@ -260,7 +260,6 @@ export class CustomView extends Disposable { frame.useEvents( ConfigNotifier.create(frame, this.viewSection, { access, - theme: this.gristDoc.currentTheme, }), new MinimumLevel(AccessLevel.none)); // none access is enough frame.useEvents( diff --git a/app/client/components/WidgetFrame.ts b/app/client/components/WidgetFrame.ts index e225eb37..44944759 100644 --- a/app/client/components/WidgetFrame.ts +++ b/app/client/components/WidgetFrame.ts @@ -209,11 +209,7 @@ export class WidgetFrame extends DisposableWithEvents { this.trigger('ready', this); this._readyCalled.set(true); } - if ( - event.data.data?.message === 'themeInitialized' || - // DEPRECATED: remove once the plugin API starts sending the message above. - event.data.data?.settings?.status === 'initialized' - ) { + if (event.data.data?.message === 'themeInitialized') { this._visible.set(true); } this._rpc.receiveMessage(event.data); @@ -572,7 +568,6 @@ export class RecordNotifier extends BaseEventSource { export interface ConfigNotifierOptions { access: AccessLevel; - theme: Computed; } /** @@ -580,7 +575,6 @@ export interface ConfigNotifierOptions { */ export class ConfigNotifier extends BaseEventSource { private _accessLevel = this._options.access; - private _theme = this._options.theme; private _currentConfig = Computed.create(this, use => { const options = use(this._section.activeCustomOptions); return options; @@ -612,8 +606,6 @@ export class ConfigNotifier extends BaseEventSource { options: this._currentConfig.get(), settings: { accessLevel: this._accessLevel, - // DEPRECATED: remove once the plugin API includes the `onThemeChange` handler. - ...(fromReady ? {theme: this._theme.get()} : undefined), }, fromReady, }); diff --git a/app/plugin/grist-plugin-api.ts b/app/plugin/grist-plugin-api.ts index 218eabd1..0361b3b7 100644 --- a/app/plugin/grist-plugin-api.ts +++ b/app/plugin/grist-plugin-api.ts @@ -247,6 +247,8 @@ async function getMappingsIfChanged(data: any): Promise { * Used by tests to wait for all pending requests to settle. * * TODO: currently only waits for requests for mappings. + * + * @internal */ export async function testWaitForPendingRequests() { return await _activeRefreshReq;