Wednesday, April 14, 2010

Introducing Yabble!

A few months ago I started working with Node.js, and by extension, CommonJS. Since then I've become fascinated with the goals of CommonJS and wanted to get involved. CommonJS is mostly suited for the server-side environment, but it does not exclude browsers. There are even a number of frameworks/libraries out there using it in the browser space such as SproutCore, Narwhal, and RequireJS. However, these don't really fullfill the need for a simple, barebones CommonJS module loader for the browser. SproutCore and Narwhal are great, and come with a ton of goodies, but oftentimes all of those goodies are not needed. RequireJS fits more closely with my goals, but still doesn't quite fill the niche that I'm after. Enter Yabble.

Yabble is a general purpose browser-side CommonJS module loader. The goals are to be small, flexible and useful. There are numerous places where, when two paths exist, both were made available instead of choosing one.

XHR vs script tags

Many argue that using script tags for dynamic Javascript injection is preferable over XHR. I tend to agree. Script tags are usually easier to debug and support fetching cross-domain. However, in the CommonJS world, that means that the modules need to be wrapped in some boilerplate code (named a Transport). Since no server-side CommonJS module loader requires this wrapping, it is a pretty big disconnect between modules meant for the server-side and those meant for the browser. Ideally, a single module could be supported on both. With XHR and eval(), it is possible to retrieve the raw module code and "wrap" it on-the-fly. It is also harder to debug and doesn't often support cross-domain requests. So, Yabble supports both. The XHR and eval() method is the default one and I envision its use mostly for quick-and-dirty development efforts. The script tag method can always be used if the developer prefers and when the application is deployed to production.

Hand-wrapped vs auto-wrapped modules

It is possible for modules to be automatically wrapped in a Transport through a build process or some other means. However, some argue that hand-wrapping is the best way to go. I tend to disagree, but, there is nothing stopping anyone from hand-wrapping modules with the use of Yabble. For automatically wrapping, a build-time tool is included to analyze modules and wrap them. Another method is to use a server-side script to wrap and serve modules on demand.

Individual file loading vs packaged file loading

This isn't really a debate. In general, individual file loading is used during development and for deployment a single, packaged file is created to reduce the number of requests. Yabble supports multiple modules being defined in a single file without any additional instructions. In addition, file packaging support for the tooling is on the roadmap.


It is my sincere hope that many find this project useful in creating well-structured web applications. The more people jumping on the CommonJS bandwagon, the better.

For more information and to get the code, visit the project page.
To see it running live, visit the unit tests.

