This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new a75f9b67b28 chore(superset-ui-switchboard): forward-compat fixes for
TypeScript 6.0 (Phase E) (#40028)
a75f9b67b28 is described below
commit a75f9b67b28dfcd5e8c1694cf48ff387b423aa70
Author: Evan Rusackas <[email protected]>
AuthorDate: Wed May 20 15:37:52 2026 -0700
chore(superset-ui-switchboard): forward-compat fixes for TypeScript 6.0
(Phase E) (#40028)
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude Opus 4.7 <[email protected]>
---
.../packages/superset-ui-switchboard/src/switchboard.test.ts | 7 +++++--
.../packages/superset-ui-switchboard/src/switchboard.ts | 6 +++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git
a/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts
b/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts
index 5bfe77903ff..352c508b2e8 100644
--- a/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts
+++ b/superset-frontend/packages/superset-ui-switchboard/src/switchboard.test.ts
@@ -95,8 +95,11 @@ class FakeMessageChannel {
const port2 = new FakeMessagePort();
port1.otherPort = port2;
port2.otherPort = port1;
- this.port1 = port1;
- this.port2 = port2;
+ // FakeMessagePort only implements the subset of MessagePort that
+ // Switchboard exercises; cast at the boundary so the fake satisfies
+ // the consumer signature without weakening the production type.
+ this.port1 = port1 as unknown as MessagePort;
+ this.port2 = port2 as unknown as MessagePort;
}
}
diff --git
a/superset-frontend/packages/superset-ui-switchboard/src/switchboard.ts
b/superset-frontend/packages/superset-ui-switchboard/src/switchboard.ts
index d1df6136a50..46af6fb4d3e 100644
--- a/superset-frontend/packages/superset-ui-switchboard/src/switchboard.ts
+++ b/superset-frontend/packages/superset-ui-switchboard/src/switchboard.ts
@@ -88,7 +88,7 @@ function isError(message: Message): message is ErrorMessage {
* Calling methods on the switchboard causes messages to be sent through the
channel.
*/
export class Switchboard {
- port: MessagePort;
+ port!: MessagePort;
name = '';
@@ -97,9 +97,9 @@ export class Switchboard {
// used to make unique ids
incrementor = 1;
- debugMode: boolean;
+ debugMode = false;
- private isInitialised: boolean;
+ private isInitialised = false;
constructor(params?: Params) {
if (!params) {