Nameof operator
I don’t remember the exact API. Looks like the code won’t work correctly, but this is what I meant
View ArticleWhat can be expected regarding the upcoming React 19 Compiler
I would be very much interested as well to see what approach the Rescript dev team will take on React 19 new compiler.
View ArticleRecord creation with function
Hey, I discovered that the @obj directive was deprecated, due to the improvements on record creation in the new version of Rescript. But I was a big fan of having a “factory” for my custom types, not...
View ArticleError compiling @rescript/core with Rescript 11
I think I got the answer, not sure if interest you guys but I’ll leave here anyways in case someone has the same problem that I was having. I also created a minimal repro environment in this repo The...
View ArticleError compiling @rescript/core with Rescript 11
We just released 1.4.0 of Core that removes the internal dep on Belt. Could you try that?
View ArticleError compiling @rescript/core with Rescript 11
zth: 1.4.0 Hey @zth thanks for the reply! I tested and it indeed seems to work, but it’s outputting another error now: I’m not sure if uncurried changed something about optional parameters, but it...
View ArticleError compiling @rescript/core with Rescript 11
@zth Actually, looking at the module itself and its interface, I can see that the function are defined equally in both: here is @rescript/core/src/Core__Float.resi: @val external parseInt: ('a,...
View ArticleNode canvas in rescript
I am using node-canvas, but I encountered a bug. If I try to execute the generated JavaScript, it gives me the following error: However, if I add a require("canvas") at the top of my index.res.js, the...
View ArticleRecord creation with function
You can achieve something similar using an identity function: type person = { name: string, email: string } external person: person => person = "%identity" let myPerson = person({ name: "foo",...
View ArticleRecord creation with function
but in that case you’re passing the record as parameter to the function, not labeled arguments;
View ArticleHow can i make sure dotenv is loaded
So, the dotenv config is placed below the requires, how can i make sure it will always be above?
View ArticleError compiling @rescript/core with Rescript 11
Actually, newer versions won’t work anymore as stated in the Readme. The only way this could be fixed is to release a version 1.2.1 or something that gets only rid of the dependencies on Belt but does...
View ArticleNode canvas in rescript
The screenshot seems to be cropped too much? Can you try again? Or post the error message text? Usually, %%raw(`require("canvas")`) should work, but if somehow not we also have the @@directive feature...
View ArticleHow can i make sure dotenv is loaded
You can use @@directive feature which puts its contents above everything else: @@directive(`require("dotenv")`)
View ArticleError compiling @rescript/core with Rescript 11
I don’t mind doing a series of 1.2.x that continues to fix things for curried mode. Uncurried will be the default from v12 going forward, and that’s where we focus our efforts, but some are going to...
View ArticleError compiling @rescript/core with Rescript 11
ashton: From this part of the documentation, if the function type annotation has ~paramName: type=? the function implementation should have ~paramName: option<type> doesn’t it this is indeed...
View Article