-
Notifications
You must be signed in to change notification settings - Fork 62
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
Expose classic notebook's static assets from their original endpoints #63
Conversation
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/jupyterlab-notebook-nbextensions/11017/6 |
Tests are failing because of a bug in jupyter_server, jupyter-server/jupyter_server#587. Once that is merged and released, I'll restart the tests here. |
ab775b9
to
be28240
Compare
…c notebook's templates and static assets without patching the extensions
be28240
to
2c7cbd0
Compare
@vidartf here's the PR I mentioned in the Jupyter Server meeting today. I'd love to get your review if you have a chance. Specifically, here is the chunk where I have to inject handlers in a specific order in the main web application. |
Fixes #46. |
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/jupyter-nbextensions-configurator-not-shown/7294/9 |
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, thank you!
Thanks, @blink1073! |
|
||
#----------------------------------------------------------------------------- | ||
# Get the wildcard router | ||
router = self.serverapp.web_app.wildcard_router |
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.
Could this logic have an effect on other server extensions? Also depending on the order the extensions are registered?
For reference this seems to have affected the JupyterLab browser check: jupyterlab/jupyterlab#11350
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.
Investigating this now.
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 believe #77 fixes this issue.
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.
It looks like there were conflicts happening between jupyter-server and notebook HTML templates, since they share the same names. This PR namespaces the Jinja template environment and monkeypatches the IPythonHandler to pull these templates from the correct environment.
It happend again. |
Classic notebook extensions (i.e. nbextensions) often reference classic notebook's static assets and templates through its static endpoint. These don't exist in jupyter_server+nbclassic. Nbclassic does exposes these items through its own endpoints and jinja template environment, but classic notebook extensions are not (and should not be) aware of nbclassic's endpoint.
Instead, this PR leverages the nbserver extension to monkey-patch JS and nbclassic and re-expose the classic notebook's assets+templates in a way that mimics the classic notebook.
This will likely fix many classic notebook extension in nbclassic.