Skip to content

Provide clojure.edn read-string in the npm package #205

Description

@borkdude

The npm package ships no edn reader: no clojure.edn, no cljs.reader, and lib/compiler.js exports only compileString/compileStringEx. Yet edamame is already inside the compiler bundle (e/parse-string-all in cherry.compiler).

Motivation from choq: the grenadine dependency resolver reads the deps.edn manifests of git and :local/root coordinates through a :read-edn host hook (mvn coordinates use POMs, git/local use deps.edn, so an edn reader is load-bearing for the non-maven half of resolution). A project-level config file needs the same. Cherry users in general currently have no read-string at all.

Two options:

  1. Minimal: export a readString from lib/compiler.js - a one-line public fn over edamame plus an export entry.
  2. Proper: a clojure.edn module in the package with read-string, embeddable like clojure.string. As a shadow module it would depend on the :compiler chunk (edamame lives there), so browser users pay compiler weight for edn - worth a note in the module config. In choq the compiler is always resident, so it is free there.

Preference: option 2, it serves everyone rather than just embedders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions