asg017 / dataflow

An experimental self-hosted Observable notebook editor, with support for FileAttachments, Secrets, custom standard libraries, and more!

Home Page:https://alexgarcia.xyz/dataflow/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bundler plugins for webpack, esbuild, rollup, etc.

asg017 opened this issue · comments

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.

  • Webpack
  • esbuild (have started)
  • rollup