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
Fix WebGL plotting in Jupyter Lab #859
Conversation
What issues are caused? Can we check if the import has a default attribute? |
@jasongrout in this statement:
old versions of raw-loader return a string, new versions return an object with a |
I don't think so, the loader is only needed when building the bundles right, or did something change with raw-loader 2? I don't think the raw-loader should end up in the bundle, or am I getting the concepts of runtime/dev dependency wrong? |
I may have used the wrong term, but I mean that raw-loader definitely needs to be mentioned in the |
I've updated the approach here, but I'm seeing the following error today when trying to install the Jupyter Lab extension:
This seems to be unrelated to the changes I made as it happens even on master. Any idea what that could be due to? |
The code changes in this PR look good to me (caveat: I haven't tested). FYI, you could do |
Possibly due to the recent release of the jlab widget manager and associated packages. I'll check. |
What commands are you using to do this? And is it on bqplot master? What is your jlab version? |
I have Jupyter Lab 1.0.0a5 and I am running |
Weirdly it worked yesterday, so something happened in the last 24h... |
I published a new version of the jlab manager (0.41) yesterday that supports jlab 1a5. If you're using jlab 1a3, you'll need to use jlab manager 0.40. |
I just installed jupyterlab-manager 0.41 since I have Jupyter Lab 1.0.0a5 but it's still crashing during the build:
|
This works great for me:
Given the alpha was just released, and also a new version of the jlab widget manager to support the alpha, perhaps there are some old dependencies somewhere in your chain? I'd try cleaning things out and reinstalling. |
I ran into the same issue on another computer but indeed the failure is gone after setting up a new environment, so false alert. |
Just confirming that this PR works and fixes bqplot in Jupyter Lab |
it would be nice to have a bqplot update with this for Jupterlab-1.0.0 (release today ?) |
Any updates on this? Can I do anything to help move it along? |
… some of the shader code. If we don't specify this, we are dependent on the default versions of raw-loader in notebook and lab which might be different - in particular, recent versions of raw-loader don't return a string when used with require() but instead return an object with a 'default' property.
…w-loader and can deal with it returning an object or a string
I've rebased this and it looks like the CI is passing now. This is ready for a final review/merging. |
The breaking change is described here: webpack-contrib/raw-loader#69 Basically, the advice is to use (for raw-loader >=2):
If bqplot moves to raw-loader 2, we'll use version >= 2 during the normal bundle building and Jupyter lab's bundle building. I'll test that out now and see if that works. |
…he shaders the same This will allow bqplot to use WebGL within Jupyter lab This replaces bqplot#859
I think #881 is a cleaner solution, I'll also use that for ipyvolume. |
This PR can be closed, it has been fixed by #881 |
This declares
raw-loader
as a runtime dependency since it is needed to load some of the shader code (specifically for the scales).If we don't specify this, we are dependent on the default versions of raw-loader in notebook and lab which might be different - in particular, recent versions of raw-loader used by Jupyter Lab don't return a string when used with require() but instead return an object with a 'default' property, which causes issues in three.js.
Fixes #858