Coming back to ReScript!
Hi there, this is interesting feedback. No search for symbol across the project. It this would be possible to add, would of course require some work on the tooling side. The AI code generation is...
View ArticleEnforce the same generic type between two functions
Thanks, was thinking along those lines as well. One issue with that approach is that I can’t really restrict the Specification to take in a variant that will produce a string. That is another...
View ArticleInterest in Shadcn UI?
Most of us doing frontend have heard about Shadcn UI at this point. It’s a CLI that provides a set number of components (based on React and Tailwind) and other supporting code for building UIs, but...
View ArticleEnforce the same generic type between two functions
You could use a type t = private string, this way you’d make sure the parameter would be of the right type.
View ArticleChange JSX output from React to SolidJs?
Now that we will ship JSX preserve mode in v12, I made some new investigations for how well we can support SolidJS: github.com/Fattafatta/rescript-solidjs Assessment: native solidJS support in...
View ArticleInterest in Shadcn UI?
I didn’t know about shadcdn, I really like the philosophy, I tend to be irritated by common UI libs that always end up not being customizable enough and I eventually roll my own component. If we want...
View ArticleInterest in Shadcn UI?
Converting them to ReScript makes sense as well, and a lot of the code we write to bind to them will definitely be useful for a proper re-roll. But I think we should start out by just binding, so we...
View Article[Feedback] Preserve JSX mode
This looks really promising. I will do some testing with solidjs.
View ArticleEnforce the same generic type between two functions
= private string wow, never seen this syntax. Is it documented somewhere?
View ArticleEnforce the same generic type between two functions
How would that work? Doesn’t seem to capture this error: ReScript Playground
View ArticleEnforce the same generic type between two functions
something like that: module MakeScene = ( Specification: { type scenes = private string }, ) => { external scene: (Specification.scenes, 'a => unit) => unit = "scene" external go:...
View ArticleNon top-level polymorphic type (aka 'a. notation)
Hello there ! For my FRP library, I need to have a function that create a truly polymorphic function (the proxy wrapper). But the problem is that the created functions are monomorphic and cannot be...
View ArticleNon top-level polymorphic type (aka 'a. notation)
There’s a certain trick to having higher-rank polymorphic functions, as detailed in this thread. For your example, you might have to do some extra JS wrapping (or just tweak the implementation) of...
View ArticleComing back to ReScript!
Thanks very helpful. The LLM docs don’t cover Core. The AI features keep writing code like Belt. and Js.Array even though I specifically told it not to do that. Maybe we need a doc for core library.
View ArticleEnforce the same generic type between two functions
While I can’t find anything in the Rescript docs, I think the end of this section in the OCaml docs describes it as a “read-only type”.
View ArticleNon top-level polymorphic type (aka 'a. notation)
Thank you @cwstra I learned something interesting here. So what feels more natural ? // explicit context object connect(root, {name: "Alice"}) Or // B (cwstra idea) connect.f({name: "Alice"})
View ArticleComing back to ReScript!
Welcome back! There’s been a lot of work to continue to improve the language, so it’s a great time to test it out again! V12 should be shopping soon and it has some great additions, so you might want...
View ArticleGetting the named type of props for a React component
Suppose I’ve written a React component and elsewhere I want to construct a props object that I can feed into that component. How to do this? Ideally I’d like to be able to do something like...
View ArticleGetting the named type of props for a React component
When you call @react.component, under the hood, it also declares a props type, which could be used elsewhere: @react.component() let make = (~x, ~y) => { <div> <div> {React.string("x: "...
View ArticleComing back to ReScript!
I fed the LLM docs to Copilot and it still produces arrays in syntax [| 1,2,3 |] and tries to access object properties like object##prop. I think these are old Reason syntax. I kept reminding the AI...
View Article