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

[Help] Fast Refresh with Vite and ReScript React ecosystem

We have been having trouble with spurious reloads. We use a patch for vite-rescript. Here are my observations: Vite (rollup?) seems to be really smart with finding module dependencies, if a javascript...

View Article


Oh no, we're toast because of PPX usage

Atdgen is really nice, it now works with quite many languages, including python, which is pretty useful when you want to share types between languages for API! It’d be cool to make it output more...

View Article


Image may be NSFW.
Clik here to view.

Oh no, we're toast because of PPX usage

We’re getting a bit off topic, but tsnobip: It’d be cool to make it output more idiomatic and modern rescript though, like optional fields, unboxed variants, etc. The team is open to a contribution...

View Article

Are React components with many lines of code less performant?

Yes, you should break them apart even if there aren’t performance issues. First off, React re-renders from the node and everything below it (depends) when a node state changes. So you want to...

View Article

Are React components with many lines of code less performant?

In a production scenario where there are of course budget and time constraints, this is also sound advice.

View Article


ReScript 11.1 uncurried issue with core package?

Published 7.0.1. Thanks for heads up @fham!

View Article

Image may be NSFW.
Clik here to view.

ReScript 11.1 uncurried issue with core package?

Thanks for your answers. Unfortunately, I still have this error and a new one By upgrading the rescript-classnames module, the installed version of @rescript/core is 1.3.0 As I seen in the README,...

View Article

ReScript 11.1 uncurried issue with core package?

Patch it, vendor it, or give uncurried mode a try. Don’t expect library authors to support curried mode for a longer time as it’s mostly not worth it to do both when we at some point will deprecate...

View Article


ReScript 11.1 uncurried issue with core package?

Yeah, I want to move to uncurried but I need to find an alternative to lenses-ppx. Anyway thanks for your fast answers.

View Article


ReScript 11.1 uncurried issue with core package?

a reason for not to use ppx

View Article

Image may be NSFW.
Clik here to view.

How to bind to a function that returns a class

A friend stumped me. He’s using a Javascript library that has some sort of strategy pattern where a function returns a class depending on (I dunno what ). I can’t find any way (other than using %%raw...

View Article

How to bind to a function that returns a class

This is actually a more general issue, how do you bind to the result of a function, it can be a class, a variadic function or a tagged template. I don’t think rescript support this for the time being,...

View Article

How to bind to a function that returns a class

You might need a little JS file to create the class that you can then bind to.

View Article


Are React components with many lines of code less performant?

that’s a lot of time in thinking about names for components and prop drilling everywhere.

View Article

Image may be NSFW.
Clik here to view.

Next/dynamic vs React.lazy_

Is there a difference in performance or any other caveat between using module Ui = { let make = React.lazy_(() => Js.import(PWindow_ui.make)) } versus // this is JS but I would bind it to ReScript...

View Article


Next/dynamic vs React.lazy_

seems we should use next/dynamic when using Nextjs and targetting both SSR and Client. React.lazy_ when is only Client-side

View Article

Image may be NSFW.
Clik here to view.

How to bind to a function that returns a class

I don’t know what you need this for… // Set up the condition in JS %%raw(` class Foo { bar() { console.log("bar called") } } function getFoo() { return Foo } `) module type Foo = { type t } module...

View Article


How to bind to a function that returns a class

Ok this looks better module type Foo = { type t } external getFooClass: unit => module(Foo) = "getFoo" module FooInterface = { type t external make: module(Foo) => module(Foo with type t = t) =...

View Article

How to get Input Value in Rescript?

Hello, is there no better way to do this in 2024? ReactEvent.Form.currentTarget(ev)["value2"] also is valid code and is clearly wrong.

View Article

How to get Input Value in Rescript?

At few points, such “leap of faith” access is the best compromise to compensate for the super-dynamic nature of DOM and event handling. Extracting the input value from an event is one such point. I...

View Article
Browsing all 1751 articles
Browse latest View live