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

Making `@variadic` work with a dynamically generated array arg

In the following code snippet, how do I make the latter two work like the first? @module("path") @variadic external join: array<string> => string = "join" // 1. works as expected let v1 =...

View Article


Making `@variadic` work with a dynamically generated array arg

@variadic works with dynamic array arg, that’s actually why Caml_splice_call.spliceApply is used. If you select v12 you’ll notice it now compiles to a cleaner: Path.join(...args2) Playground link

View Article


How to return record of specific type?

I have a react element that has: type opt = {label:string, value:string} type props = { label?: string, value?: string, data: array<opt>} because rescript figures out the type from the record...

View Article

Image may be NSFW.
Clik here to view.

How to return record of specific type?

It’s good practice to put such record types into their own modules, then you can qualify the module where the record comes from after the opening curly brace: e.g.: module Opt = { type t = {label:...

View Article

How to return record of specific type?

that makes sense, thanks. Im not used to modules yet

View Article


Image may be NSFW.
Clik here to view.

Executing Code In The Playground

@fweth you had to be patient but we finally landed fully functional code execution in the playground! You can get the output from the console and also render React components. Just remember to enable...

View Article

Image may be NSFW.
Clik here to view.

Basic misunderstanding? (Playground issue?)

@chasm we’ve finally fixed this bug, all runtime dependencies now get correctly imported and your example now works: ReScript Documentation ReScript Playground Try ReScript in the browser

View Article

Image may be NSFW.
Clik here to view.

Playground - Core library error

@kay-tee we’ve finally fixed this bug, all runtime dependencies now get correctly imported and your example now works: ReScript Documentation ReScript Playground Try ReScript in the browser

View Article


Image may be NSFW.
Clik here to view.

Run code in the playground

Hello everybody, We’re very happy to announce you can now run code (including when there are runtime dependencies from the standard libraries) in the playground! Just remember to enable “Auto-run”....

View Article


Run code in the playground

might need to add a cap on the log lines first thing I did was set fizzbuzz to a really big number and it crashed my browser

View Article

Image may be NSFW.
Clik here to view.

Playground - Core library error

tsnobip: ReScript Playground That’s awesome, thanks!

View Article

Run code in the playground

Well there are tons of ways you can crash your browser by executing arbitrary code, with or without logging, I’m not sure we should spend too much time trying to mitigate those issues, but if you’re...

View Article

Run code in the playground

sure thing. I think I was just making a note that auto-run felt a bit unintuitive XD

View Article


Run code in the playground

What do you mean by “it felt unintuitive”?

View Article

Run code in the playground

not really used to having my code run as I type and I ended up crashing the browser window. Used the word unintuitive because it’s a cool feature, just unexpected results

View Article


Run code in the playground

Oh I see, we could add a “Run” button as a way to run your code on demand without doing it on every key stroke. What do you think?

View Article

Run single .res file

Hello everyone, I have a quick question: Can ReScript run individual .res files? I’m currently prototyping a CLI application and exploring alternatives to TypeScript. I’m still getting familiar with...

View Article


Leverage ES decorators

Rescript has builtin decorators (attributes), would it be possible to define them in user space?

View Article

RFC: Nested record definitions

Would it be possible to have indexed access types to alias nested types directly? They are well proved on typescript nested record access type options = { startFrom: float, persist?: { fileName:...

View Article

RFC: Nested record definitions

This feature and local type are super useful in Typescript.

View Article
Browsing all 1751 articles
Browse latest View live