Proposal: Make build -with-deps a default behaviour

A problem with rescript build is that it doesn’t rebuild a package when a new version is installed. It’s especially critical when multiple developers are working on a project. Often they don’t know when some package is updated to run rescript build -with-deps.

To solve the problem, we have -with-deps in all our scripts, including the ones with watch mode. I think it makes sense to make it a default behavior and add something like -without-deps as @tsnobip suggested in the [ANN] ReScript 9.1.4 release - #3 by tsnobip.

I think it’ll be a more reliable default, even if the issue with rebuilding packages when the version change is fixed.

8 Likes

I also have -with-deps flag on all my build scripts

During the last two months, I got two issues on GitHub and a question in telegram about my library not working. The reason was that they were changing the suffix option in bs-config and running rescript build.
I think it’s not normal that three random people got a very difficult-to-debug error which can be easily prevented by having the -with-deps flag turned on by default.

1 Like

I’m all for making it the default.

2 Likes

Yes let’s help people fall into the pit of success.

4 Likes

any benefit in introducing --without-deps with the change?

What does --with-deps do? I have a pnpm monorepo with custom Jest bindings in it’s own package, and anytime I modify the Jest package I have to run npx rescript clean to pick up the changes, is that related?

We could wait until someone comes to this forum and says “hey my builds are taking too long” and then add it.

With -with-deps you don’t need to run rescript build, just restart the compiler.

It doesn’t build the dependencies in watch mode.

Especially useful when working in a team and pulling changes with a ReScript package updated. With -with-deps it’ll just work. While without it you’ll first get a weird compile/runtime error, and then need to run rescript clean to fix it.

1 Like

I don’t see a need for this.

I’ve made the PR to compiler Make build -with-deps a default behaviour by DZakh · Pull Request #6350 · rescript-lang/rescript-compiler · GitHub

4 Likes