Skip to content

Let define_module(dependencies=...) work on the Solara server - #1244

Merged
maartenbreddels merged 1 commit into
masterfrom
fix/esm-module-dependencies
Oct 5, 2026
Merged

maartenbreddels merged 1 commit into
masterfrom
fix/esm-module-dependencies

Conversation

@maartenbreddels

@maartenbreddels maartenbreddels commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Lets apps pass dependencies= to define_module on the Solara server, as ipyvue and ipyreact now allow.

Problem

ipyvue (#106, #108) and ipyreact are getting a dependencies= argument on define_module, so an app can say which modules a module waits for.
Solara replaces both libraries' define_module on its server with kernel-aware versions, and those versions have no dependencies= argument.
So app code that passes it works in Jupyter but raises TypeError when the same app runs on Solara.

Change

  • solara/server/esm.py (ipyreact) and solara/server/esm_vue.py (ipyvue): define_module takes dependencies: Optional[List[str]] = None.
  • Without it, nothing changes: a new name waits for every earlier name, and a redefinition keeps its first list.
  • With it, the explicit list replaces the stored list, on the first definition and on a redefinition.
  • esm_vue.create_modules now also updates dependencies on a live url-backed widget. Before, only code and path modules got the update, so an explicit list on a url module never reached the browser.

Validation

  • tests/unit/esm_test.py and tests/unit/esm_vue_test.py gained test_define_module_dependencies: explicit list, default, redefinition without a list, redefinition with a list, and (Vue) a redefined url module. 20 tests passed locally.
  • The ipyvue tests ran against an ipyvue checkout with define_module, because the released ipyvue 3.0.0 does not have it yet.

Gaps

  • Released ipyvue has no define_module yet, so esm_vue_test.py skips in CI until ipyvue #106 is released.

Align results

Caution

/align was not run on this change: the interface (ipyreact parity, explicit dependencies= overrides the default) was settled with the maintainer in the ipyvue review session.

Crossreview results

  • Rounds: 1. Reviewers: astra and sol, on d3f4909. Both APPROVE with no findings.
  • No CRITICAL or HIGH finding.
  • Neither reviewer could run the tests in its read-only sandbox; the worker ran them locally (20 passed).
  • Small fixes: none.

🤖 Generated with Claude Code

…he solara server

ipyvue and ipyreact are adding a dependencies= argument to define_module, and solara replaces both functions on its server, so calls that pass it raised TypeError. An explicit list now overrides the stored one, also on redefinition, and the vue variant now also updates the dependencies of a live url module.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maartenbreddels
maartenbreddels temporarily deployed to fix/esm-module-dependencies - solara-stable PR #1244 October 5, 2026 13:50 — with Render Destroyed
@maartenbreddels
maartenbreddels marked this pull request as ready for review October 5, 2026 15:19
@maartenbreddels
maartenbreddels merged commit 379555d into master Oct 5, 2026
35 checks passed
@maartenbreddels
maartenbreddels deleted the fix/esm-module-dependencies branch October 5, 2026 15:19

This branch was successfully deployed

No deployments
fix/esm-module-dependencies - solara-stable PR #1244 — d3f4909e Deployed Oct 5, 2026 by maartenbreddels
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.

1 participant