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
-`playground/exports.js` -> This is the BuckleScript compiler, which binds the BuckleScript API to the `window` object
232
235
-`playground/stdlib/*.js` -> All the BuckleScript runtime files
233
236
234
-
You can now use the `exports.js` file either directly by using a `<script src="/path/to/exports.js"/>` inside a html file, or use a bundler infrastructure to optimize it.
237
+
You can now use the `exports.js` file either directly by using a `<script src="/path/to/exports.js"/>` inside a html file, use a browser bundler infrastructure to optimize it, or you can even use it with `nodejs`:
238
+
239
+
```
240
+
$ node
241
+
> require("./exports.js");
242
+
undefined
243
+
> let compile_result = ocaml.compile(`Js.log Sys.ocaml_version`); // You can change the code here
244
+
undefined
245
+
> eval(compile_result);
246
+
4.06.2+BS
247
+
undefined
248
+
```
235
249
236
250
### Playground JS bundle API
237
251
@@ -292,9 +306,10 @@ implementation. JSOO will pick up those files to encode them into the `exports.j
292
306
bundle.
293
307
294
308
For any other dependency needed in the playground, such as `ReasonReact`, you
295
-
will be required to serialize your `.cmi` / `.cmt` files accordingly so that
296
-
JSOO's `ocaml.load` function can load the data. Right now we don't provide any
297
-
instructions inside here yet, but [here's how the official ReasonML playground did
309
+
will be required to serialize your `.cmi` / `.cmt` files accordingly from binary
310
+
to hex encoded strings so that BS Playground's `ocaml.load` function can
311
+
load the data. Right now we don't provide any instructions inside here yet, but
0 commit comments