Skip to content

Commit

Permalink
Js_of_ocaml TodoMVC Example.
Browse files Browse the repository at this point in the history
Js_of_ocaml is a compiler of OCaml bytecode to Javascript.
OCaml is a general purpose programming language with an
emphasis on expressiveness and safety. Js_of_ocaml brings
nearly all the OCaml features to Javascript. And especially
its powerful type system.
  • Loading branch information
slegrand45 committed Oct 7, 2015
1 parent 26bfec3 commit b6d468f
Show file tree
Hide file tree
Showing 16 changed files with 4,804 additions and 0 deletions.
1 change: 1 addition & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"examples/duel/www/**",
"examples/duel/src/main/webapp/js/lib/**",
"examples/polymer/elements/elements.build.js",
"examples/js_of_ocaml/js/*.js",
"**/generated/**"
],
"requireSpaceBeforeBlockStatements": true,
Expand Down
3 changes: 3 additions & 0 deletions examples/js_of_ocaml/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_build

*.byte
1 change: 1 addition & 0 deletions examples/js_of_ocaml/.jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/todomvc.js
11 changes: 11 additions & 0 deletions examples/js_of_ocaml/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# Compile OCaml source file to OCaml bytecode
ocamlbuild -use-ocamlfind \
-tags "warn(-40)" \
-pkgs lwt.syntax,js_of_ocaml,js_of_ocaml.syntax,js_of_ocaml.tyxml,tyxml,js_of_ocaml.deriving,js_of_ocaml.deriving.syntax,deriving \
-syntax camlp4o \
todomvc.byte ;

# Build JS code from the OCaml bytecode
js_of_ocaml +weak.js --opt 3 -o js/todomvc.js todomvc.byte
14 changes: 14 additions & 0 deletions examples/js_of_ocaml/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Js_of_ocaml • TodoMVC</title>
<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
</head>
<body>
<div id="todomvc" class="todoapp"></div>
<script src="js/todomvc.js"></script>
</body>
</html>
3,263 changes: 3,263 additions & 0 deletions examples/js_of_ocaml/js/todomvc.js

Large diffs are not rendered by default.

Loading

0 comments on commit b6d468f

Please sign in to comment.