Immutable to Mutable Record type
Seems like :> works on record coercion and has a nice error message showing the incompatible types. See this example. Given that, I can have a sentinel in the module like so: let _keepRecordsInSync...
View ArticleBinding to Postgres.js — sharing experience
Also not quite related but if you want to try something new you can use Bun’s SQL API with rescript-bun; here’s an example. (Under the hood the bindings do something very similar to what you did)...
View ArticleBinding to Postgres.js — sharing experience
Oh wow! I didn’t saw Bun’s SQL features. I was trying to use Bun on backend ~2 years ago and ironically enough it was 10X slower or so than Node.js in functions that use Postgres.js. I need to give it...
View ArticleBinding to Postgres.js — sharing experience
Side note, but Bun is shaping up to be a really good combo with ReScript. The bindings needs more love since the surface are is absolutely huge. But overall it’s very promising.
View Article[Feedback] Preserve JSX mode
Thanks for the guidance and discussion. it seems to be doable now with v12-rc? some experiments I did: GitHub - Frank-III/rescript-solid I believe there are some edges but looks promising!
View ArticleConvex.dev + ReScript
Thanks for the suggestion. I made this to auto-generate rescript modules and types: GitHub GitHub - Frank-III/convex-rescript-codegen: Generate type-safe ReScript... Generate type-safe ReScript...
View ArticleConvex.dev + ReScript
Very nice @Frank-III ! And clever to parse the TS types directly. I’ve been experimenting with that approach as well and it works surprisingly well. Maybe we should set up a dedicated repo at some...
View ArticleBinding to Postgres.js — sharing experience
Being able to use @taggedTemplate in function parameters of bindings would be really nice indeed, I’ll try to take a stab at it once I have some free time!
View ArticleModule questions / "interface" functionality
Hello all! Huge fan of this wonderful programming language so far. I absolutely love it. I do have a couple questions about the optimal path forward on a couple of module-related issues - please...
View ArticleModule questions / "interface" functionality
To have the module hierarchy, the submodules would actually need to be defined inside of a parent ParentModule file. For simple cases, just doing it inline usually suffices: // ParentModule.res module...
View ArticleModule questions / "interface" functionality
Thank you for this! This solves my dilemma. I appreciate the response.
View ArticleModule questions / "interface" functionality
Hello @elias-michaias and welcome to ReScript! Thank you for your kind word about ReScript. For your first question, another way to solve it is to break down your main modules into packages inside a...
View ArticleModule questions / "interface" functionality
The trick for No. 2 is probably the most ideal solution. For No. 1, does that require me making the package remote? Or can I import a local package? Furthermore, if I do this, since it is an “external...
View Article@throws alternative in ReScript
Hi, Does ReScript have something like @throws in: /** * Returns paginated items list. * * You can use the generic T to supply a wrapper type of the crud model. * * @throws {ClientResponseError} */...
View ArticleModule questions / "interface" functionality
For #1, you can have a monorepo setup where all your packages are local with a root rescript.json, v12 built-in build system handles it out of the box. I think you’ll then need to install and set up...
View Article@throws alternative in ReScript
you can use renalyze’s @throws, but if I remember correctly it only works inside the same package, ideally we should change this so it works in monorepos and dependent packages.
View Article@throws alternative in ReScript
It would be great to have this work across packages, and to be part of the compiler so the warnings/errors are more visible.
View Article