Skip to content

Implement JavaScript/Node.js runtime with unified OCI workflow#29

Merged
richardkiene merged 1 commit into
mainfrom
feature/25-javascript-runtime-example
Jan 25, 2026
Merged

Implement JavaScript/Node.js runtime with unified OCI workflow#29
richardkiene merged 1 commit into
mainfrom
feature/25-javascript-runtime-example

Conversation

@richardkiene
Copy link
Copy Markdown
Contributor

Summary

  • Add JavaScript/Node.js runtime support using jco componentize with SpiderMonkey
  • Unify all module execution through OCI storage (remove run_fabrickfile endpoint)
  • Add comprehensive documentation for interpreted runtimes

Changes

JavaScript/Node.js Runtime

  • examples/runtimes/nodejs/ - Runtime implementation using jco/SpiderMonkey
  • examples/nodejs-hello/ - Example user application
  • Uses multi-layer OCI pattern: Layer 0 = runtime WASM, Layer 1+ = user source

Unified OCI Workflow

  • Remove run_fabrickfile endpoint from daemon API
  • CLI service run and run commands now use run_module endpoint
  • All modules go through OCI storage for consistent handling

Documentation

  • New docs/interpreted-runtimes.md - Complete guide for JS/Python runtimes
  • Updated CLI reference with service run command
  • Updated daemon API reference with run-module endpoint
  • Updated Fabrickfile reference with [runtime] section

Test plan

  • fabricks service run examples/hello-http - Rust HTTP service
  • fabricks service run examples/hello-world - Rust command service
  • fabricks service run examples/python-hello - Python interpreted
  • fabricks service run examples/nodejs-hello - JavaScript interpreted
  • fabricks mortar up examples/hello-http - Single service mortar
  • fabricks mortar up examples/e-commerce - Multi-service mortar (5 services)
  • All endpoints tested and working

Closes #25

Add JavaScript/Node.js runtime support using jco componentize with SpiderMonkey,
following the same multi-layer OCI pattern as the Python runtime:
- Layer 0: Pre-built runtime WASM (SpiderMonkey via jco)
- Layer 1+: User source code (tar.gz)

Key changes:

Runtime & Examples:
- Add examples/runtimes/nodejs/ - the Node.js runtime implementation
- Add examples/nodejs-hello/ - example user application
- Runtime loads user code from /app at startup via WASI filesystem

Unified OCI Workflow:
- Remove run_fabrickfile endpoint - everything now goes through OCI storage
- CLI service run and run commands now use run_module endpoint
- Consistent handling for both compiled and interpreted modules

Code Changes:
- fabricksd: Remove RunFabrickfileRequest, run_fabrickfile handler and route
- fabricksd: Remove ServiceManager::run_fabrickfile method
- fabricksd: Refactor run_module handler for clippy compliance
- fabricks CLI: Update run.rs to use resolve_module_reference
- fabricks CLI: Make ModuleSource and resolve_module_reference public
- Fix unrelated async issue in fabricks-e2e helpers

Documentation:
- Add docs/interpreted-runtimes.md - comprehensive guide
- Update cli-reference.md with service run command
- Update daemon-api-reference.md with run-module endpoint
- Update fabrickfile-mortar-reference.md with runtime section
- Update example READMEs with architecture explanations

Closes #25
@richardkiene richardkiene merged commit 45a4d11 into main Jan 25, 2026
0 of 3 checks passed
@richardkiene richardkiene deleted the feature/25-javascript-runtime-example branch January 25, 2026 18:09
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.

JavaScript/Node.js runtime example and builder (like Python)

1 participant