[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 ArticleIs this node error something I'm doing?
Without the prebuilt files, your rescript library can’t be used by JS/TS codebases
View ArticleUsing React server/client components with Rescript (React 18/NextJS 13)
could this be worked into decorators? @react.clientComponent @react.serverComponent @react.sharedComponent?
View ArticleFormal 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 ArticleHandling 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 ArticleWarning 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 ArticleHandling 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[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 ArticleErgonomic 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 ArticleErgonomic 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 ArticleErgonomic 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 ArticleAllow 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 ArticleErgonomic 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 ArticleErgonomic 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 ArticleErgonomic 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 ArticleErgonomic 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