Closed consideRatio closed 4 years ago
@jasongrout, this extension have a dependency on jupyterlab-manager, is that a mistake? I found the following references in the code base.
@jasongrout, this extension have a dependency on jupyterlab-manager, is that a mistake? I found the following references in the code base.
The sidecar explicitly uses jupyterlab-specific things, so yes, it is appropriate to have a dependency. That widget only works in jlab.
Most widgets are not only for jlab, and probably should not depend on the jlab widget manager.
What else is needed to move this PR forward?
It looks like we just need someone to test it, merge it, and release it. Can you test it?
I might be able to find some time this weekend.
Are you also looking for new test cases in the PR, or just to, e.g. test ipyleaflet
on this branch?
Are you also looking for new test cases in the PR, or just to, e.g. test
ipyleaflet
on this branch?
I'm not looking for new test cases. I think testing ipyleaflet on this branch should be fine.
I also tried to fix it based on this PR. It compiles, it works in the browser (nice) and the karma test run - however they fail. Don't know why up to now
btw. this is where both tests fail:
Sidecar
SidecarModel
16 04 2020 20:47:01.047:WARN [reporter]: SourceMap position not found for trace: at SidecarModel.initialize (base/src/widget.js?61103a732e53ec236c6426e01399c25f38578cd9:5:1146)
16 04 2020 20:47:01.047:WARN [reporter]: SourceMap position not found for trace: at new SidecarModel (base/src/widget.js?61103a732e53ec236c6426e01399c25f38578cd9:5:465)
✖ should be createable
Chrome 80.0.3987 (Mac OS X 10.15.4)
TypeError: Cannot read property 'sessionContext' of undefined
at SidecarModel.initialize (/var/folders/6f/_pgkb3vj1637f9h4whkg1_200000gn/T/karma-typescript-bundle-917476LFXqTwYv1g2.js:134944:35)
at SidecarModel.initialize (src/widget.js:5:1146)
Looks like the DummyManager needs to be extended to have a mock Context (the access to widget_manager.context.sessionContext.kernelChanged.connect
fails)
This goes beyond my understanding of the jupyterlab internals, happily leaving the field to others who know more about it ...
Thanks for tracking that down. @vidartf - have you happened to address this in your opinionated ts cookiecutter?
On the other hand, I agree with @consideRatio:
I've not fixed the tests entirely, I still crash with ReferenceError: regeneratorRuntime is not defined after my browser starts. I assume it is because these tests never have been configured to run successfully before (#19). As the tests are unrelated to this PR, and I failed to fix them in 1 hour, I'll settle now and suggest this is ready for merge.
The tests failing was already an issue, and I think can be solved on another issue. You tested this PR and it was working in jlab 2. Thanks!
Thanks everyone. I just released sidecar version version 0.4.0 and it works in jlab 2.
@jasongrout @consideRatio For the records, I could solve the regenerator error by adding regenerator-runtime
and core-js
to dev dependencies and including node_modules/regenerator-runtime/runtime.js
into the karma config, see https://github.com/bernhard-42/jupyterlab-sidecar/commit/1550977900a7a0e06e061b8da9d13b5ed5c17bee
But then the tests fail with the above sessionContext
error
Maybe this helps in the future to get the tests running again
Would you mind submitting a PR with your changes? I had a difficult time getting the tests even to the point of running and getting any sort of error. Once I can get things to having that sessionContext error, it will be much easier to fix things.
@vidartf - have you happened to address this in your opinionated ts cookiecutter?
I don't think so, as most widgets don't interact directly with the session/kernel.
@jasongrout created https://github.com/jupyter-widgets/jupyterlab-sidecar/pull/47. Hope it is ok that it is not rebased to your merge yesterday ...
When installing this extension on JupyterLab 2 I noted the following warning.
This PR attempts to fix support for JupyterLab 2, but my knowledge of JupyterLab and TypeScript is lacking to complete this PR. I hope that someone else can complete it!
What I've done
"esModuleInterop": true,
in tsconfig.json to workaround an typescript compile error that probably can be resolved in a better manner.plugin.ts
.npm run test:chrome
test, but it crash later with another issue. But...What I have not done
I've not fixed the tests entirely, I still crash with
ReferenceError: regeneratorRuntime is not defined
after my browser starts. I assume it is because these tests never have been configured to run successfully before (#19). As the tests are unrelated to this PR, and I failed to fix them in 1 hour, I'll settle now and suggest this is ready for merge.