Code Monkey home page Code Monkey logo

magnatronus.star-demo-es6's Introduction

star-demo-es6

Introduction

This is a test/demo Titanium project designed to run on iOS and Android and based on the free Star Wars API (SWAPI). The App is written in Titanium using ES6, Promises and a custom framework I have called Erbium.

I am looking at using ES6 for Titanium development and really needed the focus of a tangible app to do anything meaningful. As I also wanted to put Promises into the app, I searched the internet and found this excellent article by Adam Paxton on Promises in Titanium (http://adampaxton.com/using-javascript-promises-in-appcelerator-titanium/). Which gave me some great info and the idea to base my investigations around the same API.

What is here

I have include all the source code (which resides under the src dir) except for the code in the src/system directory, the reason for this is that it is still VERY much WIP, and a bit untidy. Bt the files that current sit in src/system are:

  • backbone.js - used at the moment for my Global Event Dispatcher
  • underscore.js - included as backbone needs it (this is excluded from the babel transpile as it screws it up)
  • promises.core.min.js - the bluebird core lib (as detailed in Adam's article)
  • erbium.js - my 'untidy' code with a basic way of launching an app, the Global Dispatcher and a simple base Component class

Build overview

I have various npm scripts in the package.json that I am experimenting with, but basically my current build steps are:

  • npm run copy-assets (only when they change)
  • npm run build-app ( this transpiles into the Resources dir)

then I use the command line to run/build the actual app (i.e. Ti build )

I started the app off by creating a default classic project, added the package.json and then ran npm install.

Why

Because it's fun, I like a challenge and I get to learn an great deal about using ES6. I have also found out that some things when transpiled work on iOS but not on Android. This mainly seems based around defining exports, but it is also the reason I copy underscore.js in it's vanilla format, the transpiled version worked in iOS but threw an exception under Android.

Also Tried

I did have a version that attempted to use the React.createElement and the JSX plug-in ( I think it kinda neat the way you can use JSX to define UI). I did have some success, but it got a bit complicated so I parked it as I think it requires a JSX for Titanium developing to really work. Hence in my Component class I have a generateView() function that sort of replaces the render() function in React (but not quite).

App availablility

I am currently going to try and release a version of the app into iTunes and the Google play store....

magnatronus.star-demo-es6's People

Contributors

magnatronus avatar

Watchers

James Cloos avatar Brenton House avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.