├── .gitattributes ├── css └── app.css ├── .gitignore ├── package.json ├── .editorconfig ├── index.html ├── readme.md ├── src └── app.imba ├── js └── app.js └── imba.min.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /css/app.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | app-template.css overrides 4 | 5 | remove this comment if used 6 | remove this file if not 7 | 8 | */ 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/todomvc-app-css/* 2 | !node_modules/todomvc-app-css/index.css 3 | 4 | node_modules/todomvc-common/* 5 | !node_modules/todomvc-common/base.js 6 | !node_modules/todomvc-common/base.css 7 | 8 | node_modules/imba/* 9 | !node_modules/imba/imba.min.js 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "build": "imba compile src/ -o js/", 5 | "watch": "imba watch src/ -o js/" 6 | }, 7 | "dependencies": { 8 | "imba": "^0.14.2", 9 | "todomvc-app-css": "^2.0.0", 10 | "todomvc-common": "^1.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [package.json] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Imba • TodoMVC 6 | 7 | 8 | 9 | 10 | 11 |
12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Imba • [TodoMVC](http://todomvc.com) 2 | 3 | > Create complex web apps with ease! Imba is a new programming language for the web that compiles to highly performant and readable JavaScript. It has language level support for defining, extending, subclassing, instantiating and rendering dom nodes. 4 | 5 | ## Resources 6 | 7 | - [Website](http://imba.io) 8 | - [Documentation](http://imba.io/guides/language) 9 | - [Blog](http://imba.io/blog) 10 | 11 | ### Support 12 | 13 | - [Chat](https://gitter.im/somebee/imba) 14 | - [GitHub](https://github.com/somebee/imba) 15 | - [StackOverflow](http://stackoverflow.com/questions/tagged/imba) 16 | - [Twitter](http://twitter.com/imbajs) 17 | 18 | *Let us [know](https://github.com/somebee/todomvc-imba/issues) if you discover anything worth sharing.* 19 | 20 | ## Running 21 | 22 | 1. Run `npm install` 23 | 2. Open `index.html` in your browser to see it in action! 24 | 25 | ## Development 26 | 27 | The source resides in `src/app.imba`. Run `npm run watch` to recompile the source locally. Make sure you have installed Imba through npm: `npm install -g imba` first. 28 | 29 | ## Credit 30 | 31 | Created by [Sindre Aarsaether](http://github.com/somebee) -------------------------------------------------------------------------------- /src/app.imba: -------------------------------------------------------------------------------- 1 | 2 | var ESCAPE_KEY = 27 3 | var ENTER_KEY = 13 4 | 5 | # Define a simple class for our data objects 6 | class Todo 7 | 8 | var id = 0 9 | 10 | prop title 11 | prop completed 12 | 13 | def initialize title, completed = no 14 | @id = id++ 15 | @title = title 16 | @completed = completed 17 | 18 | def id 19 | @id 20 | 21 | def toJSON 22 | {title: title, completed: completed} 23 | 24 | 25 | # custom tag type for todo that inherits from li 26 | tag todo < li 27 | 28 | def render 29 | 30 | 31 |