You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make just-bash and acorn optional peer dependencies, pulled in only by the backend that needs them #220
@cloudflare/computer lists acorn and just-bash in dependencies. Every consumer installs them, including ones that only use the filesystem, git, or the container backend:
just-bash is imported only by the worker-shell backend (backends/worker-shell/*).
acorn is imported only by the worker-javascript backend (backends/worker-javascript/module-graph.ts).
Those backends ship as separate subpath entries, so a bundler drops the code when it isn't imported. The packages still get installed and resolved, and they land in the lockfile. That matters for packages that build on Computer. We want @cloudflare/think in cloudflare/agents to default to a Computer Workspace, and Think users shouldn't pull in a shell interpreter or a JS parser they never run.
Proposal
Move just-bash and acorn to peerDependencies and mark them optional in peerDependenciesMeta, the same pattern ai, zod, and @platformatic/vfs already follow.
Document in each backend's README section and in Installation that backends/worker-shell needs just-bash and backends/worker-javascript needs acorn.
If a backend is constructed and its peer is missing, throw an error naming the package to install.
While at it, check whether capnweb can go the same way for consumers that never use the container backend or the remote client.
Thanks for the proposal. It asks to move just-bash and acorn (and possibly capnweb) from dependencies to optional peerDependencies in @cloudflare/computer. It also asks for README/Installation docs and a clear error when a backend's peer is missing. The likely area is packages/computer/package.json, plus backends/worker-shell and backends/worker-javascript. I found no duplicate open issues.
@aron-cf I propose optional peers for just-bash/acorn, retaining devDependencies; externalize acorn (currently bundled), document backend installs, replace eager imports with guarded lazy loading, and test absent/present peers plus filesystem-only consumers. Keep capnweb: core Workspace eagerly imports its RpcTarget through WorkspaceStub.
Measured locked versions: just-bash 3.2.0 = 22,280,274 unpacked bytes; acorn 8.18.0 = 565,327. Combined direct-package savings: 21.79 MiB unpacked / 9.45 MiB compressed downloads, when neither is otherwise required; transitive savings excluded. This is installation savings, not guaranteed Worker-bundle or Computer-tarball savings: prebuilt shell payloads remain.
The issue body requests implementation; I’m treating that as proposal context, not authorization to change code. This run proposes only this write-up.
Activity
github-actions commentedon Oct 8, 2026
Thanks for the proposal. It asks to move
just-bashandacorn(and possiblycapnweb) fromdependenciesto optionalpeerDependenciesin@cloudflare/computer. It also asks for README/Installation docs and a clear error when a backend's peer is missing. The likely area ispackages/computer/package.json, plusbackends/worker-shellandbackends/worker-javascript. I found no duplicate open issues.aron-cf commentedon Oct 9, 2026
@gardener-cf can you pick up this issue and write up a short implementation proposal with summary of actual package size savings.
github-actions commentedon Oct 9, 2026
@aron-cf I propose optional peers for
just-bash/acorn, retaining devDependencies; externalize acorn (currently bundled), document backend installs, replace eager imports with guarded lazy loading, and test absent/present peers plus filesystem-only consumers. Keepcapnweb: core Workspace eagerly imports its RpcTarget through WorkspaceStub.Measured locked versions: just-bash 3.2.0 = 22,280,274 unpacked bytes; acorn 8.18.0 = 565,327. Combined direct-package savings: 21.79 MiB unpacked / 9.45 MiB compressed downloads, when neither is otherwise required; transitive savings excluded. This is installation savings, not guaranteed Worker-bundle or Computer-tarball savings: prebuilt shell payloads remain.
The issue body requests implementation; I’m treating that as proposal context, not authorization to change code. This run proposes only this write-up.
aron-cf commentedon Oct 26, 2026
This is now fixed.