Feedback needed: where is bsc used in your project?

I wanted bsc because it exposes an interface that deals with individual module.

There is a significant difference between bsc and babel.
bsc needs to compile its dependencies before itself, there is no such requirement for babel. So you would see a lot of babel plugins for webpack, but this model does not work with rescript.

If we can expose a stable granular API from rescript

let me know if you have some concrete ideas

Hi thanks!

There is a significant difference between bsc and babel.

I think I’m lost here. We’re discussing bazel integration, not babel. (TBH I don’t know babel all that much to judge the similarity).

If we can expose a stable granular API from rescript

let me know if you have some concrete ideas

I can expand on this, but I think you have more build internals knowledge to give the judgement whether it’s possible. And I can be completely wrong:

rescript compile ast ModuleA.res --out ModuleA.ast
rescript compile iast ModuleA.resi --out ModuleA.iast

rescript compile cmi ModuleA.iast --out ModuleA.cmi
rescript compile cmjjs ModuleA.ast ModuleA.cmi --out ModuleA.cmj --out ModuleA.js

rescript compile cmicmjjs ModuleA.ast --out ModuleA.cmi --out ModuleA.cmj --out ModuleA.js
rescript compile cmicmjjs ModuleB.ast --out ModuleB.cmi --out ModuleB.cmj --out ModuleB.js --deps dirA/ModuleA.cmi --deps=dirA/ModuleA.cmj --deps=dirA/ModuleA.js

It’s essentially a draft of a low-level API that most normal users wouldn’t need, but tool developers might appreciate.

1 Like

Ah, yes, I should have called out Bazel more clearly.

Oh wow, your work looks much more up-to-date. Thanks for sharing! Seems you have a much better grasp of the workings of Bazel than I do. I did have a play around and was able to get fairly basic things building with bsb… but it’s very limited.

snapshot testing of graphql-ppx for regression in the compiled output.