Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ $ node
> eval(result.js_code);
```

### Lambda debug outputs (API v9)
### Lambda debug outputs

`comp.rescript.compileWithDebug(source)` returns `lambda` before the backend's
Lambda optimization passes and `lambda_optimized` after the whole-term passes,
Expand All @@ -437,8 +437,8 @@ so their text can be compared directly. JavaScript lowering performs further
transformations; this snapshot is not the final JavaScript IR.

Regular `comp.rescript.compile(source)` does not capture these debug outputs.
Older bundles do not provide `lambda_optimized`; consumers should treat it as
optional when supporting multiple API versions.
Older bundles do not provide `lambda_optimized`; detect this optional field's
presence rather than inferring support from the API version.

### Testing the Playground bundle

Expand Down
2 changes: 1 addition & 1 deletion changes/developer-playground-lambda-diff.internal.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Add before/after optimization views and inline diffs to the developer playground's Lambda tab, with optimized Lambda output in playground API v9, deferred hidden-panel updates, and debounced comparisons while editing. https://github.com/rescript-lang/rescript/pull/8636
- Add before/after optimization views and inline diffs to the developer playground's Lambda tab, with optional optimized Lambda output, deferred hidden-panel updates, and debounced comparisons while editing. https://github.com/rescript-lang/rescript/pull/8636
1 change: 1 addition & 0 deletions changes/playground-api-v8-compatibility.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Keep playground compiler API v8 when adding optional optimized Lambda output, preserving compatibility with existing playground clients. https://github.com/rescript-lang/rescript/pull/8930
3 changes: 1 addition & 2 deletions compiler/jsoo/jsoo_playground_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@
* v6: Added `config.experimental_features` and `config.jsx_preserve_mode` to the BundleConfig.
* v7: Added debug dump output APIs for developer playground tooling.
* v8: Added genType and source map configuration and compilation outputs.
* v9: Added optimized Lambda output to debug compilation.
* *)
let api_version = "9"
let api_version = "8"

module Js = Js_of_ocaml.Js

Expand Down
2 changes: 1 addition & 1 deletion packages/dev-playground/src/LambdaView.res
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ let make = (~input: unit => option<input>, ~visible, ~mode: Signal.t<mode>) => {
let unavailable = () =>
<p class="lambda-notice">
{View.text(
"This compiler bundle does not provide optimized Lambda. Select a compiler with playground API v9 or newer.",
"This compiler bundle does not provide optimized Lambda. Select a newer compiler bundle.",
)}
</p>
let panelInput = Signal.make(None)
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/playground_test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const syntaxErrorResult = compiler.rescript.compile("let = 1");
assert.equal(syntaxErrorResult.type, "syntax_error");
assert.match(syntaxErrorResult.errors[0].fullMsg, /\u001b\[/);

assert.equal(rescript_compiler.api_version, "9");
assert.equal(rescript_compiler.api_version, "8");
const lambdaSource = "let compute = x => { let unused = x + 1; x }";
const lambdaResult = compiler.rescript.compileWithDebug(lambdaSource);
assert.equal(lambdaResult.type, "success");
Expand Down
Loading