[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#838683: [Debian-science-sagemath] widgetsnbextension situation



Ximin Luo:
> Ximin Luo:
>> To install it yourself "the upstream way" completely from source (i.e. what we need to put in d/rules), see
>>
>> https://github.com/ipython/ipywidgets/blob/5.2.2/docs/source/dev_install.md
>>
> 
> I can confirm that the upstream instructions do work to regenerate widgetsnbextension/static/extension.js from https://pypi.python.org/pypi/widgetsnbextension/1.2.6
> 
> However we're going to have a hard time recreating it in Debian. I went through this file and saw the "real dependencies". scriptjs seems to not be needed, but the others are.
> 
> There are 56 modules (0-55) that webpack concatenates together, they are:
> 
> [..]

I just realised you can do this:

~/widgetsnbextension-1.2.6/widgetsnbextension/static$ python -m json.tool extension.js.map | less -S
{
    "file": "extension.js",
    "mappings": ";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,u[..]
    "names": [],
    "sourceRoot": "",
    "sources": [
        "webpack:///webpack/bootstrap f5345dd1af7cf96a8788",
        "webpack:///./src/extension.js",
        "webpack:///./src/manager.js",
        "webpack:///./~/underscore/underscore.js",
        "webpack:///./~/backbone/backbone.js",
        "webpack:///./~/jquery/dist/jquery.js",
        "webpack:///./~/jupyter-js-widgets/src/index.js",
        "webpack:///./~/jupyter-js-widgets/src/jquery.js",
        "webpack:///./~/jquery-ui/jquery-ui.js",
        "webpack:///./~/bootstrap/dist/js/npm.js",
        "webpack:///./~/bootstrap/js/transition.js",
        "webpack:///./~/bootstrap/js/alert.js",
        "webpack:///./~/bootstrap/js/button.js",
        "webpack:///./~/bootstrap/js/carousel.js",
        [..]
        "webpack:///./~/jupyter-js-widgets/css/widgets.min.css",
        "webpack:///./~/css-loader/lib/css-base.js",
        "webpack:///./~/style-loader/addStyles.js"
    ],
    "sourcesContent": [
        " \t// The module cache\n \tvar installedModules = {};\n\n \t// [..]
        "// Copyright (c) Jupyter Development Team.\n// Distributed unde[..]
        "// Copyright (c) Jupyter Development Team.\n// Distributed unde[..]
        [..]
        "exports = module.exports = require(\"./../../css-loader/lib/css[..]
        "/*\r\n\tMIT License http://www.opensource.org/licenses/mit-lice[..]
        "/*\r\n\tMIT License http://www.opensource.org/licenses/mit-lice[..]
    ],
    "version": 3
}

Perhaps we can use this information to regenerate extension.js without using webpack itself. Julien, have you seen anything approximating this approach before?

I will probably need help getting this done by Dec 5 (to have a chance of this passing NEW). We might be able to get away with putting

webpack/bootstrap (the top part of extension.js)
process/browser.js
css-loader/lib/css-base.js
style-loader/addStyles.js

in debian/missing-sources/ since they are small, but we will have to package d3-format and html2canvas "properly". d3-format looks fairly easy but html2canvas is more annoying and will need browserify; only browserify-lite is in Debian.

Then after we have all the files listed above (in "sources"), it's just a matter of hacking up a sed script or something to reconstruct extension.js from them. That shouldn't be too hard.

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git


Reply to: