I'm looking into using ast-grep fo linting ReScript. What rules should I...
I’m still getting No language found.
View ArticleI'm looking into using ast-grep fo linting ReScript. What rules should I...
Can try running it on my work computer tomorrow to see through the fog of “it works on my machine” if we’re still stumped by then.
View ArticleI'm looking into using ast-grep fo linting ReScript. What rules should I...
Thanks for the help!
View ArticleReScript RPC like?
Which solution comes to mind to when you control the client and the server. You want to share types between front-end and back-end. Right now I have a Hono server and I call this from my client using...
View ArticleReScript RPC like?
I believe rescript-rest with Fastify can do what you’re after: GitHub - DZakh/rescript-rest: 😴 ReScript RPC-like client, contract, and server implementation for a pure REST API
View ArticleReScript RPC like?
Yeah, I looked at that, but I still need to define the rest route and have some opinion on how I want to do it http-wise. Maybe that is fine, but I just wonder if there is nothing out there where I...
View ArticleReScript RPC like?
You could also use a full server side framework like res-x or react server components.
View ArticleReScript RPC like?
ReScript Rest is very flexible, and if you miss something, let me know about it in issues, and I’ll add it. For example, if your server uses Hono.js it’s not difficult to add an integration for it, so...
View ArticleReScript RPC like?
Also, you can build a wrapper around it to always use JSON body for your transfer and simply use it like an RPC. Actually, I might make it myself as a part of the library
View ArticleReScript RPC like?
Something like this: // Contract.res let getPost = Rest.rpc(() => { input: S.string, output: postSchema }) // Client.res let post = await Contract.getPost->Rest.fetch(url, "post_1") //...
View ArticleReScript RPC like?
Yeah that would be pretty perfect! I don’t need to care how Rest.fetch does the communication and it fits in nicely with Hono.
View ArticleReScript RPC like?
I don’t know how to make it without a separate Contract.res, but maybe it’s not bad. Also, you’ll always be able to move to Rest.route if you need more HTTP control.
View ArticleReScript RPC like?
Nice, I’ll add Rest.rpc today or tomorrow. And Hono.js integration a little bit later.
View ArticleExtending JsxDOM.domProps
There are also the action and formAction attributes extended by the React library which e.g. Next.js uses to perform RPCs as part of their server actions. I am not sure, if this also qualifies as a...
View ArticleReScript RPC like?
I used rescript-hono/src/Hono.res at main · AlexMouton/rescript-hono · GitHub (and in my project the additional type middleware @module("hono/cors") external cors: unit => middleware = "cors" @send...
View ArticleExtending JsxDOM.domProps
I would make the callback return promise<unit> since it’s likely the most common signature instead of 'a. The real issue comes from the input of this callback function, you can’t make its type...
View ArticleReScript RPC like?
I’m also not hell-bent on using Hono. If HTTP server – API | Bun Docs is easier to integrate that would also work for me.
View ArticleReScript RPC like?
Me neither. So I built an rpc library some time ago (wow, 3 years ago). Never published it on npm or somewhere else. Hasn’t been updated a while. Just for my own side project. But you can have a look:...
View Article