Quantcast
Channel: ReScript Forum - Latest posts
Browsing all 1835 articles
Browse latest View live

I'm looking into using ast-grep fo linting ReScript. What rules should I...

I’m still getting No language found.

View Article


I'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 Article


I'm looking into using ast-grep fo linting ReScript. What rules should I...

Thanks for the help!

View Article

ReScript 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 Article

ReScript 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 Article


ReScript 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 Article

ReScript RPC like?

You could also use a full server side framework like res-x or react server components.

View Article

Image may be NSFW.
Clik here to view.

ReScript 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 Article


Image may be NSFW.
Clik here to view.

ReScript 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 Article


ReScript 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 Article

ReScript 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 Article

ReScript 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 Article

ReScript RPC like?

Nice, I’ll add Rest.rpc today or tomorrow. And Hono.js integration a little bit later.

View Article


ReScript RPC like?

Could you share the Hono.js bindings you use?

View Article

ReScript RPC like?

Loving all of this! Magic happening in real time.

View Article


Extending 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 Article

ReScript 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 Article


Extending 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 Article

ReScript 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 Article

ReScript 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
Browsing all 1835 articles
Browse latest View live