deps: :jpm/module coordinates; the janet.* bridge autoloads jpm modules
The vendored spork/http is gone — jpm owns janet packages. In its place: - The janet.* bridge autoloads jpm-installed modules on first reference: janet.spork.http/server requires spork/http from the module path and caches its bindings (failures are negatively cached). Works for any module, in every mode, including inside net/server connection fibers. - deps.edn grows a :jpm/module coordinate: jolt-deps verifies the module is importable at resolve time, optionally running `jpm install` on the :jpm/install package once when it isn't, and otherwise fails with the install hint. Contributes no source roots. ring-app declares spork/http this way. Docs: README's interop section, docs/tools-deps.md (:jpm/module reference), and the ring-app README (including the jpm-version caveat for spork HEAD's .janet native sources, which older jpm rejects).
This commit is contained in:
parent
9aadbf42fd
commit
06e0899578
6 changed files with 106 additions and 556 deletions
13
README.md
13
README.md
|
|
@ -138,12 +138,13 @@ function expecting a tuple needs an explicit conversion. The `jolt.interop`,
|
|||
|
||||
This bridge is what makes networking (and everything else in Janet's stdlib)
|
||||
available to ordinary Clojure — for example, `jolt.nrepl` (below) is plain
|
||||
Clojure over `janet.net/*`. Jolt also vendors
|
||||
[spork/http](https://janet-lang.org/spork/api/http.html) into its binary
|
||||
(`vendor/spork/http.janet`, MIT), reachable as `janet.spork.http/*` — the
|
||||
`jolt.http` client and the Ring adapter in
|
||||
[examples/ring-app](https://github.com/jolt-lang/examples/tree/main/ring-app)
|
||||
are built on it. No `jpm install spork` required.
|
||||
Clojure over `janet.net/*`. It also reaches any **jpm-installed module**:
|
||||
the first reference to `janet.<module>/<name>` requires the module from the
|
||||
janet module path and caches its bindings — so after `jpm install spork`,
|
||||
`janet.spork.http/*` just works. The `jolt.http` client and the Ring adapter
|
||||
in [examples/ring-app](https://github.com/jolt-lang/examples/tree/main/ring-app)
|
||||
are built on spork/http this way, and a project can declare the requirement
|
||||
in `deps.edn` with a `:jpm/module` coordinate (see docs/tools-deps.md).
|
||||
|
||||
```clojure
|
||||
(require '[jolt.interop :as j])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue