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

[RFC] Generic JSX transform

First things first: It’s working fine! My first observations: I had to implement a DOM module instead of Elements. It’s not clear which methods have to be implemented. Some methods have to be...

View Article


Is this node error something I'm doing?

Without the prebuilt files, your rescript library can’t be used by JS/TS codebases

View Article


Using React server/client components with Rescript (React 18/NextJS 13)

could this be worked into decorators? @react.clientComponent @react.serverComponent @react.sharedComponent?

View Article

Formal verification and Software Design

Is there even a use for that? Wouldn’t you need to verify browsers and JS engines, for it to hold any value?

View Article

Handling nullable for parameter of @external make binding - HeadlessUI Combobox

Hi, I am trying to bind HeadlessUI’s Combobox but am having an issue when the nullable prop is set to true as the onChange function will have a null passed in and crash the client. My current binding...

View Article


[ANN] rescript-struct@5.1 - Make JS/TS a full-fledged target

I reported it because of portability issue, not because of security. The probelm is the implementation relies on the API surface that are often prohibited. Prohibiting eval is a host’s decision and...

View Article

Warning when degenerate unary is created?

In our codebase I notice junior engineers often parrot and write Js.Array2.map(x => x->otherUnaryFunction) Another thought in a series but seems like a thing that compiler could warn against...

View Article

Handling nullable for parameter of @external make binding - HeadlessUI Combobox

AFAIK you can’t use annotations inside props or types, you have to use the Nullable.t type here, but there’s a more idiomatic way to handle them starting from v11: let onChange = (selected:...

View Article


[RFC] Generic JSX transform

What framework are you testing out? I’m trying to get this to work with Solid.js.

View Article


[RFC] Generic JSX transform

A bunch of fixes related to this has landed and will be in the next rc for 11.1. About the docs - yes, a deeper dive into the specifics in the docs would be great, I agree.

View Article

Image may be NSFW.
Clik here to view.

[RFC] Generic JSX transform

Tried solid, but had problems with some optimizing steps of rescript (destructuring of signals break their reactivity). Anyways I didn’t want to include babel or some other additional tools. Then I...

View Article

Ergonomic bindings to database drivers are so frustrating

in JS (might be a little pseudo) let sql = `insert into something (id, name, parentId) values (?,?,?)` await conn.execute(sql, [1, "blah", 2]) Its that damn array. It can contain numbers, strings,...

View Article

Ergonomic bindings to database drivers are so frustrating

Yes, exactly that, just add @as(undefined) to the undefined case and you’re good to go, it’ll be unrefined at runtime. Off topic but related:...

View Article


Ergonomic bindings to database drivers are so frustrating

Ok so I’ve got this @unboxed type queryParamTypes = I(int) | S(string) | @as(undefined) Undefined let f = (~x: int, ~y: string, ~z=Undefined) => { [I(x), S(y), z] } let r = f(~x=1, ~y="two")...

View Article

Allow using `...` operator to shallow copy a record without rewrite any fields

type state = { id: string, frames: array<Js.TypedArray2.Uint8Array.t>, duration: float, width: int, height: int, } type mutableState = { mutable id: string, mutable frames:...

View Article


[RFC] Generic JSX transform

I’m trying to use email template frameworks in rescript, let’s see how it goes!

View Article

Ergonomic bindings to database drivers are so frustrating

You could also use tuples to allow heterogenous types, or you could also use tagged templates starting from 11.1 to generate your queries.

View Article


Ergonomic bindings to database drivers are so frustrating

I tried tuples but I didn’t know a way to writing a binding for a variable length tuple parameter, only an array worked, in this case I kludged it by using a string array. i.e....

View Article

Ergonomic bindings to database drivers are so frustrating

Why would you need a function to generate parameters? You could probably make them without it, right? ReScript Playground If you don’t mind wrapping the values in variants, I think it is a pretty...

View Article

Ergonomic bindings to database drivers are so frustrating

For variable tuple length, the react bindings just define a different function for each length which I think works pretty well @send external query: (Pool.t, string, 'a) => 'b = "query" @send...

View Article
Browsing all 1774 articles
Browse latest View live