-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Getting rid of Jupyter global #170
Comments
There needs to be some way for users to open a JS console and poke around the JS interfaces. How would we do that without a global of some kind? |
Is there a way that we can grab a handle to the things that require has I am all for getting rid of the global, but agree with @takluyver about On Thu, Jun 25, 2015 at 11:30 AM, Thomas Kluyver [email protected]
Brian E. Granger |
Well, modules are still available by We need a way for it to work even without globals, and we can have global injection to be done only if user click a checkbox or set an option. Though it forces extensions and code to be clean of global only, and get convenience of global only in explicit case. e |
I should clarify - I am fine completely getting rid of the global - I think On Thu, Jun 25, 2015 at 1:51 PM, Matthias Bussonnier <
Brian E. Granger |
The important bit is the instances, which you can't get with require. I don't think poking around should only be possible if you set some special option. And we're still a long way from having multiple notebooks on a page, so we've got time to work out a good solution to the problem that doesn't make the notebook less capable. |
Yes, it is definitely the instances. phosphor may help with this - Chris On Thu, Jun 25, 2015 at 1:59 PM, Thomas Kluyver [email protected]
Brian E. Granger |
The point is not to cripple the notebook, it is to make hard to access the global in places where you should not, like
|
Yup, I think it's just the instances, adn I think it's really just |
|
But then you need to make the function global, and it needs to be a closure over a reference to The only way I can think of to avoid making it a global is to attach it to an element on the page, so you have to do e.g. |
The problem is that the global
|
Can this issue be closed? Any additional steps to take? |
I think so, but @Carreau should confirm. |
It's not really addressed it's probably better in JupyterLab, but depending on how long the classic notebook lives I would still like to have a better story for that. |
cc'ing @blink1073 and @gnestor so the work can get added to the appropriate queue |
While I remain fine with removing the global, I think it will cause more pain for users and ourselves (debugging) than it is worth. If we do keep this, it should be very low on the backlog of the classic notebook. |
But extension that want to be compatible JupyterLab and classic notebook cannot make the assumption that notebook is a global. Passing notebook as a parameter to the extension seem the right thing to do and push for good habits to make the transition easier. |
Not sure what next steps should be, but taking @ellisonbg's advice and marking as backlog and low priority... |
@gnestor can comment more, but I think that extensions that need to support
both lab/classic will take the approach Grant has been pursuing in thing
like jupyter_vega, where it has 1) common JS and 2) wraps that into an
nbextension and 3) wraps that into a labextension. In other words, we will
still likely have small amounts of impedance mismatching between the APIs.
…On Tue, Apr 25, 2017 at 11:03 AM, Grant Nestor ***@***.***> wrote:
Not sure what next steps should be, but taking @ellisonbg
<https://github.com/ellisonbg>'s advice and marking as backlog and low
priority...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#170 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0I0mECJ8_DqJGE8DU8UfwKebmJKQks5rzjWKgaJpZM4FLi4W>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
@ellisonbg I'm happy to comment but I'm not 100% clear on the problem here... |
Main usage of global is for extensions to access things right ?
Idea : pass the relevant local object in
ipython_load_extension()
which extension should define.Thoughts ?
The text was updated successfully, but these errors were encountered: