You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Upgrading the Reason version within BuckleScript
316
316
317
-
The playground is shipping with a specific Reason syntax version, which currently needs to be updated manually once in a while.
318
-
Paths to relevant files:
317
+
Each BuckleScript release is coupled to a specific Reason syntax version, which currently needs to be updated manually once in a while.
319
318
320
-
-`jscomp/main/refmt_api.ml`: Contains the programmatic interface for the refmt syntax converter (responsible for transforming Reason string code to an OCaml AST)
321
-
-`lib/4.06.1/refmt_main3.ml`: The refmt binary used within BuckleScript itself. The `3` corresponds to the corresponding major version of refmt.
319
+
It's important that we need to update two specific files:
320
+
321
+
-`jscomp/main/refmt_api.ml`: Contains the programmatic interface for the refmt syntax converter (responsible for transforming Reason string code to an OCaml AST) -> Only used in the BuckleScript JS Playground
322
+
-`lib/4.06.1/refmt_main3.ml`: The refmt binary used within BuckleScript itself. The `3` corresponds to the corresponding major version of refmt -> Used to build the vendored `refmt`, aka. `bsrefmt`
322
323
323
324
Both files are generated by using the `jscomp/bin/bspack.exe` binary (which is also built automatically when you build the compiler inside this repository) on the refmt parser. In more detail, `bspack.exe` resolves all dependencies of one specific `.ml` input file, puts them in the right order and copies all the source code with the target input file in one huge `.ml` bundle.
You should now have a new `playground/exports.js` with the new Reason version included.
365
+
You should now have the newest `refmt` binary for the actual compiler, and for the playground, a new `playground/exports.js` file with the new Reason version included.
366
+
367
+
**Important:** Always verify that the updated Reason version is in sync in the
368
+
`refmt.exe` and the playground bundle. Use `lib/bsrefmt --version` and for the
369
+
playground API `window.reason.version` (not final) to get the bundled
0 commit comments