-
Notifications
You must be signed in to change notification settings - Fork 48
Move to ipywidgets 5.0.0 / jupyter-js-widgets 1.0 #194
Comments
And ... final is out so, time to move. |
Bumping Dockerfile.kernel to install ipywidgets 5.0.0 final and package.json to install 1.0.0 final most things work, but a few oddities:
|
Fixed 2 and 3 by addressing the parameter alignment change in the PR and issue noted in the description. The labels on the sliders are still missing, however. |
And the sliders are not taking the proper default values according to those specified in |
@jdfreder Off-hand, is there anything that changed recently (last 2-3 weeks) that requires us to do something in the widget manager or otherwise to get labels / defaults working from interactive? I vaguely remember some discussion about the defaults. It's a bit odd (but good!) that these appear to be the only things broken. |
@jhpedemonte Feel free to start from the WIP PR as part of #193 and #108 . If you figure out the sliders, we can update my PR or you can just send in your own. I won't be getting back to it for a bit. |
Missing labels is due to this change in |
My working hypothesis is that the In the old code, when |
I'm stumped. @jdfreder any idea why the require.js change to utils.js would cause ipywidgets to not properly show labels for us? Our widget manager is very similar to the EmbedManager (I've added some missing bits locally, but that made no difference). Our use of the notebook's OutputArea is based on the (now deprecated) jupyter-js-output-area example, but I don't see anything that needs to majorly change. Any tips would be greatly appreciated. |
@SylvainCorlay Any insight on comment above? |
Things we tried on Friday:
|
@jhpedemonte both dove into this today. We tore everything down to be like the web3 demo in ipywidgets. We got the missing labels to appear by using webpack to build one big monolithic JS file like widgetsextension does for notebook 4.2 and like the web3 demo does. Present theory is that support for async requirejs loads are busted, even though the code is written to handle them. @jdfreder @SylvainCorlay requirejs support hasn't been completely dropped from ipywidgets, has it? |
Hey a @parente and @jhpedemonte, Sorry for the late response, I'm no longer working on Jupyter full time and my plate is full with other work. Require.js should still work, but it needs to be loaded into the environment globally for ipywidgets to detect it. Have you verified it's not a conflict with the Label widget in Julyter-js-widgets? We renamed latex to label. @jpedemonte you are right, the behavior is asynchronous once the jupyter-js-widgets package is defined in requirejs. @parente support for requirejs isn't dropped-far from that actually. The beefed up logic was necessary for static widgets with third party dependencies and the ability to override builtin widgets in other environments, like nteract. (Sent from phone, sorry if there are typos) |
@jdfreder No problem on the late response. The only solution we've found so far is webpack everything into a single JS file, just like what web3 demo and widgetextension do. Otherwise, it appears that the requirejs calls resolve too late for models to instantiate and receive receive update events from the backend. We're going to switch to building a single JS file like those projects do to see if we can proceed down that path for now. |
@parente @jhpedemonte sorry for the late response. I know exactly what you need to do to: After you have checked that requirejs is on the page, you can do define('jupyter-js-widgets', function() {
return require('jupyter-js-widgets');
}); |
@SylvainCorlay Doesn't work for me. I added that bit of code to the top of dashboard.js. I tried within the existing Keep in mind that we are building |
Sorry, reading the issue again... Do you only have issues with the |
@SylvainCorlay Without doing anything special, default values are also ignored since it looks like the model is loading / instantiating too late to handle the update messages about them (see screenshot up above of the lorenz demo). Putting a breakpoint in loadClass in utils.js to step through what's happening, we're able to affect the timing so that sometimes entire widgets don't even appear on the page. |
In the end, was able to fix this by using webpack to create a single monolithic file with all of the code (see PR #200). |
I am still confused about what is going on here - and why you cannot require jupyter-js-widgets dynamically and need to webpack it. Since there seems to be multiple unrelated issues in this github issue, that would be great if you guys could open an issue upstream in ipywidgets. During the BayesHack hackathon last week-end, I had some weird race conditions when trying to make an embed manager with a kernel backend (and custom widgets) which I could not figure out during the hackathon, and it might be related to what you are seeing here. |
PS @jdfreder @jhpedemonte @parente @lbustelo, I am ok with making a 5.0.1 or 5.1.0 release with the fix in jupyter-widgets/ipywidgets#530. Is there anything else that you think we should fix before doing this. |
We wanted to get something working in order to cut a release compatible with ipywidgets 5, so we went the webpack route. In the end, I think it had the added benefit of cleaning up some of our frontend code. But, yea, we should revisit the requirejs problem with a small example that reproduces the race conditions. Maybe starting with web3 and forking it so that it uses requirejs / AMD?
Weird race conditions sounds similar. We'll have to see.
I think it's fine to cut a release with that fix alone for declarative widgets. No reason to hold it up for a possible async bug that we don't have a solid test case for or know how to fix yet. |
OK, I am jumping on a plane, which gives some time to others to react and will push a release when I am in NYC! |
So far jupyter-widgets/ipywidgets#530 was the only issue that I could not handle on my end alone. So I'm +1 for a release. |
Maybe move to 5.0.0b4 now so that the jump to final is easy. Or wait for the final releases of both.
At least one recent change that we might need to deal with:
The text was updated successfully, but these errors were encountered: