Skip to content

Use platform specific rewatch binary #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2025

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented May 27, 2025

See #1091

Please take a look at this as well @mediremi

} else if (value.startsWith("..") && value.endsWith("ocaml")) {
// This should be the lib/ocaml folder of the project
// This is a hack to support incremental compilation in monorepos
callArgs.push("-I", path.resolve(entry.project.incrementalFolderPath, "..", "..", "ocaml"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not getting any diagnostics for the following file:

  • rescript.json
  • packages
    • samples
      • rescript.json
      • src/FlappyBird.res

bunx rewatch --rescript-version 12.0.0-alpha.14 --compiler-args packages/samples/src/FlappyBird.res

gave:

{
  "compiler_args": [
    "-I",
    "../ocaml",
    "-I",
    "/Users/nojaf/Projects/rescript-kaplay/packages/rescript-kaplay/lib/ocaml",
    "-uncurried",
    "-bs-package-name",
    "@nojaf/samples",
    "-bs-package-output",
    "esmodule:src:.res.mjs",
    "-bs-v",
    "12.0.0-alpha.14",
    "src/FlappyBird.ast"
  ],
  "parser_args": [
    "-bs-v",
    "12.0.0-alpha.14",
    "-uncurried",
    "-absname",
    "-bs-ast",
    "-o",
    "src/FlappyBird.ast",
    "../../src/FlappyBird.res"
  ]
}

Where -I "../ocaml" is supposed to be packages/samples/lib/ocaml.
I was getting error for my other modules (inside the same project) not being found.

@jfrolich any ideas why this happens?

With this fix, everything works like a charm again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zth as Jaap mentioned on Discord, we should run this from bs/lib.
I changed this for Rewatch only, to not impact any existing bsb users.

@nojaf nojaf requested a review from zth May 27, 2025 15:17
@mediremi
Copy link
Contributor

LGTM ✔️

@nojaf
Copy link
Contributor Author

nojaf commented Jun 3, 2025

@zth can I please get a review here?
I downloaded the vsix, and this has been working fine for a week now.

@zth zth merged commit 412463c into rescript-lang:master Jun 3, 2025
6 checks passed
@nojaf
Copy link
Contributor Author

nojaf commented Jun 3, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants