-
-
Save ShopifyEng/620e2645983d75382dd3a7e31b94e509 to your computer and use it in GitHub Desktop.
Remote Rendering: Shopify’s Take on Extensible UI - The host loads an extension and then renders it
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("./sandbox.js")); | |
const receiver = createRemoteReceiver(); | |
endpoint.call.load("https://somewhere.com/extension.js").then(() => | |
endpoint.call.render(receiver.receive, { | |
setTitle: (title) => document.title = title | |
}); | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment