I think it would be cool to make plugins for common JavaScript build/bundler tools in order to make it easier to embed Dataflow notebooks into other applications. These plugins would compile .ojs files into ES modules (as well as handle FileAttachments the dataflow-way), in ways like:
import {Runtime} from "@observablehq/runtime"
import {Library} from "@alex.garcia/dataflow/core" // not possible right now
import define from "./notebook.ojs"
// could also be react, vue, svelte, etc.
function main() {
const runtime = new Runtime(new Library());
const main = runtime.module(define, Inspector.into(document.body));
// etc.
}
The bundler tool would compile .ojs imports into ES modules, similar to dataflow compile.
I think it would be cool to make plugins for common JavaScript build/bundler tools in order to make it easier to embed Dataflow notebooks into other applications. These plugins would compile
.ojs
files into ES modules (as well as handle FileAttachments the dataflow-way), in ways like:The bundler tool would compile
.ojs
imports into ES modules, similar todataflow compile
.