Skip to content

Conversation

ryanbonial
Copy link
Member

Description

Implemented cross-iframe query forwarding between Dashboard and SDK apps using SharedWorker. This allows SDK apps running in iframes to execute queries through the parent Dashboard application, enabling centralized query execution and caching.

The implementation uses a combination of:

  • Comlink for iframe communication
  • SharedWorker for query execution and caching
  • Message passing protocol for query requests and responses

What to review

  • The communication flow between Dashboard and SDK app iframes
  • SharedWorker query execution and caching implementation
  • Query forwarding detection in the SDK app
  • Error handling and connection management
  • Performance implications of the query caching mechanism

Testing

Tested by:

  • Running the Dashboard and SDK app locally
  • Verifying query forwarding works when SDK app is loaded in an iframe
  • Checking that query results are properly cached in the SharedWorker
  • Confirming that the same queries reuse cached results

Fun gif

share

Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sdk-docs Error Error Sep 12, 2025 3:24pm
sdk-kitchensink-react Error Error Sep 12, 2025 3:24pm

@cngonzalez cngonzalez force-pushed the 08-19-feat_core_add_connection_to_query_store branch 2 times, most recently from 3641980 to 20914f3 Compare September 10, 2025 20:10
@ryanbonial ryanbonial changed the base branch from 08-19-feat_core_add_connection_to_query_store to main September 10, 2025 20:29
@ryanbonial ryanbonial changed the base branch from main to 08-19-feat_core_add_connection_to_query_store September 10, 2025 20:29
cngonzalez and others added 7 commits September 10, 2025 15:16
Add query execution to SharedWorker with @sanity/client integration
Update Dashboard to return actual query results instead of placeholder data
Modify query forwarding to store results in local query state
- Add caching mechanism with stable query keys
- Implement proper response handling for both subscription and observable patterns
- Fix TypeScript errors and normalize query options with perspective

This connects the iframe query forwarding to actual SharedWorker-based
query execution and caching, completing the core SharedWorker functionality.
@ryanbonial ryanbonial force-pushed the rb_09_04_implement_real_shared_worker branch from 5018271 to c362b7d Compare September 10, 2025 21:26
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants