Description
https://github.com/BlueHotDog/reason_monorepo
Monorepo support via common tooling(specifically in the above repo Lerna) is broken.
Monorepo support for JS projects is usually being done by using symlinks to support cross-project dependencies - That's the most basic and common workflow.
Another possible monorepo approach is by using Yarn workspaces, which utilizes symlinking even more by hoisting all dependencies to the "root".
Currently, bucklescript is unable to handle any kind of monorepo setup, which, after trying to bang my head, is impossible to solve and leads to a very weird workflow for any ambitious, project(e.g a modern SPA + Nodejs server in Reason).
The example project above illustrates all the problems, but just to summarize what i've encountered:
- Bucklescript randomly spits "duplicate dependency" warning, when two packages depend on the same package. e.g: package A depends on ReFetch(v1 for example) and package B depends on ReFetch too(same version), and package B depends on package A - will result in this warning, which is incorrect.
- Bucklescript will randomly spit an error that bsconfig.json is broken(it's not) when trying to compile package B.
- Bucklescript will randomly spit a: incorrect assumption about interface(same case as the first scenario)
- Watch is just broken completely for the above reasons
- When compiling to Es6 even more errors happen(paths etc) :(
Links to previous discussions that died out and might be related:
#3521
#4047
As there's no roadmap for reasonml. any type of communication regarding stale issue would really help.