olivergg / scalajs-ionic-starttabs

An experimental mobile application written in Scala-js with the Ionic framework
http://olivergg.github.io/scalajs-ionic-starttabs/www/index-prod.html
GNU General Public License v2.0
28 stars 3 forks source link

scalajs-ionic-starttabs

An experimental HTML5 mobile application that puts together the following libraries :

A live demo is available at http://olivergg.github.io/scalajs-ionic-starttabs/www/index-prod.html

You will need to install the Ionic framework first (see http://ionicframework.com/getting-started/).

This application aims to be almost equivalent to the one created with : ionic start XXXXXXX tabs

There are several things you can customize in the Build.scala file :

 // the output folder for the generated scala-js javascript files (and jsdeps and launcher and SourceMaps)
 lazy val outputCompiledJS = new File("ionic/www/js")
 // the output folder for the generated HTML files
 lazy val outputCompiledHTML = new File("ionic/www")
 // the input package folder that will be scanned to find scala files compilable to HTML
 lazy val htmlScalaSourceDir = "com/olivergg/html"

To start development :

sbt 
~fastOptJS

To compile scala files in the html package (htmlScalaSourceDir) to HTML files :

compileHtmlDevTask

during development or

compileHtmlProdTask

for production.

Note : since ScalaTags is only a dependency of the app-jvm project, you can't put HtmlCompilable objects in the shared project, unless you add ScalaTags as a dependency of the app-js project as well

then, to run the app in the browser, you can use ionic built-in command

cd ionic
ionic serve

(see http://ionicframework.com/docs/guide/testing.html)

To create the fully optimized javascript version of the application (and to remove developement files (fastopt js, source maps, etc.)) :

dist

dist is just an alias to ";cleanOutputJS ;packageJSDependencies ;packageScalaJSLauncher ;compileHtmlProdTask ;fullOptJS"

Then, you can use :

ionic run

to launch the application on a connected device

TODO

FIXME