-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MimeRenderer Extensions #2488
MimeRenderer Extensions #2488
Conversation
TODO: break out docregistry handler into a separate plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I have done a pretty detailed review and have looked at every file here, by package, starting with the interfaces, then rendermime/doc stuff and outwards. It looks fantastic, what a tour de force! The main thing is to make sure we figure out when a renderer expect JSON versus strings. It is important to make sure we are not encoding/decoding strings to JSON and back more than needed as some of the mime bundles can be large. I can have another look first thing in the morning.
|
||
|
||
/** | ||
* A namespace for IRenderMime associated namespaces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRenderMime associated interfaces.
@@ -0,0 +1,418 @@ | |||
// Copyright (c) Jupyter Development Team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed this file. Really nice to have them all together, and I feel good about having this be the one thing that external renderers have to import. By now the interfaces are clean and reasonably stable. Very nice!
* Add the link handler to the node. | ||
*/ | ||
handleLink(node: HTMLElement, url: string): void; | ||
function registerExtensionModule(mod: IRenderMime.IExtensionModule): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, really clean.
packages/docregistry/src/default.ts
Outdated
let model = context.model; | ||
let layout = this.layout as PanelLayout; | ||
let data: JSONObject = {}; | ||
data[this._mimeType] = model.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be the culprit in the Vega extension not working. I think it expects JSON data, rather than a string. We ran into this before, but I don't remember how we resolved it. We probably need to a figure out a way have a clear way of handling MIME types that have JSON or strings for data.
The file data from the server is always text unless it is a notebook. I added a |
Looks great now, merging! |
Continuation of #2482. Fixes #2354.
widget factories if applicable
MimeRenderer
implementationrendermime-interfaces
package