Hi ! I would like to know, is there a way to build Octane application with ReScript ?
In fact I plan to use it in a Tauri 2 application.
Hi ! I would like to know, is there a way to build Octane application with ReScript ?
In fact I plan to use it in a Tauri 2 application.
Hi, I have very little knowledge about Octane, but as long as it accepts js code, you should be able to use rescript for it. You might be limited by some annotations and language extensions though.
Hi ![]()
Thank you very much ![]()
Using Octane with JSX should be very simple. You can copy most of the react bindings to set it up.
TSRX is another story. ReScript can’t export the directives like @if, @else, @for, etc. Even with escape hatches like %raw it wouldn’t work.
Example (jsx preserve mode):
Input:
@jsx.component
let make = () => {
<div>
%raw(`@if (props.loading) {`)
<div> {Jsx.string("hello world")} </div>
%raw(`}`)
</div>
}
Output:
function App(props) {
return <div>
{(@if (props.loading) {)}
<div>
{"hello world"}
</div>
{(})}
</div>;
}
I don’t know how the performance lost look like if you just use tsx instead of tsrx in octane. Probably it is worth it.
Thank you very much ![]()