RFC - Universal monorepo for Rescript Bindings?

There has to be a better way to host and manage all the bindings for different NPM packages.

What if we made a monorepo where each binding is its own module similar to how Typescript handles their @types repo?

We are constantly spinning up new bindings on a weekly basis, but creating a whole new repo and publishing to NPM seems like overkill.

Are there any other ideas out there to improve the distribution and management of Bindings?

2 Likes

No, a monorepo like definitelyTyped doesn’t work with ReScript. TypeScript is an extra layer on top of JS, and ReScript only compiles to a subset of JS and due to its stricter type system it’s hard (or even impossible) to generalize bindings that work for everyone. We need a system that let ppl copy / paste original bindings and modify them to their use-cases if needed.

The ReScript package index has a way to curate non-npm resources. You could publish urls to single Github gists with .res and .resi files, or even point to a single file within a repository. Oftentimes ppl are publishing incomplete bindings, so this approach would help with a more lightweight distribution process that doesn’t involve publishing to npm.

Users should be encouraged to read and modify existing bindings to their use-cases, if needed (e.g. putting files found on the index in their bindings/ directory). Updating those bindings shouldn’t be too hard either, even if modified, since you’d just do a git diff and downstream the changes in the future.

3 Likes

Exactly, this is why i opened this issue

2 Likes