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

Shorter variant TAG output?

Is it also configurable globally?

View Article


I’m looking for advice on best practices for using ReScript in a large-scale...

This book and related talks from Scott have changed the way I think about writing code and taught me how to take advantage of a good type system.

View Article


Shorter variant TAG output?

Not that I know unfortunately!

View Article

Image may be NSFW.
Clik here to view.

What can be expected regarding the upcoming React 19 Compiler

This has nothing to do with JSX or plain function calls. It’s because ReScript 11 still compiles to var assignments. If you change the vars in the compiled output JSX file to let, it should work. -...

View Article

[ANN] ReScript Retreat Roadmap Summary 2024

An important use for JSX preserve mode would be to leverage the React 19 optimizing compiler which auto-memoizes what otherwise would require useMemo , useCallback , and React.memo by preserving jsx...

View Article


What can be expected regarding the upcoming React 19 Compiler

Maybe if we could preserve JSX output from Rescript it might’ve worked. It may arrive on Rescript 12

View Article

Do you need immer-like library bindings in ReScript?

If there is a way to convert immutable record types to mutable ones, then should be straightforward to correctly type immer’s produce function type person = { name: string, age: int } // converts to...

View Article

Image may be NSFW.
Clik here to view.

What can be expected regarding the upcoming React 19 Compiler

Thank you for checking the code and correcting my misunderstanding Looking forward to Rescript 12 then!

View Article


Image may be NSFW.
Clik here to view.

Is it safe to ignore Warning number 30?

I get the label servers is defined in both types pathItem and operation.. Is it safe to use @@warning("-30") to ignore it?

View Article


Is it safe to ignore Warning number 30?

Hmm, wouldn’t it be easier to namespace those types inside modules then? It’s not that it’d be unsafe, more like it means you’d have to annotate the value.

View Article

Flow-like render types?

Flow recently added a type system feature which allows to restrict children by component type called Render Types component Header(size: string, color: string, message: string) { return <h1...

View Article

Flow-like render types?

Jsx components don’t necessarily return a react element in rescript, so you can definitely do it, just make it return some type you want and have your other component expect this type as a parameter.

View Article

Flow-like render types?

hmm I actually tried and it’s pretty cumbersome to redefine the return type of a JSX element in practice because mixing the return types of those JSX elements between custom and regular Jsx.element...

View Article


Convex.dev + ReScript

Starting this thread about how to integrate Convex.dev with ReScript. Any tips and insights are welcome.

View Article

Convex.dev + ReScript

How to put ReScript files using inside convex folder In convex folder you can have the files like this: /convex/hello..res /convex/hello..res.js Two dot so that convex ignore the ReScript file.

View Article


Convex.dev + ReScript

Helpful snippets for VSCode for useMutation and useQuery { "usemut": { "prefix": "usemut", "body": [ "module Mutation_$1 = {", " @module(\"@packages/backend/convex/_generated/api\")", " external api:...

View Article

JS API to compile ReScript to JS

I’ve done this recently, but very hacky. so Svelte has the concept of pre-processors that take differently types of language like typescript, SCSS, Pug and turns it into JS, CSS and HTML in a...

View Article


JS API to compile ReScript to JS

I’m thinking something like this would increase the reach of Rescript too, as it would make it easier for third parties to adopt it into the tooling(LSP, Build systems, etc …)

View Article

Image may be NSFW.
Clik here to view.

Tuple access by index (range)

Rescript has only one way to access tuple elements: destructuring, this limitation prevents from using them as fixed length arrays let ageAndName = (24, "Lil' ReScript") // possible to get item by...

View Article

Object access using variable

May be possible while keeping soundness by using Polymorphic Variants as long as it matches ones of the object keys type flower = { color: string, petals: int } let flower = { color: "red", petals: 5...

View Article
Browsing all 2602 articles
Browse latest View live