Skip to content

Make a prebuilt JupyterLab extension - #4118

Open
A5rocks wants to merge 1 commit into
plotly:devfrom
A5rocks:prebuilt-jupyterlab
Open

A5rocks wants to merge 1 commit into
plotly:devfrom
A5rocks:prebuilt-jupyterlab

Conversation

@A5rocks

@A5rocks A5rocks commented Nov 4, 2026

Copy link
Copy Markdown

This is the new way jupyter extensions should be distributed, as far as I can tell. For what it's worth, I have no idea how to do this, I just tried things until I could run uv pip install <directory to dash>, it would show up as prebuilt under jupyter-labextension list, and it worked in the lab (AFAICT).

Contributor Checklist

  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@T4rk1n T4rk1n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to a prebuilt extension is the right fix: it removes the "build recommended" prompt from #3828 and #2580. Can you add Fixes #3828 to the description?

The MANIFEST change blocks merge. The sdist leaves out the built bundle, so anyone who installs from the sdist (conda-forge builds from it) gets an extension that can't load.

I'd also like to see it confirmed on JupyterLab 4, since the bundle is built with builder 3 (details inline).

This drops JupyterLab 2: Lab 2 can't load prebuilt extensions, and the old .tgz source install is gone. That's fine with me, but please add a CHANGELOG entry and update the "Compatible with JupyterLab 2.x, 3.x, and 4.x" line in .ai/ARCHITECTURE.md.

Comment thread MANIFEST.in
include dash/dash-renderer/build/*.map
include dash/labextension/dist/dash-jupyterlab.tgz
include dash/labextension/package.json
include dash/labextension/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include dash/labextension/* doesn't recurse, so static/ (remoteEntry and the chunks) isn't in the sdist. I checked with a mock tree: the sdist only gets package.json and install.json. A wheel built from that sdist installs a package.json that points at a remoteEntry that doesn't exist. Can you use graft dash/labextension instead?

"@jupyterlab/notebook": "^2.0.0 || ^3.0.0 || ^4.0.0"
},
"devDependencies": {
"@jupyterlab/builder": "^3.6.8",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI pins jupyterlab<4, so this bundle is built against Lab 3 core. Lab 4 is what most people run (#3828 is on 4.5.6), and src/index.ts imports @lumino/widgets, @lumino/messaging, @jupyterlab/services and @jupyterlab/coreutils without declaring them, so their shared versions come from Lab 3 core (@lumino/widgets ^1 vs 2.x in Lab 4). Which Lab versions did you test? Can you check that it loads on Lab 4 with no shared-module errors in the console, and declare those imports as dependencies with ranges that cover both majors?

"extension": true,
"outputDir": "../../dash/labextension"
},
"resolutions": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the webpack pin fix? If it works around a builder 3 problem, please say so in the PR description so the next person knows when it can go.

Comment thread setup.py
("share/jupyter/lab/extensions", [
"dash/labextension/dist/dash-jupyterlab.tgz"
]),
*[

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine once MANIFEST is fixed. As written, a wheel built from the sdist would register a half-installed extension. Also, the blank line removed above setup( will trip flake8 E305. Can you put it back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants