Skip to content

Commit

Permalink
Use RES instead of "New BuckleScript Syntax" wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ryyppy committed Jul 30, 2020
1 parent 5ac8707 commit 04924be
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bindings/Bs_platform_api.re
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Lang = {

let toString = t =>
switch (t) {
| Res => "New BS Syntax"
| Res => "RES"
| Reason => "Reason"
| OCaml => "OCaml"
};
Expand Down
33 changes: 33 additions & 0 deletions bindings/Worker.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type worker;

[@bs.new] external make: string => worker = "Worker";

module type Config = {
type fromApp;
type fromWorker;
let make: unit => worker;
};

module Make = (Config: Config) => {
include Config;

module App = {
[@bs.send] external postMessage: (worker, fromApp) => unit = "postMessage";
[@bs.set]
external onMessage: (worker, {. "data": fromWorker} => unit) => unit =
"onmessage";
[@bs.set]
external onError: (worker, Js.t('a) => unit) => unit = "onerror";
[@bs.send] external terminate: worker => unit = "terminate";
};

module Worker = {
type self;
[@bs.val] external postMessage: fromWorker => unit = "postMessage";
[@bs.set]
external onMessage: (self, {. "data": fromApp} => unit) => unit =
"onmessage";
[@bs.val] external self: self = "self";
[@bs.val] external importScripts: string => unit;
};
};
7 changes: 1 addition & 6 deletions re_pages/Playground.re
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,7 @@ module ErrorPane = {
</div>
</div>;
| Nothing =>
let syntax =
switch (targetLang) {
| Api.Lang.OCaml => "OCaml"
| Res => "New BuckleScript"
| Reason => "Reason"
};
let syntax = Api.Lang.toString(targetLang);
<PreWrap>
{j|This playground is now running on compiler version $compilerVersion with the $syntax syntax|j}
->s
Expand Down

0 comments on commit 04924be

Please sign in to comment.