13 comments:

  1. patriots jerseys, http://www.newenglandpatriotsjerseys.us/
    saints jerseys, http://www.neworleanssaintsjerseys.us/
    fitflop, http://www.fitflop.in.net/
    karen millen uk, http://www.karenmillendressesoutlets.co.uk/
    air jordan 11 free shipping, http://www.airjordan11.net/
    hollister canada, http://www.hollistercanada.com/
    hollister uk, http://www.hollistershirts.co.uk/
    tods outlet, http://www.todsoutlet.us.com/
    air jordan 4 free shipping, http://www.airjordan4.org/
    pandora jewelry, http://www.pandora.eu.com/
    coach outlet online, http://www.coachoutletstores.com.co/
    tiffany and co, http://www.tiffanyandco.in.net/
    prada outlet, http://www.pradaoutlet.us/
    ravens jerseys, http://www.baltimoreravensjerseys.us/
    supra shoes, http://www.suprashoes.us.com/
    hogan,hogan outlet,scarpe hogan,hogan sito ufficiale,hogan interactive
    michael kors outlet, http://michaelkors.outletonlinestores.us.com/
    juicy couture tracksuit, http://www.juicycoutureoutlet.net/
    chicago bulls, http://www.chicagobullsjerseys.net/
    jets jersey, http://www.newyorkjetsjersey.us/
    cai2015912

    ReplyDelete
  2. Stuart Weitzman 5050 UK A good aspect of theStuart Weitzman 5050 UK organization is the knowledge they have got about shoe stuart weitzman boots construction. These people get it that Stuart Weitzman 5050 it is not only about how exactly the shoes Stuart Weitzman Snow Boots performs, however making Stuart Weitzman 5050 sure it looks quite on the feet Stuart Weitzman Boots Sale Since its beginning three Stuart Weitzman 5050 Canada decades ago, it has been their own mission Stuart Weitzman Boots to manufacture this particular ideal. The Stuart Weitzman 5050 Stuart Weitzman shoes collection has gained a significant large following Stuart Weitzman 5050 because of this. From The USA stuart weitzman Shoes to Japan, and everywhere in Stuart Weitzman Shoes between, they have taken the fashion 5050 boots sale world by storm and have thousands Stuart weitzman boots of satisfied customers to prove it.
    If you are a boot fanatic Stuart weitzman boots like me, then you should Stuart Weitzman 5050 definitely take a look at their new boots Stuart Weitzman 5050 Canada called the Schrinchables. They are a very cute style that provides a Stuart weitzman canada very comfy fit for your feet. You will Over The Knee Boots definitely make a fashion statement in these Black Over The Knee Boots boots that will garner many Over The Knee Black Boots compliments.
    An adaptable boot, Stuart Weitzman 5050 they are a stylish winter boot Stuart Weitzman Boots that will take your cold weather wardrobe Stuart Weitzman 5050 Over The Knee Boot to a whole new level. You can stuart weitzman sale wear them in several different stuart weitzman sale forms to accompany

    ReplyDelete
  3. 威哥王:http://www.akanpo.net/
    女性媚薬:http://xn--19zl5rhf.akanpo.net/
    紅蜘蛛:http://xn--19zl5rhf.akanpo.net/
    花痴:http://www.xn--6qs44kv2wxulv8l.com/
    巨人倍増:http://www.xn--gmq15an1qquf7nnhnq.net/
    威哥王:http://www.akanpo.net/product/299.html
    威哥王:http://www.xn--y5q18fdwfi85apu0a.com/
    女性用精力剤:http://www.xn--o0q550b5sivv6a3ud.com/
    催淫剤:http://www.xn--o0q550b5sivv6a3ud.com/
    催淫薬:http://www.xn--o0q550b5sivv6a3ud.com/
    中絶薬:http://www.xn--fiqs66igff.net/
    五夜神:http://www.xn--dlqq0x36z.com/
    三便宝:http://www.xn--ehqp5bbzdjgv52b5n2c.com/
    蟻力神:http://www.xn--tfry51gvxj8qe33e.com/
    三体牛鞭:http://www.xn--ehq44ay28e5g5a.net/
    三體牛鞭:http://www.xn--ehq44ay28e5g5a.net/
    勃動力三體牛鞭:http://www.xn--ehq44ay28e5g5a.net/
    五便宝:http://www.xn--dlq51ag0z.com/
    狼一号:http://www.xn--4gq48lvu4a.net/
    狼1号:http://www.xn--4gq48lvu4a.net/
    ビグレックス:http://www.xn--pckb2a1b0esh.com/
    VigRx:http://www.xn--pckb2a1b0esh.com/
    徳国黒金:http://www.xn--vcsp6r0y7bp4k.net/
    蔵秘男宝:http://www.xn--pbtr90dtidpyo.com/
    中華牛鞭:http://www.xn--fiqx59fy7lwts.net/
    蔵秘雄精:http://www.xn--tmz82dyzk01s.com/
    蔵秘男宝:http://www.xn--pbtr90dtidpyo.net/
    男宝:http://www.xn--pbtr90d.net/
    ナンパオ:http://www.xn--pbtr90d.net/
    好漢哥:http://www.xn--kwrt0i78w.com/
    三鞭粒:http://www.xn--ehq774i08q.com/
    魔根:http://www.xn--xxvo15i.com/
    壮三天:http://www.xn--ehq78xdf.com/

    媚薬通販:http://www.akanpo.net/catalog/60.html
    催淫カプセル:http://www.akanpo.net/product/339.html
    淫インモラル:http://www.akanpo.net/product/477.html
    花痴:http://www.akanpo.net/product/325.html
    花痴:http://www.akanpo.net/product/109.html
    紅蜘蛛:http://www.akanpo.net/product/110.html
    妖姫:http://www.akanpo.net/product/476.html
    D10媚薬:http://www.akanpo.net/product/315.html
    D10催情剤:http://www.akanpo.net/product/315.html
    催情剤:http://www.akanpo.net/product/315.html
    D8 催情剤:http://www.akanpo.net/product/81.html
    絶對高潮:http://www.akanpo.net/product/339.html
    FLY D5:http://www.akanpo.net/product/102.html
    蒼蝿水:http://www.akanpo.net/product/102.html
    D5原液:http://www.akanpo.net/product/102.html
    レディーチャイナ:http://www.akanpo.net/product/102.html
    催情丹:http://www.akanpo.net/product/443.html
    天天素:http://www.akanpo.net/product/251.html
    韓国痩身一号:http://www.akanpo.net/product/208.html
    韓国痩身1号:http://www.akanpo.net/product/208.html
    痩身1号:http://www.akanpo.net/product/208.html
    巨人倍増:http://www.akanpo.net/product/36.html
    三便宝:http://www.akanpo.net/product/233.html
    蟻力神:http://www.akanpo.net/product/154.html
    蟻力神(第五代):http://www.akanpo.net/product/86.html
    三體牛鞭:http://www.akanpo.net/product/91.html
    勃動力三體牛鞭:http://www.akanpo.net/product/91.html
    三体牛鞭:http://www.akanpo.net/product/91.html
    中華牛鞭:http://www.akanpo.net/product/134.html
    RU486:http://www.akanpo.net/product/232.html
    MaxMan:http://www.akanpo.net/product/246.html
    蔵八宝:http://www.akanpo.net/product/449.html
    新一粒神:http://www.akanpo.net/product/448.html
    五便宝:http://www.akanpo.net/product/381.html
    狼一号:http://www.akanpo.net/product/92.html
    狼1号:http://www.akanpo.net/product/92.html
    黒倍王:http://www.akanpo.net/product/85.html
    アフリカ超人:http://www.akanpo.net/product/569.html
    徳国公牛:http://www.akanpo.net/product/658.html
    壮根精華素:http://www.akanpo.net/product/130.html
    街頭覇王睾丸素:http://www.akanpo.net/product/653.html
    精力剤:http://www.akanpo.net/catalog/1.html
    漢方薬:http://www.akanpo.net/catalog/2.html
    中絶 薬:http://www.akanpo.net/catalog/3.html
    経口避妊薬:http://www.akanpo.net/catalog/3.html
    催淫剤:http://www.akanpo.net/catalog/63.html
    催情薬:http://www.akanpo.net/catalog/63.html
    女性用媚薬:http://www.akanpo.net/catalog/60.html
    女性用精力剤:http://www.akanpo.net/catalog/60.html
    ペニス増大:http://www.akanpo.net/catalog/13.html

    ReplyDelete
  4. 精力剤販売:http://www.hakanpo.com/
    威哥王:http://www.hakanpo.com/p/pro96.html
    巨人倍増:http://www.hakanpo.com/p/pro138.html
    三體牛鞭:http://www.hakanpo.com/p/pro331.html
    勃動力三體牛鞭:http://www.hakanpo.com/p/pro331.html
    三体牛鞭:http://www.hakanpo.com/p/pro331.html
    狼1号:http://www.hakanpo.com/p/pro330.html
    狼一号:http://www.hakanpo.com/p/pro330.html
    三便宝:http://www.hakanpo.com/p/pro149.html
    五便宝:http://www.hakanpo.com/p/pro157.html
    蟻力神:http://www.hakanpo.com/p/pro132.html
    蟻力神(第五代):http://www.hakanpo.com/p/pro336.html
    新一粒神:http://www.hakanpo.com/p/pro476.html
    男宝:http://www.hakanpo.com/p/pro375.html
    魔根:http://www.hakanpo.com/p/pro360.html
    壮天根:http://www.hakanpo.com/p/pro329.html
    花痴:http://www.hakanpo.com/p/pro312.html
    妖姫:http://www.hakanpo.com/p/pro481.html
    絶對高潮:http://www.hakanpo.com/p/pro274.html
    D10媚薬:http://www.hakanpo.com/p/pro282.html
    D10催情剤:http://www.hakanpo.com/p/pro282.html
    淫インモラル:http://www.hakanpo.com/p/pro482.html
    紅蜘蛛:http://www.hakanpo.com/p/pro311.html
    紅蜘蛛:http://xn--19zl5rhf.hakanpo.com/
    福源春:http://hakanpo.com/p/pro372.html
    天天素:http://www.hakanpo.com/p/pro58.html
    曲美:http://www.hakanpo.com/p/pro25.html
    催淫カプセル:http://www.hakanpo.com/p/pro133.html
    三鞭粒:http://www.hakanpo.com/p/pro450.html
    黒倍王:http://www.hakanpo.com/p/pro337.html
    VigRx:http://www.hakanpo.com/p/pro222.html
    RU486:http://www.hakanpo.com/p/pro113.html
    MaxMan:http://www.hakanpo.com/p/pro97.html
    中華牛鞭:http://www.hakanpo.com/p/pro167.html
    D8 催情剤:http://www.hakanpo.com/p/pro343.html
    FLY D5:http://www.hakanpo.com/p/pro318.html
    D5原液:http://www.hakanpo.com/p/pro318.html
    蒼蝿水:http://www.hakanpo.com/p/pro318.html
    花之欲:http://www.hakanpo.com/p/pro292.html
    美人豹:http://www.hakanpo.com/p/pro320.html
    韓国痩身一号:http://hakanpo.com/p/pro20.html
    韓国痩身1号:http://hakanpo.com/p/pro20.html
    痩身一号:http://hakanpo.com/p/pro20.html
    痩身1号:http://hakanpo.com/p/pro20.html
    V26:http://www.hakanpo.com/p/pro48.html
    催情剤:http://www.hakanpo.com/p/pro282.html
    催情粉:http://www.hakanpo.com/p/pro288.html
    女性催情剤:http://www.hakanpo.com/CL05
    催情薬:http://www.hakanpo.com/p/pro159.html
    催淫:http://www.hakanpo.com/p/pro133.html
    催淫通販:http://www.hakanpo.com/p/pro133.html
    西班牙昆虫粉:http://www.hakanpo.com/p/pro316.html

    ReplyDelete
  5. 精力剤:http://www.feelkanpo.com/
    威哥王:http://xn--kwrt2jp9z.feelkanpo.com/
    威哥王:http://www.feelkanpo.com/view/415.html
    三體牛鞭:http://www.feelkanpo.com/view/812.html
    勃動力三體牛鞭:http://www.feelkanpo.com/view/812.html
    三体牛鞭:http://www.feelkanpo.com/view/812.html
    三便宝:http://www.feelkanpo.com/view/823.html
    男宝:http://www.feelkanpo.com/view/634.html
    五便宝:http://www.feelkanpo.com/view/797.html
    巨人倍増:http://www.feelkanpo.com/view/427.html
    狼1号:http://www.feelkanpo.com/view/501.html
    狼一号:http://www.feelkanpo.com/view/501.html
    蟻力神:http://www.feelkanpo.com/view/604.html
    蟻力神(第五代):http://www.feelkanpo.com/view/785.html
    新一粒神:http://www.feelkanpo.com/view/821.html
    蔵八宝:http://www.feelkanpo.com/view/820.html
    黒倍王:http://www.feelkanpo.com/view/575.html
    ru486:http://www.feelkanpo.com/view/407.html
    中絶薬RU486:http://www.feelkanpo.com/view/407.html
    縮陰膏:http://www.feelkanpo.com/view/636.html
    天天素:http://www.feelkanpo.com/view/573.html
    V26:http://www.feelkanpo.com/view/566.html
    曲美:http://www.feelkanpo.com/view/847.html
    福源春:http://www.feelkanpo.com/view/798.html
    紅蜘蛛:http://www.feelkanpo.com/view/473.html
    花痴:http://www.feelkanpo.com/view/593.html
    妖姫:http://www.feelkanpo.com/view/851.html
    淫インモラル:http://www.feelkanpo.com/view/849.html
    D10 媚薬:http://www.feelkanpo.com/view/479.html
    D10催情剤:http://www.feelkanpo.com/view/479.html
    絶對高潮:http://www.feelkanpo.com/view/561.html
    精力剤:http://www.feelkanpo.com/energy/default.html
    漢方薬:http://www.feelkanpo.com/kanpou/default.html
    媚薬:http://www.feelkanpo.com/jyosei/default.html
    プロコミルスプレー:http://www.feelkanpo.com/view/732.html
    VigRx:http://www.feelkanpo.com/view/460.html
    韓国痩身一号:http://www.feelkanpo.com/view/491.html
    痩身一号:http://www.feelkanpo.com/view/491.html
    夜夜堅:http://www.feelkanpo.com/view/751.html
    VVK(Wenickman):http://www.feelkanpo.com/view/459.html
    壮天根:http://www.feelkanpo.com/view/431.html
    魔根:http://www.feelkanpo.com/view/806.html

    ReplyDelete
  6. 漢方会社:http://www.kanpocom.com/
    威哥王:http://xn--kwrt2jp9z.kanpocom.com/
    威哥王:http://www.kanpocom.com/Pro/weigewang.html
    巨人倍増:http://www.kanpocom.com/pro/jurenbeiceng.html
    紅蜘蛛:http://www.kanpocom.com/Pro/hong-zhi-zhu.html
    花痴:http://www.kanpocom.com/Pro/huachi.html
    D10催情剤:http://www.kanpocom.com/pro/D10.html
    絶對高潮:http://www.kanpocom.com/Pro/juedui.html
    三便宝:http://www.kanpocom.com/pro/satibo-capsules.html
    三體牛鞭:http://www.kanpocom.com/Pro/stlb.html
    勃動力三體牛鞭:http://www.kanpocom.com/pro/stlb.html
    三体牛鞭:http://www.kanpocom.com/Pro/stlb.html
    蟻力神:http://www.kanpocom.com/pro/yilishen.html
    五便宝:http://www.kanpocom.com/Pro/wodibo-capsules.html
    狼一号:http://www.kanpocom.com/Pro/langyihao.html
    狼1号:http://www.kanpocom.com/Pro/langyihao.html
    RU486:http://www.kanpocom.com/pro/beijing-ru486.html
    消渇丸:http://www.kanpocom.com/Pro/xiaokewan.html
    天天素:http://www.kanpocom.com/pro/tiantiansu.html
    V26:http://www.kanpocom.com/Pro/V26sx.html
    韓国痩身1号:http://www.kanpocom.com/Pro/hgshs.html
    韓国痩身一号:http://www.kanpocom.com/Pro/hgshs.html
    媚薬 販売:http://www.allkanpou.com/
    花痴:http://www.xn--6qs44kv2wxulv8l.com/
    淫インモラル:http://www.allkanpou.com/product/immoral.html
    花痴:http://www.allkanpou.com/product/%E8%8A%B1%E7%97%B4.html
    威哥王:http://www.allkanpou.com/product/%E5%A8%81%E5%93%A5%E7%8E%8B.html
    巨人倍増:http://www.allkanpou.com/product/%E5%B7%A8%E4%BA%BA%E5%80%8D%E5%A2%97.html
    催情丹:http://www.allkanpou.com/product/cuiqingj.html
    媚薬:http://www.allkanpou.com/biyaku/%E5%AA%9A%E8%96%AC.html
    媚薬通販:http://www.allkanpou.com/biyaku/%E5%AA%9A%E8%96%AC.html
    女性媚薬:http://www.allkanpou.com/biyaku/%E5%A5%B3%E6%80%A7%E5%AA%9A%E8%96%AC.html
    媚薬激安:http://www.allkanpou.com/biyaku/%E5%A5%B3%E6%80%A7%E5%AA%9A%E8%96%AC.html
    媚薬カプセル:http://www.allkanpou.com/biyaku/%E5%AA%9A%E8%96%AC%E5%82%AC%E6%B7%AB.html
    巨人倍増:http://www.xn--tckuez55h0fbkxjnoie3j.com/
    妊娠中絶薬:http://www.xn--fiqv0z4mai18ikui.com/
    プロコミルスプレー:http://www.xn--tckm2gc2b7djc5l.com/
    催情薬:http://www.xn--o0q550b.net/
    レビトラ:http://www.xn--fdkva1ej2834bwg0a.com/
    淫インモラル:http://immoral.yahookanpou.com/
    妖姫:http://xn--vvsqh.yahookanpou.com/
    精力剤:http://www.yahookanpou.com/
    d10媚薬:http://www.xn--d10-hl9e441q.com/
    韓国痩身一号:http://www.xn--4gq48lkwcy40cp4z0ql.com/
    蒼蝿粉:http://www.xn--i6zw1ov9b.com/
    催情丹:http://www.xn--riq92di5x.com/
    絶對高潮:http://www.xn--wetw46b3hk0yo36dn8t.com/
    媚薬カプセル:http://www.yahookanpou.com/catalog/60.html
    女性用媚薬:http://www.yahookanpou.com/catalog/60.html
    威哥王:http://www.yahookanpou.com/product/weigwang.html
    巨人倍増:http://www.yahookanpou.com/product/jurenbeizenggouqi.html
    三便宝:http://www.yahookanpou.com/product/sbb.html
    壮根精華素:http://www.yahookanpou.com/product/zgjhs.html
    韓国痩身一号:http://www.yahookanpou.com/product/hgssyhmtx.html
    韓国痩身1号:http://www.yahookanpou.com/product/hgssyhmtx.html

    ReplyDelete
  7. Thanks for the valuable feedback. I think that strategy is sound and can be easily replicable.Great posts. I love this article. We are Beyond Broking, a Perth based boutique Mortgage rates comparison service helping Australian's obtain loans for some of life's biggest purchases.

    ReplyDelete