-
Notifications
You must be signed in to change notification settings - Fork 106
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
Stop vendoring noVNC #77
Conversation
We have been vendoring noVNC to get vnc_lite.html, maintaining a patch file so we could upgrade the version of noVNC used if needed. noVNC publishes a JS library [on npm](https://www.npmjs.com/package/@novnc/novnc) that we can easily use instead, and stop vendoring the whole package! This brings us the following massive advantages: 1. No more vendoring an entire package in! 2. Upgrades of noVNC client become practically trivial 3. We can change the frontend as we wish much more easily, compared to having to maintain a patch file as we do now. PRs like #7 become easier. This PR: - Adds a `package.json` to include the noVNC js package - Adds a `webpack.config.js` to provide JS bundling, so we can just ship a single `viewer.js` file that has everything. - Adds appropriate bits (stolen and adapted from jupyterhub's config) to package the built JS in the final wheel as necessary. - Upgrade from noVNC 1.2 to 1.4, but otherwise keep everything the same. I just copied our patched `vnc_lite.html` into `index.html`, and just split out the JS / CSS. - prettier with pre-commit has done its thing on the JS, CSS and HTML. This is fine, as I am hoping we can make more changes to the UI after this. - Modify the `Dockerfile` to setup the conda env first, and then separately install the python package with pip. This makes local development *much* faster. - Add a `.gitignore` (which this repo was missing), with node_modules included as well as the dist/ directory with the built JS.
👈 Launch a binder notebook on this branch for commit a59abc4 I will automatically update this comment whenever this PR is modified 👈 Launch a binder notebook on this branch for commit 823b155 👈 Launch a binder notebook on this branch for commit 68e25d0 👈 Launch a binder notebook on this branch for commit 3a6e81e 👈 Launch a binder notebook on this branch for commit 296f781 👈 Launch a binder notebook on this branch for commit 704151c 👈 Launch a binder notebook on this branch for commit 7ac5182 👈 Launch a binder notebook on this branch for commit 0ba0689 👈 Launch a binder notebook on this branch for commit cfb1a14 |
Once this gets merged, I'll cleanup the JS file a little and implement a version of #7 |
https://github.com/novnc/noVNC/blob/master/docs/API.md there's also a bunch of stuff we can do to make the experience better, like automatic reconnects, sending resize events through, save screenshots, etc. |
The desktop fails to load on mybinder: |
@manics ah interesting, it works for me locally in a container. wonder why. I'll dig through and see. |
I can reproduce the failure on mybinder! Shall test. |
Interesting, but it works on a JupyterHub! |
Alright, this is something about how the image is being built. |
@manics it works now! |
I'm going to add a quick test to make sure that the wheel and sdist have the built files too |
Cleaning up some JS on top in #78 |
This allows for much faster iteration, by simply mounting $(pwd) into /opt/install
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.
Other than the editable install this looks good!
Since this is an application I think we should add a package.lock (and bump it with dependabot) so we can keep track of all the dependencies but that can be done in a follow-up.
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.
🎉🎆🥳
yay thank you @manics! Take a look at the other PRs too when you get a minute :D When done, I'll make a release. |
We have been vendoring noVNC to get vnc_lite.html, maintaining a patch file so we could upgrade the version of noVNC used if needed.
noVNC publishes a JS library onnpm
that we can easily use instead, and stop vendoring the whole package! This brings us the following massive advantages:
This PR:
package.json
to include the noVNC js packagewebpack.config.js
to provide JS bundling, so we can just ship a singleviewer.js
file that has everything.vnc_lite.html
intoindex.html
, and just split out the JS / CSS. I also changed the title of the pageDockerfile
to setup the conda env first, and then separately install the python package with pip. This makes local development much faster..gitignore
(which this repo was missing), with node_modules included as well as the dist/ directory with the built JS.