Giter Club home page Giter Club logo

Comments (6)

parente avatar parente commented on July 4, 2024

Would this remove the need to preload polymer and the urth channel stuff on every notebook page, even when widgets aren't used? Would that happen after widgets.init()?

from declarativewidgets.

lbustelo avatar lbustelo commented on July 4, 2024

@parente that is the point. Nothing gets preloaded until the cell with unit is ran. Maybe only the minimum js would be on all pages.

from declarativewidgets.

parente avatar parente commented on July 4, 2024

Maybe only the minimum js would be on all pages.

I was after even removing this. For instance, the %matplotlib notebook magic injects all the JS it needs only after this call. Nothing needs to be in Jupyter before then and so it doesn't need to be an extension to Jupyter. It would be very cool if the widgets could reach that point (but I know that would involve some kind of replacement for the urth_import server handler which probably is not replaceable.)

from declarativewidgets.

lbustelo avatar lbustelo commented on July 4, 2024

We would still need the extension to have the js available for download. But I agree that nothing needs to be preloaded on the browser, if possible.

from declarativewidgets.

lbustelo avatar lbustelo commented on July 4, 2024

Was doing some experimentation on this. I thought that I could block the kernel from returning from the cell run and orchestrate init though the COM channel. This is not possible because COM channel browser -> kernel is done through the shell channel also.

I also did not see a way to pausing running of cells from the browser side.

I'm going to leave this one open, but will move to work on something else.

from declarativewidgets.

lbustelo avatar lbustelo commented on July 4, 2024

Thought on how the kernel init code can interact with the browser to cause the init.

Using Comm.

  1. Our extension will register a comm target with a name like jupyter_declarativewidgets_init and provide a handler (https://github.com/jupyter/notebook/blob/master/notebook/static/services/kernels/comm.js#L46)
  2. The code on the kernel side (widgets.init()) will send a COMM_OPEN message to that target. That should trigger the browser code on https://github.com/jupyter/notebook/blob/master/notebook/static/services/kernels/comm.js#L78 that would then call our handler.
  3. There might be an optional handshake to let the kernel side know that all is ready and that could take place through the same COMM channel.

CommManager will then become another dependency that would have to be injected into our env.

from declarativewidgets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.