Skip to content

Add JavaScript and TypeScript kernels - #112

Merged
thomasjm merged 9 commits into
mainfrom
javascript-kernel
Sep 26, 2026
Merged

thomasjm merged 9 commits into
mainfrom
javascript-kernel

Conversation

@thomasjm

@thomasjm thomasjm commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Brings back a JavaScript/Node.js kernel and adds a TypeScript one, both built on tslab (Node 24,
zeromq 6). The old ijavascript setup isn't a usable starting point: nodePackages and node2nix
are both gone from nixpkgs 26.05, so the kernel and its npm dependencies are packaged here.

  • Kernels. tslab registers both from one binary (--js or not), so they share the package
    set, node_modules and language server. The zeromq native addon is compiled from source
    against Nixpkgs' libzmq, since upstream's cmake-ts/vcpkg build needs the network. Node REPL,
    typescript-language-server, and a sample environment each.
  • Subpackages. A checked-in package-lock.json is the pin; importNpmLock fetches each
    tarball by its integrity hash, and a closure walk builds a node_modules for just the
    selected packages. 55 curated libraries: d3, vega/vega-lite, echarts, plotly, Observable Plot,
    arquero, apache-arrow, mathjs, the ml.js family, turf, sql.js, and so on. Install scripts are
    not run; update.sh rejects only those that genuinely compile something.
  • D3. Selecting d3 adds a codedown-d3 helper with render (browser-side, interactive)
    and renderStatic (jsdom, SVG in the kernel).

The kernel's working directory is the user's notebook directory, so packages reach the kernel
through NODE_PATH, tslab's compiler is pointed at the tree it lives in, and a small stdio proxy
seeds the language server's workspace with a jsconfig.json or tsconfig.json. Without that
last part the server resolves nothing: hovers come back any and completion falls back to text
matches.

Tests cover both kernels, package selection and isolation, both D3 paths, and LSP
completions/hovers against an environment package.

Still to do: regenerating the feature matrix and options docs, and removing
old_languages/javascript.

@thomasjm thomasjm changed the title Add a JavaScript kernel Add JavaScript and TypeScript kernels Sep 26, 2026
@thomasjm
thomasjm merged commit 212796f into main Sep 26, 2026
52 of 60 checks passed
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