I’m looking for advice on best practices for using ReScript in a large-scale web application

  • My website is an e-commerce platform with complex business logic and a large codebase.
  • Problem: I’m considering integrating ReScript to improve type safety and maintainability, but I’m unsure of the best approach for a large project.
    my website URL is here

I don’t know if there’s any documentation about this, I think a lot of people prefer to start converting their business logic (the core of the architecture), and keep the outer layers in the language they used before (JS, TS, etc). You can start converting a file, compare the generated code with the original JS file, run the same tests on it, this way you can be pretty confident your conversion went ok, and then you can continue the conversion.

If you use TS today, genType can help you interface easily with your existing TS code base.

It would help if you gave more details about your use case, the language you use today, the frameworks, the main tools, etc.

We have quite many power users with more experience than me on converting projects to rescript, they’ll likely chime in :slight_smile:

edit: you can take a look at this small guide for converting a file from JS.

2 Likes

for me, THE reason to use a typed language is so I can accurately model my domain.

im assuming you’re going at it with vanilla js and wanna tighten things up with types.

ReScript being a ‘fully typed language’ means I can apply everything I learned using Elm (F# is very close to Elm syntax) for several years to working with ReScript.

DMMF is the best book when it comes to domain driven design.

if you don’t want to read it, the author has YouTube videos that sorta summarize the main points, but its worth a (re)read.

2 Likes

This book and related talks from Scott have changed the way I think about writing code and taught me how to take advantage of a good type system.