Skip to content

using jupyterlab components #285

Answered by manzt
artttt asked this question in JavaScript
Sep 14, 2023 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

Hi there. Yes, you just need to add the ?bundle query param since @jupyterlab/application isn't properly packaged for npm as ESM. I recommend reading the https://esm.sh/ documentation to learn more about their API if you plan to use dependencies from that CDN. (Although I'm not sure how this module interacts with the juptyer front end).

import anywidget
class ExampleWidget(anywidget.AnyWidget):
    # anywidget, required #
    _esm = """
    import * as jlab from "https://esm.sh/@jupyterlab/[email protected]?bundle";
    export function render() {
      console.log(jlab);
    }
    """
ExampleWidget()

I'd like to keep the issues in this repo related to anywidget and not debugging JS module…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by manzt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@artttt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #272 on September 17, 2023 16:36.