Add new MIME type: application/vnd.jupyter.renderer+json;package={package_name}
where {package_name}
is the name (and possible version) of an NPM package, like standalone-dx
or standalone-dx@^1.0.0
.
You should be able to import a renderMime
function from that package with this signature:
type RenderMIME = (options: {
node: HTMLElement,
// Call a remote function on the server that has been
// registered
// NOTE: We could replace this with a full open comm
// interface instead of a more restricted RPC interface
invokeFunction: (options: {
name: string,
args: JSON
}) => Promise<JSON>,
data: JSON
}) => {
// Called when the output is updated with new data
onData: (data: JSON) => void,
// Called when the output is deleted
onCleanup: () => void
// NOTE: We could also extend this with notifications
// for add/remove dom nodes if we wanna support multiple
// output views, like in JL
};
Frontends are free to fetch and call this package however they like, either by using a version already built with them or by calling out to something like unpkg.