-
-
Save ShopifyEng/6424c586d24007d56c9323178399bf6e to your computer and use it in GitHub Desktop.
Remote Rendering: Shopify’s Take on Extensible UI - Basic example setting up a `RemoteReceiver` to work together with a `RemoteRoot`
This file contains 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
// Host | |
import { createEndpoint } from "@remote-ui/rpc"; | |
import { createRemoteReceiver } from "@remote-ui/core"; | |
const endpoint = createEndpoint(new Worker("./extension.js")); | |
const receiver = createRemoteReceiver(); | |
receiver.on("mount", () => { | |
const remoteRoot = receiver.attached.root; | |
// Render the remote tree using native UI components ... | |
}); | |
endpoint.call.render(receiver.receive); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment