Monday, June 17, 2013

JikamuJS is being develop using Coffeescript, and requires jQuery and jQuery.address for the URL Routing.

The main inspiration of this simple application is DavisJS which currently support HTML5 browsers. DavisJS is a router application that use HTML5 history.pushState.

With the help of jQuery.address url routing api, JikamuJS will target not only new browser but also older browsers(I'm talking to you Internet Explorer).

JikamuJS' Goal

JikamuJS was built with the help of great JS and Jquery plugins like jQuery Address and DavisJS.


So what's the puss with this very simple js app?

Well if your familiar with Backbone then go Backbone. JikamuJS is not built to replace those capable JS framework but this simple app is capable of building simple apps to a bigger one and it will support IE6 up to latest.

Requirements

JikamuJS requires jQuery 1.7.2+ and the latest jQuery Address. You can download the latest JikamuJS here at github.

Usage

Using JikamuJS is very simple , pull out the Route class and supply URL Path, Controller Before Load and After load callbacks.

Adding a new Route with your page

new Jikamu.Route()
    .urlpath('/blog')
    .page(
        {
            page_name: "Blog Page",
            controller: function(){
                $("#container").html('Blog Page');
            },
            before_load:function(){
                console.log('Before loading Blog page');
            },
            after_load:function(){
                console.log('After loading blog page');
            }
        }
    )
    .save();

Starting your App


new Jikamu();

Accessing URL parameters


Checkout jQuery Address API and references here http://www.asual.com/jquery/address/

Future Plans

Unit tests
Separate files and classes
Documentation
Add more features

Wednesday, June 5, 2013

So it is almost decided now, we are doing our back office application with ExtJS (Thanks to my colleague who suggested it). After doing some research, I found out that ExtJS is one hell of framework that will surely boost our development.

But the thing is we never encountered ExtJS on our development life cycle and good thing is we are capable JavaScript programmer.

Today I will be taking my first step on Sencha ExtJS and I hope it will be easy for me to comprehend everything but I know it will not be very easy because ExtJS has its own convention.

Goodluck for me... And expect a day to day blog and status of my ExtJS development.

First I want to scold myself, I should spend at least an hour to check out Coffeescript. I have been skipping articles regarding Coffeescript in NetTuts and missed ManilaJS session last few months ago where the speaker is the maker of Backbone.js and Coffeescript, the Jeremy Ashkenas.

After a week now, I'm happy to see myself improving a lot on Javascript with the help of Coffeescript. It is time consuming to describe each benefits of Coffeescript because this is so awesome in so many ways.

If ever you decided to spend at least 30 mins of your time with Coffeescript then it's a good choice.



Everything start in Coffeescript Official website

Visit the site! There's a console for you to try Coffeescript on your browser.

Semi-colons will miss our gentle touch

If your a Ruby person then you might find Javascript a bit tedious on adding semi colons on every command or line you made. But that's okay, I'm a PHP developer and I survived it.

In Coffeescript, the semi-colon button will miss our touch since most of the convention doesn't require it.

Fuck Global variables!

Messing up the global variables in Javascript is a pain in the ass and it will be real pain the ass for maintaining your code base. But don't worry we will still access or write global but it will be much safer and easier on Coffeescript.

A better OOP 

I'm not saying Javascript is not good language for OOP but with Coffeescript it will give us more understandable way of creating Class and instantiating it.

class Animal

The code above will create an class name Animal which can also be extended on this approach

class Dog extends Animal

I know this is a very short take on how awesome Coffeescript is but this pieces change how I wrote code on Javascript. On my experience, Javascript has a big chance of getting a spaghetti code if not careful watched but having a more readable code your colleague can easily dive in to your chocolate mud playground.

So try it!