Some might have noticed that there is already a
@rescript/react package, which is a simple ReScript syntax port of
reason-react with a few renamed module names (and very old apis removed). We didn’t do much advertisement around it just yet, because we are still doing some fine-tuning for edge-cases where existing reason-react users experience problems in their migration (it involves some simple breaking changes).
There is one particular migration issue that is more related to package management than actual apis: If your app uses another ReScript package that depends on
reason-react, you can’t really mix it with
@rescript/react code, because both packages occupy the
React module in the global scope, which will confuse the compiler. More details can be found in this recent issue.
From our POV we thought it wouldn’t be such a big deal, because the migration from
@rescript/react was just a matter of changing the npm dependency and globally regex-replace a few names (ReasonReact -> RescriptReact). But I can understand that this might be an actual deal breaker for some folks in certain circumstances or setups. Right now we are still able to fix things up.
It would be interesting to know how many early adopters had problems so far using
@rescript/react (due to breaking 3rd party deps), or have any other kind of feedback from their side.
If your app still runs on
reason-react, maybe let us know what third party libs you are using that have a dependency to
reason-react as well to get a bigger picture.
To be clear: We don’t expect / force every user to migrate right away. We just want to make sure everyone has a pretty easy upgrading experience later on. Move at your own pace and continue working on your products while we figure out the details.
As soon as we have a clearer picture on common issues we will document everything properly.
If you are already using
@rescript/react and it works: Great!