Feature request: Mechanism to extend codec/filter registry
This is related to #233 (and specifically this comment). For codecs/filters that are not currently supported, IIUC the only way to add support is to patch zarrita.js source itself.
The feature I'm requesting is a mechanism to register additional codecs/filters. I think this would be useful both as a way to
- decouple development of e.g. TS implementations of the python zarr.numcodecs codecs suite of codecs from the main zarrita.js source, as well as
- supporting truly custom third-party codecs.
I (and my colleagues) would be willing to take a crack at this with a bit of guidance!
just a heads-up: if you plan on working with zarr v3, then I would not treat numcodecs as a reference for anything. the right reference for zarr v3 codecs is zarr-extensions. See https://github.com/zarr-developers/zarr-python/pull/3332#issuecomment-3457543346 for more context.
I think this is a documentation issue: the exported registry map provides a way for applications to register their own codecs.
Yes, sorry for the delay. Definitely a documentation thing. There have been a lot of changes in my work recently, should hopefully settle down in a couple of weeks.
Right now the mechanism for extending codecs is to use registry:
import * as zarr from "zarrita";
zarr.registry.set("codec", () => Codec);
const arr = await zarr.open(store, { kind: "array" })
Here's an example. I'm generally open to accepting PRs for various TypeScript implementations of codecs (since they likely don't contribute that much to bundle size), less so WASM. However, I do think there is some tension between v2 and v3 at the moment that might require some API redesigns.