Oh no, we're toast because of PPX usage
Thanks @ashton but we’re already done! And I think we may have avoided some bugs that Spice needs to address still.
View ArticleError compiling @rescript/core with Rescript 11
ashton: rescript-auth0-react that’s your own library that you link locally or something? Because I only see older versions of it published on npm.
View ArticleLooking for a React.memo() Example
This doesn’t seem to work for me with React.memoCustomCompareProps
View ArticleLooking for a React.memo() Example
memoCustomCompareProps is a bit clunky due to how @react.component works, but it’s doable: module Counter = { type propDef = {prefix: string} let customMemo = React.memoCustomCompareProps(_, (p1, p2)...
View ArticleDoes Rescript Still support impl ? (Or, any feature like trait constraints)
I had a code in Rust. I wanted to code this in Rescript. Does Rescript support impl ? or anything similar to this ? trait Trait1 { fn method1(&self); } trait Trait2 { fn method2(&self); }...
View ArticleLooking for a React.memo() Example
Thanks @cwstra, I really appreciate all your answers! What does the colon mean in @react.component(: props)?
View ArticleLooking for a React.memo() Example
Not really sure. I just aped the syntax from the PR that added it.
View ArticleDoes Rescript Still support impl ? (Or, any feature like trait constraints)
Rescript’s type system is a bit different, though usually you can get some of the same effects with Functors. module type Base = { type t } module type Trait1 = (Base: Base) => { let function1:...
View ArticleLooking for a React.memo() Example
(From tinkering, it might be for passing a type as an argument to a decorator, rather than a value)
View ArticleDoes Rescript Still support impl ? (Or, any feature like trait constraints)
Here’s a simpler and less flexible solution that might still be sufficient, and that avoids the complexity of functors: module type Trait1 = { let function1: unit => unit } module type Trait2 = {...
View ArticleWhen to use Belt versus Core
Hello, I’m still very new to ReScript and I’m a bit lost on when to use Core versus Belt. Both for example have an Array module with helper functions. What do I use?
View ArticleWhen to use Belt versus Core
From v12 and going forward, Core will be the new standard library. Belt will move to be its own package. Use Core for all “standard” things like working with arrays etc. Belt will still have its place...
View Article@rescript/core package doesn't have the javascript file
Hello folks, I’m trying to update one of my package (repo) from bs-platform 8.2 to rescript 11, and I get the following error when importing it in a regular javascript project: Module not found: Can't...
View Article@rescript/core package doesn't have the javascript file
Upstream suggests to use esmodule, but that results in other errors, see: @rescript/core package doesn't have the javascript file · Issue #6754 · rescript-lang/rescript-compiler · GitHub
View ArticleOutput function name based on constant string
Hi, I’m using ReScript to work with Firebase functions. I have two parts: A callable function defined in Node.js A frontend application calling the function in the browser. The way Firebase works is...
View ArticleOutput function name based on constant string
One option that comes to mind is to bind to module as an external, which would let you treat index.js’s exports as a dictionary: // Firebase.res type request type response = JSON.t type apiCallback...
View ArticleOutput function name based on constant string
Thanks, works but forces me to use commonjs. Some of my other code is esm, any chance I can do something similar there?
View ArticleIssue getting generic JSX transform to work with lite-jsx
I’m working on some bindings for lite-jsx and I’m hitting an issue with how it handles children. I’m wondering if there is something I can do to resolve this. GitHub GitHub - lite-jsx/core: A simple...
View ArticleOutput function name based on constant string
That’ll depend somewhat on firebase. One possibility would be to try a default export, since that’s what cjs modules are interpreted as in esm. In other words, replace type module_ = { mutable...
View ArticleIssue getting generic JSX transform to work with lite-jsx
I think that’s the difference in the new JSX transform; in which case, tweaking rescript.json should do it. EDIT: Op, nope, that’s hardwired to React. Hm.
View Article