Skip to content

Pivot to "federated package spec" (ecosystem-agnostic dependency spec) #41

Open
@justinmk

Description

@justinmk

(Note: all feedback is captured in this description + the first comment.)


To add some momentum to this effort, I suggest:

  1. Supporting all Lua-supporting versions of Vim/Nvim all "assets" or "artifacts" of any kind in the spec should be a requirement.
    • No need for Vim/Nvim to have a different package spec, plus this adds legitimacy and weight to the idea.
    • No need for this spec to be specific to vim or text editors. What's needed is simply a way to define artifacts that depend on other artifacts.
  2. Shrink the scope by at least 2x.
    • Only support one format, Lua (because it allows comments). Vim must be compiled with +lua or must have lua available on $PATH.
    • Only support one format, JSON. Because:
      • ubiquitous
      • "machine readable" (sandboxed by design): can recursively download an entire dependency tree before executing any code, including hooks. Aggregators such as https://neovimcraft.com/ can consume it.
      • Turing-complete formats invite endless special-case features (nvim-lspconfig is a living example).
    • Remove any fields that are not immediately, obviously needed.
      • Remove any fields that are provided by git. Git is a client requirement.
      • But keep anything that is needed to ensure forward-compatible enhancements.
  3. (optional) use identical field names from npm's package.json, where possible (assuming this reduces confusion rather than increasing it)
  4. Strict "no side-effects" requirement: pkg.json should be totally sandboxed (evaluating it must have no side-effects, only input and output). (Does #7 address this?)
  5. Transfer this repo to https://github.com/neovim/ ?

Client requirements

  • git (packages can live at any git URL)
  • json parser

Package server requirements

  • the package URL must be a git repo

Why NPM package.json?

NPM is special because it's ubiquitous--and lots of discussion hasn't yielded a strong case for a novel format. Using things that are ubiquitous means you gain their tooling, docs, validators (and possibly even... infrastructure).

node and NPM aren't perfect, but that doesn't matter. Choosing to be a subset of that ecosystem provides optionality: it's almost entirely upside with limited downside. We could also choose PHP's package format.
The point is to surf on something massive and immortal.

What about LuaRocks?

I've advocated for LuaRocks as the Nvim plugin manager, but defining a "plugin spec" "federated package spec" also makes sense because:

  • There is no "federated" plugin spec (corrections welcome!). LuaRocks is a "centralized" approach.
  • LuaRocks + Nvim is starting to see real progress in the form of https://github.com/nvim-neorocks , but thus far has not gained momentum. A decentralized, lowest-common-denominator, "infectious" approach is high-leverage, while work continues on the centralized LuaRocks approach at its own pace.
  • There's no central asset registry, just a bunch of URLs.
    • Could have a central list of plugins, but not assets.
  • We can do both, at low cost. pkg.json is a fairly "cheap" approach. LuaRocks
  • Luarocks itself is a somewhat complex dependency. Nvim removed it from its own build:
    • "luarocks is very slow, its servers unreliable, and its caching mechanism is straight up broken." ref ref

References

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