justinpark commented on code in PR #29584:
URL: https://github.com/apache/superset/pull/29584#discussion_r1679785889


##########
superset-frontend/src/hooks/useTabId.ts:
##########
@@ -18,17 +18,13 @@
  */
 import { useEffect, useState } from 'react';
 import shortid from 'shortid';
-import { BroadcastChannel } from 'broadcast-channel';
+import {
+  StrictBroadcastChannel,
+  TabIdChannelMessage,
+} from './strictBroadcastChannel';
 
-interface TabIdChannelMessage {
-  type: 'REQUESTING_TAB_ID' | 'TAB_ID_DENIED';
-  tabId: string;
-}
-
-// TODO: We are using broadcast-channel to support Safari.
-// The native BroadcastChannel API will be supported in Safari version 15.4.
-// After that, we should remove this dependency and use the native API.
-const channel = new BroadcastChannel<TabIdChannelMessage>('tab_id_channel');
+const channel: StrictBroadcastChannel<TabIdChannelMessage> =
+  new BroadcastChannel('tab_id_channel');

Review Comment:
   nit: How about making the tab_id_channel value constant?



##########
superset-frontend/src/hooks/useTabId.ts:
##########
@@ -18,17 +18,13 @@
  */
 import { useEffect, useState } from 'react';
 import shortid from 'shortid';
-import { BroadcastChannel } from 'broadcast-channel';
+import {
+  StrictBroadcastChannel,
+  TabIdChannelMessage,
+} from './strictBroadcastChannel';
 
-interface TabIdChannelMessage {
-  type: 'REQUESTING_TAB_ID' | 'TAB_ID_DENIED';
-  tabId: string;
-}
-
-// TODO: We are using broadcast-channel to support Safari.
-// The native BroadcastChannel API will be supported in Safari version 15.4.
-// After that, we should remove this dependency and use the native API.
-const channel = new BroadcastChannel<TabIdChannelMessage>('tab_id_channel');
+const channel: StrictBroadcastChannel<TabIdChannelMessage> =
+  new BroadcastChannel('tab_id_channel');

Review Comment:
   nit: How about making the `tab_id_channel` value constant?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to