Problem

At @cosmicdreams talk on SamePage preview (great talk!), there was a question about running the preview in a new browser tab. It sounded like this might not be possible right now with the hot reloading. I think the BroadcastChannel API can potentially be used to achieve viewing the preview in a new tab with hot reloading while editing.

Comments

coby.sher created an issue. See original summary.

coby.sher’s picture

Issue summary: View changes
cosmicdreams’s picture

As far as i understand we could:

  • Create (THE SAME) broadcast channel on both the edit and the preview tabs
  • Add to our "preview" logic (the logic invoked when we want to refresh the preview) a single sent through the broadcast channel to refresh to the preview tab

Some of the examples I've researched show that it is important to ensure your messages have a unique key / id or some kind of attempt is made to ensure that you're sure you sent the single to the correct tab.

I would prefer an api were I could target the tab I'm sending a message to.

Still, it would be fun to put a proof of concept together for this.

brianperry’s picture

Status: Active » Postponed

This would be fun to solve, but postponing for now to focus on tightening up existing features.

cosmicdreams’s picture

Status: Postponed » Closed (won't fix)

Closing as won’t fix for the current module direction. Cross-tab hot reload would add a separate BroadcastChannel/state lifecycle for a non-core workflow. A fresh scoped issue can be opened if this becomes part of a future roadmap.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.