feat(frontend/hooks): replace 3rd-party BroadcastChannel with native Web API equivalence#29584
Merged
Merged
Conversation
…Web API equivalent Signed-off-by: hainenber <dotronghai96@gmail.com>
justinpark
reviewed
Jul 16, 2024
| // 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'); |
Member
There was a problem hiding this comment.
nit: How about making the tab_id_channel value constant?
Member
|
Thanks for tackling this! This looks like a great improvement, and long overdue! Is there already (or should there be) a test making sure that messages are sent/received correctly? |
Signed-off-by: hainenber <dotronghai96@gmail.com>
Contributor
Author
|
Unfortunately there's none but I can produce the expected result similar to what described in the original PR :D State key is kept between reloads for a dashboard/chart opened in Explore tab. Would be sufficient? Screen.Recording.2024-07-17.at.23.13.23.mov |
Signed-off-by: hainenber <dotronghai96@gmail.com>
rusackas
approved these changes
Jul 17, 2024
Member
rusackas
left a comment
There was a problem hiding this comment.
It might be nice to have added test coverage, but this is an improvement over the current state of affairs for the product, and moves away from package complexities toward native browser, support, so I call it a win :)
eschutho
pushed a commit
that referenced
this pull request
Jul 24, 2024
…Web API equivalence (#29584) Signed-off-by: hainenber <dotronghai96@gmail.com>
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
…Web API equivalence (apache#29584) Signed-off-by: hainenber <dotronghai96@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(frontend/hooks): replace 3rd-party BroadcastChannel usage with native Web API equivalence
SUMMARY
Implementation of 2 years old TODO :D
Safari 15.4 was released 2 years ago (source) and so we can utilize its native Web API to replace a 3rd-party implementation.
Credit to Eric Wong's SO post for the implementation. I'm just a copy-paster after all :D
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
All CI checks should pass
ADDITIONAL INFORMATION