Testing and documentation

60 views
Skip to first unread message

James

unread,
Aug 7, 2012, 12:09:31 AM8/7/12
to kern...@googlegroups.com
Hi Alan

I have been taking a look at your framework after reading up on Zakas' techniques and I really like what you have done.  I saw on github you were getting round to updating the docs, but from what I can see, a lot still is based on a previous version of the framework.  Any more progress on this?

I'm also interested in some form of automated testing.  Do you have any suggestions for this?  I am not super proficient in javascript so I am stuggling a bit on how to best to test things, especially given it is largely message oriented.  I am thinking spy's are the go, but having little experience in them, I'm looking for a push.  Any examples? 

Thanks very much
James


alan lindsay

unread,
Aug 8, 2012, 12:05:47 PM8/8/12
to kern...@googlegroups.com
James,

Sorry for the late reply. I am quite busy at the moment so the docs are on hold. However, I do respond to specific questions so feel free to ask. Also, there are other projects that make use of Zakas's technique that have significantly more documentation than I do. You might want to check them out:


I have used Kernel on multiple commercial projects but in each case I have written different extensions because it is so low level. I am considering making it slightly more opinionated and shipping it with some default extensions like backbone, jquery, etc. in order to help people get off the ground easily. Currently the extensions I am using are quite helpful but I just haven't had time to properly update the docs (which requires an overhaul of examples). That said, Kernel is headed in the direction of backbone aura and I do use it actively so development will continue.

Alan

James Kelly

unread,
Aug 9, 2012, 1:47:14 AM8/9/12
to kern...@googlegroups.com
Hi Alan

Thanks for getting back to me.

I found kernel.js through that stackoverflow thread you mention.

I'm happy that it's very flexible at the moment, it's small and easy to understand, and I particularly like the messaging you have used.  My problem with projects like Backbone-aura and the others in that thread is that not only do I have to work out the concepts, but also the other framework choices which I am not all that familiar with.  Kernel.js doesn't make any of these, if I want to switch out jquery, then I can easily.  If I can't be bothered using templating the client, then I don't have to.  I really like the syntax in Kernel.js, more so than the other projects.  For me, even if development didn't continue, I feel that it is at a stage where I can find it very useful. The documentation and examples are good, exactly what I needed, just would have been handy to have everything just work.  There was enough there to get moving though.  No criticism of you here, I can understand docs are low priority for opensource projects when your busy doing work to pay the bills.

To save you work, is there a possibility of getting the docs up on github so I can help update it? 

Thanks again

James

alan lindsay

unread,
Aug 9, 2012, 12:09:22 PM8/9/12
to kern...@googlegroups.com
Thanks for the compliments. Ok, you convinced me to translate the docs I have on my site into github so that others can work on them. 

Kernel will remain flexible but I will eventually include a set of stock (but optional) extensions that are opinionated. As far as liking the syntax goes... after I put the docs in github with some updates let me know if that is still the case. Not a lot has changed but there was a fundamental shift from the function declaration style to object literal style. So:

Kernel.module.define('MyModule', function(hub) { ... });

has become:

Kernel.module.define('MyModule', { ... });   // hub accessible via 'this.hub'

It means your module definitions have a different format, some people like it, others do not. In the end I made the switch to allow for easier module extension. I will update the docs accordingly as I move them to github.

Alan 

James Kelly

unread,
Aug 9, 2012, 8:20:04 PM8/9/12
to kern...@googlegroups.com
That would be great to get the documents editable.  I'm happy to help where I can.

As for the change in the style, I had worked that out, as I have already built a large portion of a private site using the most recent version. Considering I never used the function declaration style, my position hasn't changed ;)

The paradigm shift to using messaging for communication between modules has got me really excited.  I have struggled with js front ends for a long time, always tying everything to the DOM using jquery and ending up with massive messes of unmaintainable code.  I have looked at things like backbone and knockout to fix it up, but I have always felt I was writing the same code over and over while being too tightly coupled to the frameworks.  Using Kernel now, I feel a lot more freedom, just broadcast and listen (which by the way, I like the term better than pub / sub, I have a fundamental mind block over that term).  I haven't even begun to extend my Kernel much, but at least now I feel that I can get the app built roughly first up, then move the duplication / coupling off into extensions when I see fit and start to reuse a lot more code.

I look forward to the updates, and seeing where kernel goes!

James

alan lindsay

unread,
Aug 10, 2012, 4:18:59 PM8/10/12
to kern...@googlegroups.com
James,

I updated the docs to correctly reflect the current version of Kernel. Note that I didn't put elaborate examples in place, just refreshed what was already there and added some new docs. Everything is now in github as well so feel free to fork, edit and make pull requests.


(You may need to refresh the page if your browser has a cached version.)

Alan

James Kelly

unread,
Aug 13, 2012, 12:13:16 AM8/13/12
to kern...@googlegroups.com
Thanks very much Alan, most appreciated.
Reply all
Reply to author
Forward
0 new messages