aws / graph-notebook

Library extending Jupyter notebooks to integrate with Apache TinkerPop, openCypher, and RDF SPARQL.
https://github.com/aws/graph-notebook
Apache License 2.0
727 stars 166 forks source link

Publish graph_notebook_widgets JS assets to npm #537

Open tkrabel-db opened 11 months ago

tkrabel-db commented 11 months ago

Community Note

Is your feature request related to a problem? Please describe. Disclaimer: I work for Databricks.

Databricks supports ipywidgets like Jupyter Notebook and Lab does, but for security reasons, our notebooks run widgets in sandboxed iframes that fetch widgets JS assets from public CDNs like npm. Some of our customers would like to use your library inside Databricks notebooks, but can't because you are not npm publishing your JS assets.

As a side benefit: if you publish your assets, graph notebook widgets also work on voila! :)

Describe the solution you'd like The solution is pretty straightforward. You already create the JS distribution bundle here /dist. All you'd need to do is publish that by running npm publish. You could add that rule here.

jasongrout commented 11 months ago

Ping @ellisonbg and @jasonweill, who may be able to provide some context from within AWS.

Essentially, publishing the widget js assets to npm allows them to be used in systems that pull js from CDN. Voila does (did?) this, etc. I'm happy to help figure out what changes would need to happen to publish your built packages on npm.

Disclaimer: I work with @tkrabel-db at Databricks, particularly on ipywidget support. We'd love to support this widget, but we do pull the js for widgets from CDN.

michaelnchin commented 10 months ago

Hi @tkrabel-db and @jasongrout, thank you for the enhancement request!

At one point, we investigated NPM publishing the graph_notebook_widgets extension as part of our efforts to implement JupyterLab support. However, with the arrival of prebuilt extension support in JupyterLab 3, it was no longer critical to make the widgets JS package available to install as a source extension, and we ended up putting this task on the backburner.

The use case described in regards to compatibility with your customers' Databricks Notebooks seems like a reasonable justification for resurrecting this task. We'll look into assessing the remaining internal effort required for publishing graph_notebook_widgets separately via NPM.

jasongrout-db commented 10 months ago

IIRC, both colab and vs code may also pull the widget js from cdn - I think it's a pretty common pattern for tools that put ipywidgets in an iframe for security.

tkrabel-db commented 10 months ago

@michaelnchin are there any updates on this issue?

michaelnchin commented 10 months ago

We are currently targeting EOY for completion of internal approvals and deployment.