Skip to content

Commit 960b8d9

Browse files
committed
Add pending changes to playground infra for building 10.1.2
1 parent f2d5c80 commit 960b8d9

File tree

4 files changed

+37
-32
lines changed

4 files changed

+37
-32
lines changed

jscomp/jsoo/jsoo_playground_main.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ module Compile = struct
469469
let env = Res_compmisc.initial_env () in (* Question ?? *)
470470
(* let finalenv = ref Env.empty in *)
471471
let types_signature = ref [] in
472-
Js_config.jsx_version := Some Js_config.Jsx_v3; (* default *)
472+
Js_config.jsx_version := Some Js_config.Jsx_v4; (* default *)
473+
Js_config.jsx_mode := Js_config.Automatic; (* default *)
473474
let ast = impl (str) in
474475
let ast = Ppx_entry.rewrite_implementation ast in
475476
let typed_tree =

packages/playground-bundling/package-lock.json

Lines changed: 9 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/playground-bundling/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"author": "",
1212
"license": "ISC",
1313
"dependencies": {
14-
"@rescript/react": "^0.10.2"
14+
"@rescript/react": "^0.11.0"
1515
}
1616
}

playground/playground_test.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,37 @@ require("./packages/@rescript/react/cmij.js")
44
let compiler = rescript_compiler.make()
55

66
let result = compiler.rescript.compile(`
7-
let a = <div> {React.string("test")} </div>
7+
@@jsxConfig({ version: 4, mode: "automatic" })
8+
9+
module A = {
10+
@react.component
11+
let make = (~a) => {
12+
<div> {React.string(a)} </div>
13+
}
14+
}
15+
16+
module B = {
17+
type props = { a: string }
18+
19+
let make = ({a}) => {
20+
<A a/>
21+
}
22+
}
23+
24+
let a = <B a="hello" />
825
`);
926

1027
if(result.js_code != "") {
1128
console.log('-- Playground test output --');
1229
console.log(`ReScript version: ${compiler.rescript.version}`);
1330
console.log('----');
31+
if(result.errors && result.errors.length > 0) {
32+
console.log("COMPILATION ERROR");
33+
for(let error of result.errors) {
34+
console.log(error.shortMsg);
35+
}
36+
process.exit(1);
37+
}
1438
console.log(result.js_code);
1539
console.log('-- Playground test complete --');
1640
}

0 commit comments

Comments
 (0)