-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Add back built-in requirejs for ipynb notebooks #132557
Comments
@mjbvz Do we have an update on this issue? Noticed you referenced this issue in another PR, hence the question. |
@DonJayamanne What if we added a special type of Need to come up with a proposal of what the contribution point would look like. Perhaps we can build on the extensible markdown renderers proposal, so you could write something like: "contributes": {
"notebookRenderer": [
{
"id": "addGlobals",
"entrypoint": {
"extends": "*", // Always activate before any other output renderer
"path": "./notebook-out/index.js",
}
}
], |
Actually it need to be the reverse: a renderer wants to declare that other renderers have an implicit dependency on it. Probably should be more like: "contributes": {
"notebookRenderer": [
{
"type": "preload",
"id": "addGlobals",
"path":"./notebook-out/index.js",
}
]
} |
@mjbvz Sorry i missed this. With this proposal, doesn't this mean this script will get loaded regardless of the mime type?
|
This comment has been minimized.
This comment has been minimized.
Thinking about this a bit more: are there other use cases for this API? It sounds the problem with If that's the case, let's just bring back the logic that injects |
I like that approach, it's hackish, but better than adding a whole new api for now. |
@DonJayamanne Please give the next insiders build a test and let me know if it isn't working. It simply reverts the earlier removal of requirejs |
Sure thing, thanks for getting this in. |
Looks like we're still going to need additional work in Jupyter extension. |
Today one could preloads scripts for an ipynb file if the controller is selected (or pre-selected when opening a notebook that was previously opened in VS Code).
However if someone opens a new ipynb notebook that was shared (i.e. opening an existing ipynb file or the first time in vscode), then VS Code will not associate any controller, as a result the pre-load scripts for kernel will not load.
The downside of this is, outputs can contains HTML that expect
require.js
to be available and if tha'ts not available, the output will not load. This applies to plots from popular packages such as plotly.This will be a blocker to viewing notebooks on github.dev or even locally.
I can't think of a great usecase for such a feature request for other notebooks, this is very specific to the requirements of outputs in ipynb.
Alternatives
aplication/javascript
as well, see hereelement
variable not defined when rendering IPyWidgets vscode-jupyter#6054 (that's a seprate conversation, but thought I'd mention the fact that we have the need to create out own renderers for some of these simple mime types)The downside with this is, anyone viewing HTML output in any other notebook would end up being rendered by Jupyter renderer (not the best, we've had plenty of issues where such renderers cause issues, bugs or incorrect rendering of outputs of other notebooks (one of them tracked here #125876).
@mjbvz @rebornix /cc
The text was updated successfully, but these errors were encountered: