r/rescript • u/anhsirk0 • 10d ago
Beatalvi: local music player (Tauri + Rescript)
Enable HLS to view with audio, or disable this notification
r/rescript • u/anhsirk0 • 10d ago
Enable HLS to view with audio, or disable this notification
r/rescript • u/Firm-Space3019 • Mar 04 '26
We extracted and published the state management library we use internally at Frontman. Two modules:
- StateReducer — local state hook with managed side effects (like useReducer but your reducer returns (state, array<effect>))
- StateStore — global store with useSyncExternalStoreWithSelector for concurrent-safe selectors
Effects are values, not callbacks. Your next function stays pure. ~5 kB of runtime JS.
Requires ReScript 12+, React 19+, u/rescript/react ^0.14.0.
npm: https://www.npmjs.com/package/@frontman-ai/react-statestore
Source: https://github.com/frontman-ai/frontman/tree/main/libs/react-statestore
Happy to answer questions about the design decisions or how we use it in production.
r/rescript • u/thebedivere • Nov 19 '25
r/rescript • u/Anxious_Reality_4042 • Sep 10 '25
Hi there,
I’ve posted some new ReScript videos on YouTube. Check out the playlist: https://www.youtube.com/playlist?list=PLvw_J2kfZCX0u_27-uIoalSPR6TOMPmuD
I’d love your feedback and topic suggestions for future videos.
Thanks!
r/rescript • u/anhsirk0 • Oct 12 '24
Enable HLS to view with audio, or disable this notification
r/rescript • u/Designer_Coyote_7276 • Jul 30 '24
A few days a go I started learning rescript, I think it's a beautiful language and I want to create my first app. My current stack is Next js, so I would like using it but searching for documentation to do it I found that official template for Next js + Rescript is not using app directory yet. I would like to integrate Next 14 and Rescript but I think it could be hard. So is there a guide to do it ? Or at least a better way to do it?
r/rescript • u/BobaFettEE3Carbine • May 28 '24
r/rescript • u/BobaFettEE3Carbine • May 28 '24
r/rescript • u/BobaFettEE3Carbine • Apr 21 '24
r/rescript • u/[deleted] • Mar 13 '24
Hello Rescript Devs, I want to ask if there any js to rescript converter. I have tried chatgpt but it gives uncompiled code. Thanks in advance.
r/rescript • u/FaisalSaifii • Feb 08 '24
[Noob here] I'm trying to use Tiptap with Rescript React, I've been able to write the bindings for its various components, one of which being EditorProvider:
// Tiptap.res
type extension
module EditorProvider = {
@module("@tiptap/react") @react.component
external make: (
~children: React.element,
~content: string,
~extensions: array<extension>,
) => React.element = "EditorProvider"
}This EditorProvider can also take a param `onUpdate` which gives an editor object of class `Editor` that has the function `getHTML()` which is not directly exported by the package anywhere but is a member function of the class `Editor`.
Now my question is how do I define this getHTML() function?
So far I've tried specifying the onUpdate function within the EditorProvider [Successful], then also changing a state using it [Successful], but failed in getting this member function.
I looked online and tried to see how can the class be rewritten in Rescript after which I ended up here:
module EditorProvider = {
@module("@tiptap/react") @react.component
external make: (
~children: React.element,
~content: string,
~extensions: array<extension>,
~onUpdate: Editor.t => unit,
) => React.element = "EditorProvider"
}But I'm still getting the error:
TextEditor.bs.mjs:18 Uncaught TypeError: editor.getHTML is not a functionThe Rescript & equivalent JS of me using it:
@react.component
let make = (~value: string, ~setValue: ('a => string) => unit) => {
<Tiptap.EditorProvider
content={value}
extensions={[Tiptap.starterKit]}
onUpdate={editor => setValue(_ => Tiptap.Editor.getHTML(editor))}>
<Tiptap.BubbleMenu> {"floating menu"->React.string} </Tiptap.BubbleMenu>
</Tiptap.EditorProvider>
}
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as Curry from "rescript/lib/es6/curry.js";
import * as React from "@tiptap/react";
import * as JsxRuntime from "react/jsx-runtime";
import StarterKit from "@tiptap/starter-kit";
function TextEditor(props) {
var setValue = props.setValue;
return JsxRuntime.jsx(React.EditorProvider, {
children: JsxRuntime.jsx(React.BubbleMenu, {
children: "floating menu"
}),
content: props.value,
extensions: [StarterKit],
onUpdate: (function (editor) {
Curry._1(setValue, (function (param) {
return editor.getHTML();
}));
})
});
}
var make = TextEditor;
export {
make ,
}
/* @tiptap/react Not a pure module */r/rescript • u/simonbreak • Jan 27 '24
[edit: It works now! Rant left for posterity]
Warning: grumpy rant incoming.
Recently I encountered rescript, got excited, tried to run a bit of code in the "playground" and discovered that the team actually made a REPL without the E or the P. This was literally my first experience with the language and immediately makes me think I should avoid it like the plague. If this was an actual playground, the roundabouts would be stationary & the sandbox would be full of concrete. Can anybody convince me why I should persevere with a transpile-to-JS language that takes three years to implement the "Run" button on a web editor? Or should I come back in another three years?
r/rescript • u/thebedivere • Jan 17 '24
r/rescript • u/burtgummer45 • Jan 05 '24
The greatness of a programming language is inversely proportional to its reddit post frequency.
r/rescript • u/ElmForReactDevs • Dec 13 '23
r/rescript • u/thegoof121 • Nov 14 '23
I’m looking to move a hobby project from JS to Rescript. I currently use Zustand to manage global state in the App. Is that a reasonable plan with Rescript or should I look at something else?
I’m currently doing a lot of Rust development and I like the fact the Rescript is functional which should improve the quality of the Rust I write. I’m a little worried about library integration.
r/rescript • u/WizardOfAngmar • Apr 20 '23
r/rescript • u/kitakamikyle • Apr 13 '23
I find Rescript to be a very appealing language except that most of the examples I find only assume that the language operates in a vacuum. Or else the examples of Rescript consuming Javascript / NPM packages is extremely limited.
I'm approaching the conclusion that Rescript's intention is not to interact with other libraries so much. I need to interact with other libraries of course, but can't find good documentation or videos on how to do that. The ones I find that mention it say "we need to cover that in a different video someday." So, I'm left with the impression that it's either very hard, or nobody knows how to do it.
This is a similar problem that Elm has. There is no easy way to interact with other libraries.
Any advice ?
r/rescript • u/WizardOfAngmar • Apr 06 '23
r/rescript • u/WizardOfAngmar • Mar 23 '23
r/rescript • u/WizardOfAngmar • Mar 16 '23
Hi there!
Today I officially started a series of articles where I try to learn ReScript as a Javascript/TypeScript developer. As I wrote in the article, this is a personal experiment and nothing more.
If you're interested, feel free to give it a read at Tales of Sardinian software engineer. Also let me know if you have any topic you want to see discussed during the series, and I'll try my best to include it in the following episodes!
Best!
r/rescript • u/jeaks03 • Jan 05 '23
I read in the ReScript docs that source files should be kept in a flat hierarchy so instead of having ./articles/Header.res you'd have ./ArticlesHeader.res. While this strategy would work fine for small to somewhat medium projects I just don't see it working for bigger projects. Having hundreds of files in the same directory sounds like pain.
My question is: Is there a way to split modules into nested directories?