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

Question about variables in module behavior

The reason you are seeing this is because of JavaScript. Here’s the compiled JS from what you wrote: // Generated by ReScript, PLEASE EDIT WITH CARE let state = []; function make(foo) {...

View Article


General build overview/tutorial for ReScript projects?

Here’s something quick I threw together: GitHub - jderochervlk/rescript-parcel-no-framework: A simple example of a webapp using Parcel with no framework, just WebAPIs. I’m using Parcel as the build...

View Article


Question about variables in module behavior

Got it; sounds like expected behavior, thanks!

View Article

Question about variables in module behavior

you would actually get the same behavior in ocaml, go to ocaml playground and copy paste this: module MyModule = struct let state = ref([]) let make (foo: string) = state := foo :: !state; state end...

View Article

Image may be NSFW.
Clik here to view.

General build overview/tutorial for ReScript projects?

this is a very interesting question and I think it boils down to the philosophy of the project compared to Elm/ClojureScript. The latter are meant to be battery included, fully integrated, while...

View Article


General build overview/tutorial for ReScript projects?

Refactor React to ReScript Browser Extension Widgets - App in a week day 2 last year I made a little chrome extension with ReScript and React. Started from Hello World, adding React then adding...

View Article

Image may be NSFW.
Clik here to view.

General build overview/tutorial for ReScript projects?

tsnobip: while ReScript is seen as a drop-in replacement of JS, a compiler that generates regular JS and that is meant to Just Work TM with the rest of the JS ecosystem. This is the great part about...

View Article

Image may be NSFW.
Clik here to view.

General build overview/tutorial for ReScript projects?

jderochervlk: Do you want a single HTML file that just loads in JS? As I tried to explain above, the intent is really to have one codebase for a multi-page application (i.e. one shared bundle and one...

View Article


Web frontend frameworks ReScript can work with in 2024?

Yep, indeed the latest rewatch master tries to build it. But I’m getting a handful of errors similar to this: The field hxBoost does not belong to type JsxDOM.domProps. So it appears it doesn’t...

View Article


Image may be NSFW.
Clik here to view.

Typing a useState

Hello, I am having some minor problems with a small thing. On my playground below I make the compiler understand what I want to do with the following line | Loaded(asd: user) => but I would prefer...

View Article

Typing a useState

There’s a few different ways to approach it, but the simplest in your example would be to type the return type of the useState function: let (user, setUser) = React.useState((_): loadable<user,...

View Article

Image may be NSFW.
Clik here to view.

General build overview/tutorial for ReScript projects?

jderochervlk: Here’s something quick I threw together: GitHub - jderochervlk/rescript-parcel-no-framework: A simple example of a webapp using Parcel with no framework, just WebAPIs. This looks very...

View Article

General build overview/tutorial for ReScript projects?

What you’re looking for is a “Multi Page” application. A lot of the tooling out there focuses on either a single entry file (Single Page App) or Server Side Renderring, but a Multi Page app generates...

View Article


Typing a useState

Thanks, exactly what I wanted!

View Article

Compile and use in ts project

Hi, I was wondering if its possible to build a library that can be used in a pure js project and if so what steps are needed? What I would want is to build stuff in rescript and then use it in my pure...

View Article


Typing a useState

you can also annotate in the tuple: let (user: loadable<user, 'e>, setUser) = React.useState(_ => Loading) Might be a bit more idiomatic.

View Article

Image may be NSFW.
Clik here to view.

Compile and use in ts project

Hey! I don’t think ReScript has a seamless story for building JS libraries. Additional bundler features can make it possible, but the truth is that finding a good build tool for your library is still...

View Article


Compile and use in ts project

Before the library mode, my current recommendation is to use tshy as an additional build tool for genType’s .ts outputs.

View Article

Typing a useState

Btw, using useReducer is much more joyful in ReScript IMHO

View Article

Image may be NSFW.
Clik here to view.

[ANN] New module function page

We finally published a documentation page about module functions. We call them like that now since we think the old name (functor) is not as descriptive. Thank you @joshderochervlk! ReScript...

View Article
Browsing all 1846 articles
Browse latest View live