Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Created Nov 30, 2021
Embed
What would you like to do?
Remote Rendering: Shopify’s Take on Extensible UI - Basic example setting up a `RemoteReceiver` to work together with a `RemoteRoot`
// Extension
import { createEndpoint } from "@remote-ui/rpc";
import { createRemoteRoot } from "@remote-ui/core";
function render(remoteChannel) {
const root = createRemoteRoot(remoteChannel);
root.appendChild(root.createText("Hello World!"));
root.appendChild(root.createComponent("LineBreak"));
root.mount();
}
createEndpoint(self).expose({ render });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment