Skip to content

salamynder/bs-mithril-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buckle up Mithril!

Testing Mithril with Bucklescript

Workflow

  1. write js-ffi (in bucklescript) and normal ocaml code in src/
  2. npm run watch runs ninja build tool, compiles src-files to folder lib/js/src
  3. npm run bundle-watch runs webpack via entry lib/js/src/main.js, puts bundle under dist/
  4. browser-> public/index.html

Errors

don’t know how to call function in obj, i.e. this structure:

  • { [Function: m] mount: ”, … }
  • this object we get when var m = require(‘mithril’)
  • m here is mithrils m-helper which unifies a lot of functionality
  • this not working: external h : string -> string -> vnode = “m” [@@bs.module “mithril”]
    • SOLUTION: leave [@@bs.module] empty, i.e.:
      • external m : string -> string -> vnode = “mithril” [@@bs.module]
      • will generate: M(“span”, v[0])

duplicate code in mithril’s .ml and .mli files

  • when removing mli declarations, bsc complaining: unbound symbols

Reference

About

Bucklescript generating mithril front end code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published