Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #877 from add0n/develop-yaf

sync up
  • Loading branch information...
commit 56df54ee0fc5bcd0d8595cabcbacafac75fb551b 2 parents f44aa7d + 83966df
@isao isao authored
Showing with 1,457 additions and 1,277 deletions.
  1. +183 −42 DEPRECATIONS.md
  2. +1 −1  LICENSE.txt
  3. +1 −1  bin/mojito
  4. +1 −1  docs/dev_guide/code_exs/simple_logging.rst
  5. +11 −11 docs/dev_guide/code_exs/yui_modules.rst
  6. +160 −122 docs/dev_guide/faq/index.rst
  7. +13 −13 docs/dev_guide/intro/mojito_apps.rst
  8. +71 −42 docs/dev_guide/intro/mojito_configuring.rst
  9. +29 −25 docs/dev_guide/intro/mojito_mvc.rst
  10. +0 −7 docs/dev_guide/reference/glossary.rst
  11. +4 −4 docs/dev_guide/reference/mojito_troubleshooting.rst
  12. +4 −4 docs/dev_guide/topics/mojito_assets.rst
  13. +43 −73 docs/dev_guide/topics/mojito_extensions.rst
  14. +0 −5 docs/dev_guide/topics/mojito_frame_mojits.rst
  15. +5 −5 docs/dev_guide/topics/mojito_hosting_container_reqs.rst
  16. +35 −37 docs/dev_guide/topics/mojito_logging.rst
  17. +1 −1  docs/dev_guide/topics/mojito_resource_store.rst
  18. +2 −2 docs/dev_guide/topics/mojito_testing.rst
  19. +1 −1  examples/developer-guide/adding_view_engines/index.js
  20. +1 −1  examples/developer-guide/adding_view_engines/server.js
  21. +1 −1  examples/developer-guide/binding_events/index.js
  22. +1 −1  examples/developer-guide/binding_events/mojits/PagerMojit/binders/index.js
  23. +1 −1  examples/developer-guide/binding_events/mojits/PagerMojit/controller.server.js
  24. +1 −1  examples/developer-guide/binding_events/mojits/PagerMojit/models/model.server.js
  25. +1 −1  examples/developer-guide/binding_events/server.js
  26. +1 −1  examples/developer-guide/configure_routing/index.js
  27. +1 −1  examples/developer-guide/configure_routing/mojits/RoutingMojit/controller.server.js
  28. +1 −1  examples/developer-guide/configure_routing/mojits/RoutingMojit/models/model.server.js
  29. +1 −1  examples/developer-guide/configure_routing/server.js
  30. +1 −1  examples/developer-guide/device_assets/index.js
  31. +1 −1  examples/developer-guide/device_assets/mojits/device/controller.server.js
  32. +1 −1  examples/developer-guide/device_assets/server.js
  33. +1 −1  examples/developer-guide/device_views/index.js
  34. +1 −1  examples/developer-guide/device_views/mojits/device/binders/index.js
  35. +1 −1  examples/developer-guide/device_views/mojits/device/controller.server.js
  36. +1 −1  examples/developer-guide/device_views/mojits/device/models/model.server.js
  37. +1 −1  examples/developer-guide/device_views/server.js
  38. +1 −1  examples/developer-guide/framed_assets/index.js
  39. +1 −1  examples/developer-guide/framed_assets/mojits/framed/binders/index.js
  40. +1 −1  examples/developer-guide/framed_assets/mojits/framed/controller.server.js
  41. +1 −1  examples/developer-guide/framed_assets/mojits/framed/models/model.server.js
  42. +1 −1  examples/developer-guide/framed_assets/server.js
  43. +1 −1  examples/developer-guide/framed_config/index.js
  44. +1 −1  examples/developer-guide/framed_config/mojits/MainMojit/binders/binder.js
  45. +1 −1  examples/developer-guide/framed_config/mojits/MainMojit/controller.server.js
  46. +1 −1  examples/developer-guide/framed_config/mojits/MainMojit/models/model.server.js
  47. +1 −1  examples/developer-guide/framed_config/server.js
  48. +1 −1  examples/developer-guide/generating_urls/index.js
  49. +1 −1  examples/developer-guide/generating_urls/mojits/GenURLMojit/binders/index.js
  50. +1 −1  examples/developer-guide/generating_urls/mojits/GenURLMojit/controller.server.js
  51. +1 −1  examples/developer-guide/generating_urls/mojits/GenURLMojit/models/model.server.js
  52. +1 −1  examples/developer-guide/generating_urls/server.js
  53. +1 −1  examples/developer-guide/global_assets/mojits/OhHai/controller.server.js
  54. +1 −1  examples/developer-guide/global_assets/server.js
  55. +1 −1  examples/developer-guide/hello/index.js
  56. +1 −1  examples/developer-guide/hello/mojits/HelloMojit/binders/index.js
  57. +1 −1  examples/developer-guide/hello/mojits/HelloMojit/controller.server.js
  58. +1 −1  examples/developer-guide/hello/mojits/HelloMojit/models/model.server.js
  59. +1 −1  examples/developer-guide/hello/server.js
  60. +1 −1  examples/developer-guide/htmlframe_mojit/index.js
  61. +1 −1  examples/developer-guide/htmlframe_mojit/mojits/framed/binders/index.js
  62. +1 −1  examples/developer-guide/htmlframe_mojit/mojits/framed/controller.server.js
  63. +1 −1  examples/developer-guide/htmlframe_mojit/mojits/framed/models/model.server.js
  64. +1 −1  examples/developer-guide/htmlframe_mojit/server.js
  65. +1 −1  examples/developer-guide/inter-mojit/index.js
  66. +1 −1  examples/developer-guide/inter-mojit/mojits/MasterMojit/binders/index.js
  67. +1 −1  examples/developer-guide/inter-mojit/mojits/MasterMojit/controller.server.js
  68. +1 −1  examples/developer-guide/inter-mojit/mojits/ReceiverMojit/controller.server.js
  69. +1 −1  examples/developer-guide/inter-mojit/mojits/SenderMojit/binders/index.js
  70. +1 −1  examples/developer-guide/inter-mojit/mojits/SenderMojit/controller.server.js
  71. +1 −1  examples/developer-guide/inter-mojit/server.js
  72. +1 −1  examples/developer-guide/locale_i18n/index.js
  73. +1 −1  examples/developer-guide/locale_i18n/mojits/i18n/binders/index.js
  74. +1 −1  examples/developer-guide/locale_i18n/mojits/i18n/controller.server.js
  75. +1 −1  examples/developer-guide/locale_i18n/mojits/i18n/lang/i18n_en-AU.js
  76. +1 −1  examples/developer-guide/locale_i18n/mojits/i18n/lang/i18n_en-US.js
  77. +1 −1  examples/developer-guide/locale_i18n/mojits/i18n/lang/i18n_fr-FR.js
  78. +1 −1  examples/developer-guide/locale_i18n/mojits/i18n/models/model.server.js
  79. +1 −1  examples/developer-guide/locale_i18n/server.js
  80. +1 −1  examples/developer-guide/model_yql/index.js
  81. +1 −1  examples/developer-guide/model_yql/mojits/flickr/binders/index.js
  82. +1 −1  examples/developer-guide/model_yql/mojits/flickr/controller.server.js
  83. +1 −1  examples/developer-guide/model_yql/mojits/flickr/models/model.server.js
  84. +1 −1  examples/developer-guide/model_yql/server.js
  85. +1 −1  examples/developer-guide/multiple_mojits/index.js
  86. +1 −1  examples/developer-guide/multiple_mojits/mojits/BodyMojit/binders/index.js
  87. +1 −1  examples/developer-guide/multiple_mojits/mojits/BodyMojit/controller.server.js
  88. +1 −1  examples/developer-guide/multiple_mojits/mojits/BodyMojit/models/model.server.js
  89. +1 −1  examples/developer-guide/multiple_mojits/mojits/FooterMojit/binders/index.js
  90. +1 −1  examples/developer-guide/multiple_mojits/mojits/FooterMojit/controller.server.js
  91. +1 −1  examples/developer-guide/multiple_mojits/mojits/FooterMojit/models/model.server.js
  92. +1 −1  examples/developer-guide/multiple_mojits/mojits/FrameMojit/binders/index.js
  93. +1 −1  examples/developer-guide/multiple_mojits/mojits/FrameMojit/controller.server.js
  94. +1 −1  examples/developer-guide/multiple_mojits/mojits/FrameMojit/models/model.server.js
  95. +1 −1  examples/developer-guide/multiple_mojits/mojits/HeaderMojit/binders/index.js
  96. +1 −1  examples/developer-guide/multiple_mojits/mojits/HeaderMojit/controller.server.js
  97. +1 −1  examples/developer-guide/multiple_mojits/mojits/HeaderMojit/models/model.server.js
  98. +1 −1  examples/developer-guide/multiple_mojits/server.js
  99. +1 −1  examples/developer-guide/scroll_views/index.js
  100. +1 −1  examples/developer-guide/scroll_views/mojits/scroll/binders/index.js
  101. +1 −1  examples/developer-guide/scroll_views/mojits/scroll/controller.server.js
  102. +1 −1  examples/developer-guide/scroll_views/mojits/scroll/lang/scroll_en.js
  103. +1 −1  examples/developer-guide/scroll_views/mojits/scroll/models/model.server.js
  104. +1 −1  examples/developer-guide/scroll_views/server.js
  105. +1 −1  examples/developer-guide/simple_assets/index.js
  106. +1 −1  examples/developer-guide/simple_assets/mojits/simple/binders/index.js
  107. +1 −1  examples/developer-guide/simple_assets/mojits/simple/controller.server.js
  108. +1 −1  examples/developer-guide/simple_assets/mojits/simple/models/model.server.js
  109. +1 −1  examples/developer-guide/simple_assets/server.js
  110. +1 −1  examples/developer-guide/simple_config/index.js
  111. +1 −1  examples/developer-guide/simple_config/mojits/SimpleMojit/binders/index.js
  112. +1 −1  examples/developer-guide/simple_config/mojits/SimpleMojit/controller.server.js
  113. +1 −1  examples/developer-guide/simple_config/mojits/SimpleMojit/models/model.server.js
  114. +1 −1  examples/developer-guide/simple_config/server.js
  115. +1 −1  examples/developer-guide/simple_logging/index.js
  116. +1 −1  examples/developer-guide/simple_logging/mojits/log/models/foo.server.js
  117. +1 −1  examples/developer-guide/simple_logging/server.js
  118. +1 −1  examples/developer-guide/simple_view/index.js
  119. +1 −1  examples/developer-guide/simple_view/mojits/simple/binders/index.js
  120. +1 −1  examples/developer-guide/simple_view/mojits/simple/controller.server.js
  121. +1 −1  examples/developer-guide/simple_view/mojits/simple/models/model.server.js
  122. +1 −1  examples/developer-guide/simple_view/server.js
  123. +1 −1  examples/developer-guide/unittest_model_controller/index.js
  124. +1 −1  examples/developer-guide/unittest_model_controller/mojits/flickr/binders/index.js
  125. +1 −1  examples/developer-guide/unittest_model_controller/mojits/flickr/controller.server.js
  126. +1 −1  examples/developer-guide/unittest_model_controller/mojits/flickr/models/model.server.js
  127. +1 −1  examples/developer-guide/unittest_model_controller/server.js
  128. +1 −1  examples/developer-guide/using_configs/mojits/ContactUs/controller.server.js
  129. +1 −1  examples/developer-guide/using_configs/server.js
  130. +1 −1  examples/developer-guide/using_cookies/index.js
  131. +1 −1  examples/developer-guide/using_cookies/mojits/CookieMojit/binders/index.js
  132. +1 −1  examples/developer-guide/using_cookies/mojits/CookieMojit/controller.server.js
  133. +1 −1  examples/developer-guide/using_cookies/mojits/CookieMojit/models/model.server.js
  134. +1 −1  examples/developer-guide/using_cookies/server.js
  135. +1 −1  examples/developer-guide/using_parameters/index.js
  136. +1 −1  examples/developer-guide/using_parameters/mojits/QueryMojit/binders/index.js
  137. +1 −1  examples/developer-guide/using_parameters/mojits/QueryMojit/controller.server.js
  138. +1 −1  examples/developer-guide/using_parameters/mojits/QueryMojit/models/model.server.js
  139. +1 −1  examples/developer-guide/using_parameters/server.js
  140. +3 −3 examples/developer-guide/yui_module/README.txt
  141. +2 −2 examples/developer-guide/yui_module/mojits/Notepad/binders/index.js
  142. +1 −1  examples/developer-guide/yui_module/mojits/Notepad/controller.server.js
  143. +1 −1  examples/developer-guide/yui_module/package.json
  144. +1 −1  examples/developer-guide/yui_module/server.js
  145. +1 −1  examples/developer-guide/yui_module/{autoload → yui_modules}/storage-lite.client.js
  146. +1 −1  examples/getting-started-guide/part1/hello/index.js
  147. +1 −1  examples/getting-started-guide/part1/hello/mojits/HelloMojit/controller.server.js
  148. +1 −1  examples/getting-started-guide/part1/hello/server.js
  149. +1 −1  examples/getting-started-guide/part2/basic_yql/index.js
  150. +1 −1  examples/getting-started-guide/part2/basic_yql/mojits/Flickr/controller.server.js
  151. +1 −1  examples/getting-started-guide/part2/basic_yql/mojits/Flickr/models/model.server.js
  152. +1 −1  examples/getting-started-guide/part2/basic_yql/server.js
  153. +1 −1  examples/getting-started-guide/part3/intl-templates/index.js
  154. +1 −1  examples/getting-started-guide/part3/intl-templates/mojits/Flickr/controller.server.js
  155. +1 −1  examples/getting-started-guide/part3/intl-templates/mojits/Flickr/lang/Flickr.js
  156. +1 −1  examples/getting-started-guide/part3/intl-templates/mojits/Flickr/lang/Flickr_de.js
  157. +1 −1  examples/getting-started-guide/part3/intl-templates/mojits/Flickr/models/model.server.js
  158. +1 −1  examples/getting-started-guide/part3/intl-templates/server.js
  159. +1 −1  examples/getting-started-guide/part4/paged-yql/index.js
  160. +1 −1  examples/getting-started-guide/part4/paged-yql/mojits/PagedFlickr/binders/index.js
  161. +1 −1  examples/getting-started-guide/part4/paged-yql/mojits/PagedFlickr/controller.common.js
  162. +1 −1  examples/getting-started-guide/part4/paged-yql/mojits/PagedFlickr/lang/PagedFlickr_de.js
  163. +1 −1  examples/getting-started-guide/part4/paged-yql/mojits/PagedFlickr/lang/PagedFlickr_en-US.js
  164. +1 −1  examples/getting-started-guide/part4/paged-yql/mojits/PagedFlickr/models/model.common.js
  165. +1 −1  examples/getting-started-guide/part4/paged-yql/server.js
  166. +1 −1  examples/getting-started-guide/part5/flickr-list/index.js
  167. +1 −1  examples/getting-started-guide/part5/flickr-list/models/flickr.common.js
  168. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrBrowser/assets/logmutator.js
  169. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrBrowser/binders/index.js
  170. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrBrowser/controller.common.js
  171. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrDetail/binders/index.js
  172. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrDetail/binders/message.js
  173. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrDetail/controller.common.js
  174. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrDetail/lang/FlickrDetail_de.js
  175. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/FlickrDetail/lang/FlickrDetail_en-US.js
  176. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/PagedFlickr/binders/index.js
  177. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/PagedFlickr/controller.common.js
  178. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/PagedFlickr/lang/PagedFlickr_de.js
  179. +1 −1  examples/getting-started-guide/part5/flickr-list/mojits/PagedFlickr/lang/PagedFlickr_en-US.js
  180. +1 −1  examples/getting-started-guide/part5/flickr-list/server.js
  181. +1 −1  examples/input/cookies/mojits/ClientCookie/binders/index.js
  182. +1 −1  examples/input/cookies/mojits/ClientCookie/controller.common.js
  183. +1 −1  examples/input/cookies/mojits/ServerCookie/controller.server.js
  184. +1 −1  examples/input/cookies/server.js
  185. +1 −1  examples/input/get/mojits/GetCatcher/controller.common.js
  186. +1 −1  examples/input/get/server.js
  187. +1 −1  examples/input/merged/mojits/ParamGrabber/controller.common.js
  188. +1 −1  examples/input/merged/mojits/Poster/controller.common.js
  189. +1 −1  examples/input/merged/server.js
  190. +1 −1  examples/input/post/mojits/Catcher/controller.server.js
  191. +1 −1  examples/input/post/mojits/Poster/controller.server.js
  192. +1 −1  examples/input/post/server.js
  193. +1 −1  examples/input/route/mojits/RouteParamGrabber/controller.common.js
  194. +1 −1  examples/input/route/server.js
  195. +1 −1  examples/newsboxes/index.js
  196. +1 −1  examples/newsboxes/mojits/Read/binders/index.js
  197. +101 −100 examples/newsboxes/mojits/Read/controller.common.js
  198. +116 −126 examples/newsboxes/mojits/Read/models/rss.common.js
  199. +225 −207 examples/newsboxes/mojits/Read/tests/controller.common-tests.js
  200. +147 −145 examples/newsboxes/mojits/Read/tests/rss.common-tests.js
  201. +1 −1  examples/newsboxes/mojits/Read/views/index.hb.html
  202. +1 −1  examples/newsboxes/mojits/Read/views/index.opera-mini.hb.html
  203. +1 −1  examples/newsboxes/mojits/Shelf/binders/index.js
  204. +24 −23 examples/newsboxes/mojits/Shelf/controller.common.js
  205. +1 −1  examples/newsboxes/mojits/Shelf/tests/controller.common-tests.js
  206. +1 −1  examples/newsboxes/mojits/Weather/controller.common.js
  207. +1 −1  examples/newsboxes/mojits/Weather/models/YqlWeatherModel.common.js
  208. +1 −1  examples/newsboxes/server.js
  209. +1 −1  examples/performance/baseline/server.js
  210. +1 −1  examples/performance/string/mojits/myMojit/controller.server.js
  211. +1 −1  examples/performance/string/server.js
  212. +1 −1  examples/sandbox/bindercomm/index.js
  213. +1 −1  examples/sandbox/bindercomm/mojits/BlueChild/binders/index.js
  214. +1 −1  examples/sandbox/bindercomm/mojits/BlueChild/controller.server.js
  215. +1 −1  examples/sandbox/bindercomm/mojits/BlueChild/models/model.server.js
  216. +1 −1  examples/sandbox/bindercomm/mojits/Parent/binders/dyno.js
  217. +1 −1  examples/sandbox/bindercomm/mojits/Parent/binders/static.js
  218. +1 −1  examples/sandbox/bindercomm/mojits/Parent/controller.server.js
  219. +1 −1  examples/sandbox/bindercomm/mojits/Parent/models/model.server.js
  220. +1 −1  examples/sandbox/bindercomm/mojits/RedChild/binders/index.js
  221. +1 −1  examples/sandbox/bindercomm/mojits/RedChild/controller.server.js
  222. +1 −1  examples/sandbox/bindercomm/mojits/RedChild/models/model.server.js
  223. +1 −1  examples/sandbox/bindercomm/server.js
  224. +1 −1  examples/sandbox/binderrender/mojits/ClickLog/binders/index.js
  225. +1 −1  examples/sandbox/binderrender/mojits/ClickLog/controller.server.js
  226. +1 −1  examples/sandbox/binderrender/mojits/ClickLog/tests/controller.server-tests.js
  227. +1 −1  examples/sandbox/binderrender/server.js
  228. +1 −1  examples/sandbox/bindertime/assets/js/mu.client.js
  229. +1 −1  examples/sandbox/bindertime/index.js
  230. +1 −1  examples/sandbox/bindertime/mojits/Layout/binders/index.js
  231. +1 −1  examples/sandbox/bindertime/mojits/Layout/controller.common.js
  232. +1 −1  examples/sandbox/bindertime/mojits/Layout/models/model.common.js
  233. +1 −1  examples/sandbox/bindertime/mojits/Layout/tests/controller.common-tests.js
  234. +1 −1  examples/sandbox/bindertime/mojits/Layout/tests/models/model.common-tests.js
  235. +1 −1  examples/sandbox/bindertime/mojits/Loader/binders/foo.js
  236. +1 −1  examples/sandbox/bindertime/mojits/Loader/binders/index.js
  237. +1 −1  examples/sandbox/bindertime/mojits/Loader/controller.common.js
  238. +1 −1  examples/sandbox/bindertime/mojits/Loader/models/model.common.js
  239. +1 −1  examples/sandbox/bindertime/mojits/Loader/tests/controller.common-tests.js
  240. +1 −1  examples/sandbox/bindertime/mojits/Loader/tests/models/model.common-tests.js
  241. +1 −1  examples/sandbox/bindertime/server.js
  242. +1 −1  examples/sandbox/bindertime/start.js
  243. +1 −1  examples/sandbox/controller-state/index.js
  244. +1 −1  examples/sandbox/controller-state/mojits/Parent/binders/index.js
  245. +1 −1  examples/sandbox/controller-state/mojits/Parent/controller.common.js
  246. +1 −1  examples/sandbox/controller-state/mojits/Parent/models/model.server.js
  247. +1 −1  examples/sandbox/controller-state/mojits/Stateful/binders/index.js
  248. +1 −1  examples/sandbox/controller-state/mojits/Stateful/controller.common.js
  249. +1 −1  examples/sandbox/controller-state/mojits/Stateful/models/model.common.js
  250. +1 −1  examples/sandbox/controller-state/server.js
  251. +1 −1  examples/sandbox/lazy_load/index.js
  252. +1 −1  examples/sandbox/lazy_load/mojits/Container/binders/index.js
  253. +1 −1  examples/sandbox/lazy_load/mojits/Container/controller.server.js
  254. +1 −1  examples/sandbox/lazy_load/mojits/Container/models/foo.server.js
  255. +1 −1  examples/sandbox/lazy_load/mojits/LazyPants/binders/hello.js
  256. +1 −1  examples/sandbox/lazy_load/mojits/LazyPants/controller.common.js
  257. +1 −1  examples/sandbox/lazy_load/mojits/LazyPants/models/foo.server.js
  258. +1 −1  examples/sandbox/lazy_load/server.js
  259. +1 −1  examples/sandbox/metabubble/index.js
  260. +1 −1  examples/sandbox/metabubble/mojits/Child/binders/index.js
  261. +1 −1  examples/sandbox/metabubble/mojits/Child/controller.common.js
  262. +1 −1  examples/sandbox/metabubble/mojits/Child/models/model.server.js
  263. +1 −1  examples/sandbox/metabubble/mojits/Child/tests/models/model.server-tests.js
  264. +1 −1  examples/sandbox/metabubble/mojits/Parent/binders/index.js
  265. +1 −1  examples/sandbox/metabubble/mojits/Parent/controller.common.js
  266. +1 −1  examples/sandbox/metabubble/mojits/Parent/models/model.server.js
  267. +1 −1  examples/sandbox/metabubble/mojits/Parent/tests/models/model.server-tests.js
  268. +1 −1  examples/sandbox/metabubble/server.js
  269. +1 −1  examples/sandbox/server_side/index.js
  270. +1 −1  examples/sandbox/server_side/mojits/Layout/binders/index.js
  271. +1 −1  examples/sandbox/server_side/mojits/Layout/controller.server.js
  272. +1 −1  examples/sandbox/server_side/mojits/Layout/models/model.server.js
  273. +1 −1  examples/sandbox/server_side/mojits/MyServer/binders/index.js
  274. +1 −1  examples/sandbox/server_side/mojits/MyServer/controller.server.js
  275. +1 −1  examples/sandbox/server_side/mojits/MyServer/models/model.server.js
  276. +1 −1  examples/sandbox/server_side/server.js
  277. +1 −1  examples/sandbox/server_side/start.js
  278. +1 −1  examples/sandbox/strangeloop/index.js
  279. +1 −1  examples/sandbox/strangeloop/mojits/Container/binders/index.js
  280. +1 −1  examples/sandbox/strangeloop/mojits/Container/controller.server.js
  281. +1 −1  examples/sandbox/strangeloop/mojits/Container/models/foo.server.js
  282. +1 −1  examples/sandbox/strangeloop/mojits/Speakers/binders/index.js
  283. +1 −1  examples/sandbox/strangeloop/mojits/Speakers/controller.common.js
  284. +1 −1  examples/sandbox/strangeloop/mojits/Speakers/models/strangeloop.common.js
  285. +1 −1  examples/sandbox/strangeloop/mojits/TweetView/binders/index.js
  286. +1 −1  examples/sandbox/strangeloop/mojits/TweetView/controller.common.js
  287. +1 −1  examples/sandbox/strangeloop/mojits/TweetView/models/twitter.common.js
  288. +1 −1  examples/sandbox/strangeloop/server.js
  289. +1 −1  examples/sandbox/view_refresh/mojits/ColoredChild/binders/index.js
  290. +1 −1  examples/sandbox/view_refresh/mojits/ColoredChild/controller.server.js
  291. +1 −1  examples/sandbox/view_refresh/mojits/ColoredChild/models/model.server.js
  292. +1 −1  examples/sandbox/view_refresh/mojits/Parent/binders/index.js
  293. +1 −1  examples/sandbox/view_refresh/mojits/Parent/controller.server.js
  294. +1 −1  examples/sandbox/view_refresh/mojits/Parent/models/model.server.js
  295. +1 −1  examples/sandbox/view_refresh/server.js
  296. +1 −1  examples/sandbox/yuiconf/index.js
  297. +1 −1  examples/sandbox/yuiconf/mojits/Container/binders/index.js
  298. +1 −1  examples/sandbox/yuiconf/mojits/Container/controller.server.js
  299. +1 −1  examples/sandbox/yuiconf/mojits/Container/models/foo.server.js
  300. +1 −1  examples/sandbox/yuiconf/mojits/TweetView/binders/index.js
Sorry, we could not display the entire diff because too many files (506) changed.
View
225 DEPRECATIONS.md
@@ -9,15 +9,8 @@ future.
-Currently Deprecated
-====================
-
-
-### Deprecated but Available
-
-* (2012-08-14) Controllers that declare themselves using `Y.mojito.controller = {...}`
-should be changed to use `Y.namespace('mojito.controllers')[NAME] = {...}`. The previously
-used pattern will clobber the controllers if you are using `shareYUIInstance: true`.
+Deprecated but Available
+========================
* (2012-08-13) Files ending in `.mu.html` will eventually not be rendered
out-of-the-box by Mojito. All downstream projects should use the Handlebars
@@ -27,61 +20,209 @@ by default. To rename all views in your project, run the following in your proje
root folder:
`find . -name "*.mu.html" -exec sh -c 'mv "$1" "$(echo "$1" | sed s/mu.html\$/hb.html/)"' _ {} \;`
-* (2012-04-23) The `.guid` member of Mojito metadata (such as binder metadata)
-is going away. Often there's an associated member which more specifically
-expresses the intent of the unique ID (for example `.viewId` or `.instanceId`).
-* (2012-04-23) `ac.dispatch()` will be going away. (This already emits a
-warning.) Currently the best alternative is `ac._dispatch()`.
+Deprecated with Warnings
+========================
+
+* (2012-12-05) the `mojito compile` command will be removed in future releases, in favor of [Shaker](/yahoo/mojito-shaker).
+* (2012-04-23) `ac.dispatch()` will be going away.
+Currently the best alternative is `ac._dispatch()`.
+
+
+Removed
+=======
+
+### (0.5.0) Mojito `compile` command line tool no longer needs a `rollup` command
+
+Javascript file concatenation/combo'ing of mojito files is now built-in.
+
+### (0.5.0) Mojito No Longer Adds Common ActionContext Addons
+
+In the past, a subset of the addons provided by Mojito framework were attached on every `ActionContext` object (which are created per request, per mojit instance in the page).
+The specific list was `['mojito-config-addon', 'mojito-url-addon', 'mojito-assets-addon', 'mojito-cookie-addon', 'mojito-params-addon', 'mojito-composite-addon']`.
+This resulted in overhead for every mojit in the page.
+As part of 0.5.0, all requirements have to be specified in the controller definition. e.g:
+
+ YUI.add('Foo', function(Y, NAME) {
+
+ Y.namespace('mojito.controllers')[NAME] = {
+
+ index: function(ac) {
+ // ac.params.* is now available
+ }
+
+ };
+
+ }, '0.0.1', {requires: ['mojito', 'mojito-params-addon']});
+
+As of 0.5.0, no addon is attached unless it is required. The only public members of `ActionContent` object are `ac.done`, `ac.error`, and `ac.flush`.
+
+Recommendations to upgrade:
+
+* check every controller in your app, and check if it is using `ac.*`, and add the corresponding requirements.
+* the most common addons are: config, params, url, assets.
+
+
+
+### (0.5.0) Access to Models via a Property
+
+Models are no longer computed and attached to `ActionContext` by default.
+In other words, `ac.models.foo` is no longer a valid way to access a model.
+Computing and attaching models automatically, even when they were not really needed, added overhead during the page rendering process.
+Instead, we want Mojito to be more strict in defining and exposing structures automatically.
+
+In 0.5.0, if you need to use a model in a controller (defined at the mojit level, or at the application level), you need to:
+
+* require a new addon called `mojito-models-addon` in your controller.
+* require the module in your controller.
+* use `ac.models.get('foo')` to get a reference of the model.
+
+Here is an example:
+
+ YUI.add('DemoModelFoo', function(Y, NAME) {
+ Y.namespace('mojito.models')[NAME] = {
+ init: function(config) {
+ this.config = config;
+ },
+ getData: function(callback) {}
+ };
+ }, '0.0.1', {requires: []});
+
+ YUI.add('Foo', function(Y, NAME) {
+ Y.namespace('mojito.controllers')[NAME] = {
+ index: function(ac) {
+ ac.models.get('DemoModelFoo').getData(function (data) {
+ // data from model available here
+ });
+ }
+ };
+
+ }, '0.0.1', {requires: ['mojito', 'mojito-models-addon', 'DemoModelFoo']});
+
+> Note: the model name doesn't have to match the yui module name for the model anymore.
+
+
+
+### (0.5.0) `init` Method in Controllers
+
+The `init` method on the controller is now deprecated and should be removed.
+In many cases, the `init` method was just storing a reference of the `config` parameter to use it later on.
+This is no longer available, and the `init` method will not be executed.
+
+If you need to access the mojit `config` in an actions, you should:
+
+* require `mojito-config-addon` in the controller.
+* use `ac.config.get()` to get the `config`
+
+> Note: do not try to store a reference of that config, as it is not safe, More details below.
+
+
+
+### (0.5.0) `ac.app.*`
+
+For performance reasons, to avoid computing app config per mojit instance, per request, when the majority of the time it is not needed, we completed the transition to `mojito-config-addon` add-on.
+This change affects `ac.app.*`, specifically `ac.app.config` which was commonly used to access the computed `application.json` configuration per `context`.
+If you need to access the application `config` in an action or another add-on, you should:
+
+* require `mojito-config-addon` in the controller.
+* use `ac.config.getAppConfig()` to get the former `ac.app.config`
+
+
+
+### (0.5.0) Controllers Can No Longer Run Forever
+
+Mojito now imposes a timeout on the dispatch of the action in the controllers.
+Starting with 0.5.0 there is a "reaper" which imposes a timeout.
+Actions must call `ac.done()` or `ac.error()` before the timer expires or the system will log a warning and invoke `ac.error()` with a timeout error.
+
+This can be configured by the `actionTimeout` setting in `application.json`.
+It contains the maximum number of milliseconds that a controller action is allowed to run before the action is timed out.
+The default value is `60000` (60 seconds).
+
+
+
+### (0.5.0) Mojit and AC Addon Naming Conventions
+
+Mojito is more restrictive in how you names mojits and add-ons. There are 4 new rules:
+
+* `addon` namespace should match the filename. E.g. `ac.foo` corresponds to `addons/ac/foo.common.js`.
+* The name of the mojit, which is the name of the folder, should match the language bundle, including the filename of the bundle and its definition. E.g. `Foo` mojit can have `lang/Foo_da-DK.js`, and the content should be `YUI.add('lang/Foo_da-DK', function (Y) { Y.Intl.add('Foo', 'da-DK', {}); });`
+* Controller YUI module name should be same as directory.
+* YUI modules need to have unique names, regardless of selector.
+
+
+
+### (0.5.0) `log` Config in `application.json`
+
+In previous versions, the console log was separated for client and server, and between Mojito and YUI.
+We decided to leverage the YUI Logger, and unify this setting under a single configuration, actually the YUI configuration in `application.json`:
+ "log": {
+ "client": {
+ "level": "error",
+ "yui": false
+ },
+ "server": {
+ "level": "error",
+ "yui": false
+ }
+ }
-### Deprecated with Warnings
-nothing for mojito 0.3
+is now:
+ "yui": {
+ "config": {
+ "debug": true,
+ "logLevel": "error"
+ }
+ }
-### Removed
-nothing for mojito 0.3
+and we recommend this setting for production:
+ "yui": {
+ "config": {
+ "debug": false,
+ "logLevel": "none"
+ }
+ }
+To customize this for client or server, you can use the runtime context.
+Also, you can now use `logExclude` and `logInclude`.
+More information at http://yuilibrary.com/yui/docs/api/classes/config.html.
-Deprecation Process
-===================
-A feature will move through the following phases, at a well-defined pace.
-### "Deprecated but Available" Phase
+### (0.5.0) Other Settings in `application.json`
-* The documentation is updated to mark the feature as "deprecated".
-* The feature will be in this phase until the end of the quarter year.
-(It's possible that a feature won't spend much time in this phase, if it is
-deprecated near the end of the quarter.)
+The following are gone:
+* `embedJsFilesInHtmlFrame`
+* `shareYUIInstance`
+* in the `yui` section:
+ * `base`
+ * `dependencyCalculations`
+ * `extraModules`
+ * `loader`
+ * `url`
+ * `urlContains`
-### "Deprecated with Warning" Phase
-* The feature is removed from the documentation.
-* Mojito emits a warning (if possible) if the feature is used.
-* The feature will spend a full quarter in this phase.
+### (0.5.0) `mojito test` No Longer Tests the Framework
-### "Removed" Phase
+In the past, `mojito test` without any other parameter was running all unit tests for mojito framework, and this is no longer the case.
+We moved all the tests to `arrow`, more details here: https://github.com/yahoo/mojito/tree/develop/tests
-* The feature (and warning) is removed from Mojito.
+You can continue using `mojito test app path/to/app` and `mojito test mojit path/to/mojit`, and the behavior is still the same.
+> Note: this change is only relevant for contributors.
-### Example
-* On 2012-04-19 (Q2), Mojito deprecates the "foo" feature by saying so in the
-documentation. This event is also mentioned in an email and/or blog post for
-the next release. It's also added to this DEPRECATIONS.md document.
-* On the next release after 2012-06-30 (end of Q2), Mojito removes
-documentation for feature "foo" and adds a warning if someone tries to use
-feature "foo". It is still documented in this DEPRECATIONS.md document.
+### (0.5.0) `.guid`
+The `.guid` member of Mojito metadata (such as binder metadata) is now gone.
+Often there's an associated member which more specifically expresses the intent of the unique ID (for example `.viewId` or `.instanceId`).
-* On the next releaes after 2012-09-30 (end of Q3), Mojito removes feature
-"foo" (and the associated warnings). It is mentioned as "removed" in this
-DEPRECATIONS.md document.
View
2  LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
View
2  bin/mojito
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  docs/dev_guide/code_exs/simple_logging.rst
@@ -35,7 +35,7 @@ Log Configuration
Logging is configured in the ``application.json`` file with the ``yui.config``
object. With the ``yui.config`` object, you can configure the log levels and some
elements of the output for logs. See the
-`config object <intro/mojito_configuring.html#yui_config>`_ for the
+`config object <../intro/mojito_configuring.html#yui_config>`_ for the
configurations that can be set.
View
22 docs/dev_guide/code_exs/yui_modules.rst
@@ -19,7 +19,7 @@ page views and browser sessions.
The following topics will be covered:
-- adding YUI modules to the ``autoload`` directory
+- adding YUI modules to the ``yui_modules`` directory
- accessing YUI modules from a mojit
.. _code_exs-incl_yui_mods-notes:
@@ -38,9 +38,9 @@ Location
########
To add YUI modules that all your mojits can access, place the modules in the
-``autoload`` directory under the application directory. For example, YUI
+``yui_modules`` directory under the application directory. For example, YUI
modules in the ``hello_world`` application would be placed in
-``hello_world/autoload``.
+``hello_world/yui_modules``.
.. _yui_mod_impl_add-naming:
@@ -70,7 +70,7 @@ the module identified by the string ``'gallery-storage-lite'``.
YUI.add('gallery-storage-lite', function (Y) {
...
- }, '1.0.0', { requires: ['event-base', 'event-custom', 'event-custom-complex', 'json']});
+ }, '1.0.0', { requires: [ 'event-base', 'event-custom', 'event-custom-complex', 'json']});
.. _yui_mod_impl-using:
@@ -78,7 +78,7 @@ the module identified by the string ``'gallery-storage-lite'``.
Using a YUI Module from Mojits
------------------------------
-After registered YUI modules have been added to the ``autoload`` directory, you
+After registered YUI modules have been added to the ``yui_modules`` directory, you
can load them into your mojit code by listing them as dependencies in the
``requires`` array. In the binder ``index.js`` below, you can see that the
Storage Lite module that we created and registered in :ref:`registering_module`
@@ -95,7 +95,7 @@ is listed as a dependency in the ``requires`` array.
...
}
};
- // See autoload/storage-lite.client.js
+ // See yui_modules/storage-lite.client.js
}, '0.0.1', {requires: [ 'gallery-storage-lite' ]});
In the ``bind`` method, ``Y.StorageLite.getItem`` and ``Y.StorageLite.setItem``
@@ -177,12 +177,12 @@ To set up and run ``yui_module``:
}
]
-#. Create the autoload directory for storing the Storage Lite module.
+#. Create the ``yui_modules`` directory for storing the Storage Lite module.
- ``$ mkdir autoload``
-#. Get the Storage Lite module and place it in the ``autoload`` directory.
+ ``$ mkdir yui_modules``
+#. Get the Storage Lite module and place it in the ``yui_modules`` directory.
- ``$ wget -O autoload/storage-lite.client.js https://raw.github.com/rgrove/storage-lite/master/src/storage-lite.js --no-check-certificate``
+ ``$ wget -O yui_modules/storage-lite.client.js https://raw.github.com/rgrove/storage-lite/master/src/storage-lite.js --no-check-certificate``
#. Change to ``mojits/Notepad``.
#. Replace the code in ``controller.server.js`` with the following:
@@ -227,7 +227,7 @@ To set up and run ``yui_module``:
};
}, '0.0.1', {
requires: [
- 'gallery-storage-lite' //see autoload/storage-lite.client.js
+ 'gallery-storage-lite' //see yui_modules/storage-lite.client.js
]
});
View
282 docs/dev_guide/faq/index.rst
@@ -20,26 +20,11 @@ General
* :ref:`Does Mojito have API methods for handling caching? If not, what's the best way for Mojito
applications to handle caching? <moj_caching>`
* :ref:`Can Mojito make runtime decisions to run client-side or server-side code? <moj_run_client_server>`
-* :ref:`Can Mojito applications access the 'request' or 'response' instances of the Node.js classes
- 'http.ServerRequest' and 'http.ServerResponse'? <moj_req_res_instances>`
-* :ref:`Is it possible to access headers from a Mojito application? <moj_access_headers>`
* :ref:`Can Mojito be started with Node.js instead of using "mojito start"? <moj_node_start>`
* :ref:`How can I improve the performance of my Mojito application? <moj_optimize_performance>`
* :ref:`When I run 'mojito version', why is the version different than the version I installed? <moj_version_conflict>`
-Mojits
-------
-
-* :ref:`What is a mojit? <mojit_exp>`
-* :ref:`Can mojits have child mojits? <moj_children>`
-* :ref:`How do mojits share objects? <moj_objects>`
-* :ref:`Can mojit instances be dynamically defined and then run? <moj_dynamic_creation>`
-* :ref:`Is there a way to make all of the resources, such as assets, addons, binders, models, of one mojit available to other mojits? <moj_resources>`
-* :ref:`Why does Mojito replace hyphens in the names of my mojits with underscores? <moj_names_hyphens>`
-.. * :ref:`Can I share or re-use mojits? <moj_reuse>`
-
-
Configuration
-------------
@@ -70,6 +55,28 @@ CSS/JavaScript Assets
* :ref:`How do I add assets templates? <moj_assets>`
* :ref:`How are assets dynamically added to views? <moj_dyn_assets>`
+
+HTTP Headers/Responses
+----------------------
+
+* :ref:`Can Mojito applications access the 'request' or 'response' instances of the Node.js classes
+ 'http.ServerRequest' and 'http.ServerResponse'? <moj_req_res_instances>`
+* :ref:`Is it possible to access HTTP headers from a Mojito application? <moj_access_headers>`
+* :ref:`How does a Mojito application set the expiration of a cookie in the HTTP response? <moj_cookie_exp>`
+
+
+Mojits
+------
+
+* :ref:`What is a mojit? <mojit_exp>`
+* :ref:`Can mojits have child mojits? <moj_children>`
+* :ref:`How do mojits share objects? <moj_objects>`
+* :ref:`Can mojit instances be dynamically defined and then run? <moj_dynamic_creation>`
+* :ref:`Is there a way to make all of the resources, such as assets, addons, binders, models, of one mojit available to other mojits? <moj_resources>`
+* :ref:`Why does Mojito replace hyphens in the names of my mojits with underscores? <moj_names_hyphens>`
+.. * :ref:`Can I share or re-use mojits? <moj_reuse>`
+
+
Views
-----
@@ -239,34 +246,7 @@ General
for more information.
------------
-
-.. _moj_req_res_instances:
-.. topic:: **Can Mojito applications access the 'request' or 'response' instances of the
- Node.js classes 'http.ServerRequest' and 'http.ServerResponse'?**
-
- Yes, the Mojito API has the ``ActionContext`` addon ``Http.server`` that has methods
- for getting the ``request`` and ``response`` instances of the Node.js classes
- ``http.ServerRequest`` and ``http.ServerResponse``. From the ``ActionContext`` object
- ``ac`` shown below, you call ``http.getRequest`` and ``http.getResponse`` to get the
- ``request`` and ``response`` instances. See `Class Http.server <../../api/classes/Http.server.html>`_
- for more information.
-
- .. code-block:: javascript
-
- var request = ac.http.getRequest();
- var response = ac.http.getResponse();
-
-
-------------
-
-.. _moj_access_headers:
-.. topic:: **Is it possible to access HTTP headers from a Mojito application?**
-
- Yes, the Mojito API has the ``ActionContext`` addon ``Http.server`` that allows you to
- get, set, and add HTTP headers. See `Class Http.server <../../api/classes/Http.server.html>`_
- for the available methods.
-
-------------
+
.. _moj_node_start:
.. topic:: **Can Mojito be started with Node.js instead of using "mojito start"?**
@@ -375,84 +355,6 @@ General
-Mojits
-------
-
-.. _mojit_exp:
-.. topic:: **What is a mojit?**
-
- The basic unit of composition and reuse in a Mojito application. It typically
- corresponds to a rectangular area of a page and uses MVC.
-
-------------
-
-.. _moj_children:
-.. topic:: **Can mojits have child mojits?**
-
- Yes, you can configure your application to have mojits that have one or more child
- mojits. The parent mojit can execute the child mojits using the
- `Composite addon <../../api/classes/Composite.common.html>`_.
- See `Configuring Applications to Have Multiple Mojit <../intro/mojito_configuring.html#configuring-applications-to-have-multiple-mojits>`_
- and `Composite Mojits <../topics/mojito_composite_mojits.html#composite-mojits>`_.
-
- You can also use frame mojits, such as `HTMLFrameMojit <../topics/mojito_frame_mojits.html#htmlframemojit>`_
- that can execute one or more child mojits.
-
-------------
-
-
-.. _moj_objects:
-.. topic:: **How do mojits share objects?**
-
- You create an application-level middleware or an ActionContext addon that all mojits
- can access. Your mojits can use this middleware or the ActionContext addon to share
- objects. See `Creating Addons <../topics/mojito_extensions.html#creating-new-addons>`_
- and `Middleware <../topics/mojito_extensions.html#middleware>`_ for implementation
- details.
-
-------------
-
-.. _moj_dynamic_creation:
-.. topic:: **Can mojit instances be dynamically defined and then run?**
-
- You can run dynamically defined instances of mojits that you created with the Mojito
- command-line tool. You would create these instances in a mojit controller using the
- ``ActionContext`` object with either the ``_dispatch`` or ``execute`` methods.
- See `Running Dynamically Defined Mojit Instances <../topics/mojito_run_dyn_defined_mojits.html>`_
- for more information.
-
-------------
-
-.. _moj_resources:
-.. topic:: **Is there a way to make all of the resources, such as assets, addons, binders,
- models, of one mojit available to other mojits?**
-
- To make the resources of one mojit available to other mojits, you set the ``appLevel``
- property in the ``application.json`` file to ``true``. Mojits wanting to use the
- resources of application-level mojit must include the YUI module of the
- application-level mojit in the ``requires`` array.
- See `Configuring Metadata <../intro/mojito_configuring.html#configuring-metadata>`_
- for more information.
-
-------------
-
-.. _moj_names_hyphens:
-.. topic:: **Why does Mojito replace hyphens in the names of my mojits with underscores?**
-
- The ECMAScript syntax for ``Identifiers`` does not allow hyphens, so Mojito replaces
- them with underscores. See the section **Identifier Names and Identifiers** in the
- `ECMAScript Documentation <http://www.ecmascript.org/docs.php>`_ for the syntax rules
- for ``Identifier`` and ``IdentifierName``.
-
-
-
-.. .. _moj_reuse:
-.. .. topic:: **Can I share or re-use mojits?**
-
-.. Although not available yet, the Cocktails mojit gallery/repository will let
-.. developers share, discover, and select mojits to re-use in building their
-.. experiences. A common packaging format for mojits is used, based on the CommonJS
-.. specification.
Configuration
-------------
@@ -634,6 +536,142 @@ CSS/JavaScript Assets
`Using the Assets Addon <../topics/mojito_assets.html#using-the-assets-addon>`_ for
more information.
+HTTP Headers/Responses
+----------------------
+
+.. _moj_req_res_instances:
+.. topic:: **Can Mojito applications access the 'request' or 'response' instances of the
+ Node.js classes 'http.ServerRequest' and 'http.ServerResponse'?**
+
+ Yes, the Mojito API has the ``ActionContext`` addon ``Http.server`` that has methods
+ for getting the ``request`` and ``response`` instances of the Node.js classes
+ ``http.ServerRequest`` and ``http.ServerResponse``. From the ``ActionContext`` object
+ ``ac`` shown below, you call ``http.getRequest`` and ``http.getResponse`` to get the
+ ``request`` and ``response`` instances. See `Class Http.server <../../api/classes/Http.server.html>`_
+ for more information.
+
+ .. code-block:: javascript
+
+ var request = ac.http.getRequest();
+ var response = ac.http.getResponse();
+
+
+------------
+
+.. _moj_access_headers:
+.. topic:: **Is it possible to access HTTP headers from a Mojito application?**
+
+ Yes, the Mojito API has the ``ActionContext`` addon ``Http.server`` that allows you to
+ get, set, and add HTTP headers. See `Class Http.server <../../api/classes/Http.server.html>`_
+ for the available methods.
+
+------------
+
+.. _moj_cookie_exp:
+.. topic:: **How does a Mojito application set the expiration of a cookie in the HTTP response?**
+
+ The controller of your application can get the HTTP response with the ``Http``
+ addon and then set the cookie and the max age (expiration) with the ``Cookie`` addon.
+ In the example controller below, the cookie is set to expire in two weeks.
+ Note that the value for ``maxAge`` is in milliseconds and that you need to
+ require ``mojito-cookie-addon`` and ``mojito-http-addon`` to use the addons.
+
+ .. code-block:: javascript
+
+
+ YUI.add('setCookie', function(Y, NAME) {
+
+ Y.namespace('mojito.controllers')[NAME] = {
+
+ index: function(ac) {
+ ac.http.getResponse().cookie("cookie_set", "true", { "maxAge": 1209600000 });
+ ac.done({
+ status: 'Cookie set to expire in two weeks (maxAge in milliseconds).',
+ });
+ }
+ };
+ }, '0.0.1', {requires: ['mojito', 'mojito-cookie-addon', 'mojito-http-addon']});
+
+
+Mojits
+------
+
+.. _mojit_exp:
+.. topic:: **What is a mojit?**
+
+ The basic unit of composition and reuse in a Mojito application. It typically
+ corresponds to a rectangular area of a page and uses MVC.
+
+------------
+
+.. _moj_children:
+.. topic:: **Can mojits have child mojits?**
+
+ Yes, you can configure your application to have mojits that have one or more child
+ mojits. The parent mojit can execute the child mojits using the
+ `Composite addon <../../api/classes/Composite.common.html>`_.
+ See `Configuring Applications to Have Multiple Mojit <../intro/mojito_configuring.html#configuring-applications-to-have-multiple-mojits>`_
+ and `Composite Mojits <../topics/mojito_composite_mojits.html#composite-mojits>`_.
+
+ You can also use frame mojits, such as `HTMLFrameMojit <../topics/mojito_frame_mojits.html#htmlframemojit>`_
+ that can execute one or more child mojits.
+
+------------
+
+
+.. _moj_objects:
+.. topic:: **How do mojits share objects?**
+
+ You create an application-level middleware or an ActionContext addon that all mojits
+ can access. Your mojits can use this middleware or the ActionContext addon to share
+ objects. See `Creating Addons <../topics/mojito_extensions.html#creating-new-addons>`_
+ and `Middleware <../topics/mojito_extensions.html#middleware>`_ for implementation
+ details.
+
+------------
+
+.. _moj_dynamic_creation:
+.. topic:: **Can mojit instances be dynamically defined and then run?**
+
+ You can run dynamically defined instances of mojits that you created with the Mojito
+ command-line tool. You would create these instances in a mojit controller using the
+ ``ActionContext`` object with either the ``_dispatch`` or ``execute`` methods.
+ See `Running Dynamically Defined Mojit Instances <../topics/mojito_run_dyn_defined_mojits.html>`_
+ for more information.
+
+------------
+
+.. _moj_resources:
+.. topic:: **Is there a way to make all of the resources, such as assets, addons, binders,
+ models, of one mojit available to other mojits?**
+
+ To make the resources of one mojit available to other mojits, you set the ``appLevel``
+ property in the ``application.json`` file to ``true``. Mojits wanting to use the
+ resources of application-level mojit must include the YUI module of the
+ application-level mojit in the ``requires`` array.
+ See `Configuring Metadata <../intro/mojito_configuring.html#configuring-metadata>`_
+ for more information.
+
+------------
+
+.. _moj_names_hyphens:
+.. topic:: **Why does Mojito replace hyphens in the names of my mojits with underscores?**
+
+ The ECMAScript syntax for ``Identifiers`` does not allow hyphens, so Mojito replaces
+ them with underscores. See the section **Identifier Names and Identifiers** in the
+ `ECMAScript Documentation <http://www.ecmascript.org/docs.php>`_ for the syntax rules
+ for ``Identifier`` and ``IdentifierName``.
+
+
+
+.. .. _moj_reuse:
+.. .. topic:: **Can I share or re-use mojits?**
+
+.. Although not available yet, the Cocktails mojit gallery/repository will let
+.. developers share, discover, and select mojits to re-use in building their
+.. experiences. A common packaging format for mojits is used, based on the CommonJS
+.. specification.
+
Views
-----
@@ -735,7 +773,7 @@ Logging/Testing
}
...
- See `Including and Excluding Modules From Logging <../topics/mojito_logging.rst#logging_custom-include_exclude_src>`_
+ See `Including and Excluding Modules From Logging <../topics/mojito_logging.html#including-and-excluding-modules-from-logging>`_
for more information.
------------
View
26 docs/dev_guide/intro/mojito_apps.rst
@@ -56,9 +56,9 @@ globally available to all mojits. Those marked with an asterisk are not created
- ``assets`` - general directory containing CSS files for all mojits.
- ``application.json`` - application configuration file that lets you specify
the port and the mojits used by the application.
-- ``autoload`` - directory of JavaScript files that contain YUI modules added
- with ``YUI.add``. These files aren't actually *auto-loaded*, but are merely
- automatically included if required by a YUI module.
+- ``yui_modules`` - directory of JavaScript files that contain YUI modules added
+ with ``YUI.add``. These files are automatically included if required by a
+ YUI module.
- ``default.json`` - file that sets default values for all specifications.
- ``mojits`` - directory storing the mojits. See `Mojit Files and Directories`_
for a description of the directory contents.
@@ -94,10 +94,10 @@ is available.
- ``actions`` - directory of JavaScript files containing methods to add to the
controller. Actions are useful for maintaining large controllers.
- ``assets`` - directory for storing CSS or JavaScript files.
-- ``autoload`` - directory containing JavaScript files that contain YUI
- modules added with ``YUI.add``. These files aren't actually *autoloaded*,
- but are merely automatically included if required by a YUI module. Both
- the application directory and mojit directory can have ``autoload`` directories.
+- ``yui_modules`` - directory containing JavaScript files that contain YUI
+ modules added with ``YUI.add``. These files are automatically included if required by a
+ YUI module. Both the application directory and mojit directory can have ``yui_modules``
+ directories.
- ``binders`` - directory containing event binding files for the mojit.
- ``controller.server.js`` - the mojit controller that runs on the server. You
can also create the file ``controller.client.js`` to have a mojit controller
@@ -117,11 +117,11 @@ is available.
- ``{model_name}.{affinity}-tests.js`` - the unit tests for the mojit
models.
- ``{module_name}.{affinity}-tests.js`` - the unit tests for YUI modules,
- which are located in ``mojits/{mojit_name}/autoload`` directory.
+ which are located in ``mojits/{mojit_name}/yui_modules`` directory.
- Example of module and corresponding test:
- - ``{app_name}/mojits/{mojit_name}/autoload/{module_name}.{affinity}.js``
+ - ``{app_name}/mojits/{mojit_name}/yui_modules/{module_name}.{affinity}.js``
-- ``{app_name}/mojits/{mojit_name}/tests/autoload/{module_name}.{affinity}-tests.js``
+- ``{app_name}/mojits/{mojit_name}/tests/yui_modules/{module_name}.{affinity}-tests.js``
- ``views`` - directory containing the templates.
@@ -147,13 +147,13 @@ rendering engine.
|-- application.json
|-- assets/
| `-- favicon.icon
- |-- autoload/
+ |-- yui_modules/
| `-- *.{affinity}.js
|-- index.js
|-- mojits/
| `-- [mojit_name]
| |-- assets/
- | |-- autoload/
+ | |-- yui_modules/
| | `-- *.{affinity}.js
| |-- binders/
| | `-- {view_name}.js
@@ -165,7 +165,7 @@ rendering engine.
| |-- models/
| | `-- {model_name}.{affinity}.js
| |-- tests/
- | | |-- autoload/
+ | | |-- yui_modules/
| | | `-- {module_name}.{affinity}-tests.js
| | |-- controller.{affinity}-tests.js
| | `-- models/
View
113 docs/dev_guide/intro/mojito_configuring.rst
@@ -9,7 +9,7 @@ Basic Information
Mojito can be configured at the framework, application, and mojit levels.
Each level is configured differently, but uses same general file format
-consisting of JSON.
+consisting of JSON or YAML.
.. _config_basic-file:
@@ -23,15 +23,21 @@ JSON
By default, configuration files in Mojito have a general top-level
structure and are in JSON format. At the top level of each configuration
-file is an array. Each item of the array is an object that configures
-one component of Mojito, such as logging, assets, mojits, static resources, etc.
-
-Each configuration object is required to have a ``settings`` property that
-specifies contexts for applying the configuration settings. These conditions
-could be used to determine the configurations in different environments.
-
-Below is the skeleton of a configuration file. See `Application Configuration`_
-and `Mojit Configuration`_ for details about specific configuration files.
+file is an array. Each item of the array is an object containing configuration that
+targets a specific context and runtime. This allows you to have discrete configurations
+for different regions, devices, and development environments.
+
+The context for a configuration object is specified by the ``settings`` property. For
+each configuration object in a file, the ``settings`` property must specify a unique
+context, otherwise Mojito fails. For example, the ``application.json`` file
+cannot have two configuration objects specifying the context ``environment:development``.
+See `Using Context Configurations <../topics/mojito_using_contexts.html>`_
+for more information about contexts.
+
+Below is the skeleton of a configuration file with two configuration
+objects, each identified by contexts defined by the ``settings`` property.
+See `Application Configuration`_ and `Mojit Configuration`_ for details about specific
+configuration files.
.. code-block:: javascript
@@ -43,6 +49,12 @@ and `Mojit Configuration`_ for details about specific configuration files.
...
}
},
+ {
+ "settings": [ "environment:development" ],
+ "specs": {
+ ...
+ }
+ },
...
]
@@ -105,12 +117,6 @@ configuration Object
| | | | to cache the view. Note that not all view engines |
| | | | support caching. |
+--------------------------------------------------------+----------------------+-------------------+--------------------------------------------------------+
-| ``deferAllOptionalAutoloads`` | boolean | false | Specifies whether optional YUI modules found in |
-| | | | the ``/autoload/`` directories are not shipped to |
-| | | | the client. This is an optimization setting and |
-| | | | should generally only be set if you are building |
-| | | | an offline application. |
-+--------------------------------------------------------+----------------------+-------------------+--------------------------------------------------------+
| ``middleware`` | array of strings | [] | A list of paths to the Node.js module that exports |
| | | | a Connect middleware function. |
+--------------------------------------------------------+----------------------+-------------------+--------------------------------------------------------+
@@ -380,12 +386,6 @@ staticHandling Object
| | | | ``/static/``. An empty string can be given if no |
| | | | prefix is desired. |
+-----------------------+---------------+-----------------------------+--------------------------------------------------------+
-| ``useRollups`` | boolean | false | When true, the client will use the rollup file (if |
-| | | | it exists) to load the YUI modules in the mojit. |
-| | | | The command `mojito compile rollups <../reference/ |
-| | | | mojito_cmdline.html#compiling-rollups>`_ can be used |
-| | | | to generate the rollups. |
-+-----------------------+---------------+-----------------------------+--------------------------------------------------------+
.. _yui_obj:
@@ -397,28 +397,15 @@ See `Example Application Configurations`_ for an example of the ``yui`` object.
+--------------------------------+----------------------+------------------------------------------------------------------------+
| Property | Data Type | Description |
+================================+======================+========================================================================+
-| ``base`` | string | Specifies the prefix from which to load all YUI 3 libraries. |
-+--------------------------------+----------------------+------------------------------------------------------------------------+
| :ref:`config <yui_config>` | object | Used to populate the `YUI_config <http://yuilibrary.com/yui/docs/yui/ |
| | | #yui_config>`_ global variable that allows you to configure every YUI |
| | | instance on the page even before YUI is loaded. For example, you can |
| | | configure logging or YUI not to load its default CSS with the |
| | | following: ``"yui": { "config": { "fetchCSS": false } }`` |
+--------------------------------+----------------------+------------------------------------------------------------------------+
-| ``extraModules`` | array of strings | Specifies additional YUI library modules that should be added to |
-| | | the page when Mojito is sent to the client. |
-+--------------------------------+----------------------+------------------------------------------------------------------------+
-| ``loader`` | string | Specifies the path (appended to ``base`` above) for the loader to |
-| | | use. |
-+--------------------------------+----------------------+------------------------------------------------------------------------+
| ``showConsoleInClient`` | boolean | Determines if the YUI debugging console will be shown on the |
| | | client. |
+--------------------------------+----------------------+------------------------------------------------------------------------+
-| ``url`` | string | Specifies the location of the `YUI 3 seed file <http://yuilibrary.com/ |
-| | | yui/docs/yui/#base-seed>`_. |
-+--------------------------------+----------------------+------------------------------------------------------------------------+
-| ``urlContains`` | array of strings | Specifies the YUI modules that are delivered by ``url``. |
-+--------------------------------+----------------------+------------------------------------------------------------------------+
.. _yui_config:
@@ -563,7 +550,7 @@ In the example ``application.json`` below, the mojit instance ``father`` of type
Child Mojit With Children
#########################
-A parent mojit can have a single child that has its own children. The parent mojit
+A parent mojit can have a child that has its own children. The parent mojit
specifies a child with the ``child`` object, which in turn lists children in the
``children`` object. For the child to execute its children,it would use the ``Composite``
addon. See `Composite Mojits <../topics/mojito_composite_mojits.html#composite-mojits>`_
@@ -600,6 +587,48 @@ child ``son``, which has the children ``grandson`` and ``granddaughter``.
}
]
+The child mojits can also have their own children, but beware that
+having so many child mojits may cause memory issues. In our updated
+example ``application.json`` below, the ``grandaughter`` mojit now has
+its own children mojits:
+
+.. code-block:: javascript
+
+ [
+ {
+ "settings": [ "master" ],
+ "specs": {
+ "grandfather": {
+ "type": "GrandparentMojit",
+ "config": {
+ "child": {
+ "son": {
+ "type": "ChildMojit",
+ "children": {
+ "grandson": {
+ "type": "GrandchildMojit"
+ },
+ "grandaughter": {
+ "type": "GrandchildMojit",
+ "children": {
+ "girl_doll": {
+ "type": "GirlDollMojit"
+ },
+ "boy_doll": {
+ "type": "BoyDollMojit"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+
+
.. _deploy_app:
@@ -724,8 +753,8 @@ The table below describes the ``configuration`` object in ``definition.json``.
+==================+======================+===================+========================================================+
| ``appLevel`` | boolean | false | When set to ``true``, the actions, addons, assets, |
| | | | binders, models, and view of the mojit are |
-| | | | available to other mojits. Mojits wanting to use |
-| | | | the resources of application-level mojit must |
+| | | | *shared* with other mojits. Mojits wanting to use |
+| | | | the resources of the shared mojit must |
| | | | include the YUI module of the application-level |
| | | | mojit in the ``requires`` array. |
+------------------+----------------------+-------------------+--------------------------------------------------------+
@@ -849,7 +878,7 @@ the ``index`` function in the controller of the ``Foo`` mojit.
.. _configure_mj-routing:
-routing
+Routing
=======
In Mojito, routing is the mapping of URLs to specific mojit actions. This section
@@ -1080,7 +1109,7 @@ Using Parameterized Paths to Call a Mojit Action
Your routing configuration can also use parameterized paths to call mojit
actions. In the ``routes.json`` below, the ``path`` property uses parameters
to capture a part of the matched URL and then uses that captured part to
-replace ``{{mojit-action}}`` in the value for the ``call``property. Any
+replace ``{{mojit-action}}`` in the value for the ``call`` property. Any
value can be used for the parameter as long as it is prepended with a
colon (e.g., ``:foo``). After the parameter has been replaced by a value
given in the path, the call to the action should have the following syntax:
@@ -1122,7 +1151,7 @@ The following URLs call the ``index`` and ``myAction`` functions in the controll
Using Regular Expressions to Match Routing Paths
------------------------------------------------
-You can use the ``regex`` property of the ``routing`` object to define a key-value
+You can use the ``regex`` property of a routing object to define a key-value
pair that defines a path parameter and a regular expression. The key is prepended
with a colon when represented as a path parameter. For example, the key ``name``
would be represented as ``:name`` as a path parameter: ``"path": "/:name"``.
@@ -1197,7 +1226,7 @@ Accessing Configurations from Mojits
The model and binder can access mojit configurations from the ``init``
function. The controller and model are passed ``configuration`` objects. The controller
-can access configuration the ``actionContext`` object and the ``Config`` addon.
+can access configuration with the ``Config`` addon.
The ``init`` function in the binder, instead of a configuration object, is passed the
``mojitProxy`` object, which enables you to access configurations.
View
54 docs/dev_guide/intro/mojito_mvc.rst
@@ -39,7 +39,7 @@ Models are found in the ``models`` directory of each mojit. For the application
Naming Convention
-----------------
-The name of the model files depend on the affinity, which is the location
+The name of the model file depend on the affinity, which is the location
where a resource is available. Thus, the name of the model file is
``{model_name}.{affinity}.js``, where ``{affinity}`` can be ``common``,
``server``, or ``client``.
@@ -236,8 +236,6 @@ be the following:
...
});
-.. _mvc_models-structure:
-
.. _mvc-controllers-structure:
@@ -294,11 +292,10 @@ Example
-------
The example controller below shows you how the components are used. The
-``status`` mojit is registered with ``YUI.add`` and the ``init`` function
-stores the date so it can be used by other functions, and the ``this``
-reference allows the ``index`` function to call ``create_status``. Lastly,
-the ``requires`` array loads the addons ``Intl``, ``Params``, and ``Url``
-that are needed by the controller.
+``status`` mojit is registered with ``YUI.add``, and the ``index`` function
+uses the ``this`` reference to call the function ``create_status``. Lastly, the
+``requires`` array loads the addons ``Intl``, ``Params``, and ``Url``that are
+needed by the controller.
.. code-block:: javascript
@@ -320,7 +317,7 @@ that are needed by the controller.
return user + ': ' + status + ' - ' + time;
}
};
- }, '0.0.1', {requires: ['mojito-intl-addon', 'mojito-params-addon', mojito-url-addon']});
+ }, '0.0.1', {requires: ['mojito-intl-addon', 'mojito-params-addon', 'mojito-url-addon']});
.. _mvc-controllers-actions:
@@ -554,23 +551,26 @@ object as a parameter. The ``Error`` object is just the standard JavaScript
code that will be used if the error bubbles to the top of the
page (i.e., not caught by a parent mojit).
-In the code snippet below from ``controller.server.js``, the model is asked
-to get a blog post. The ``try-catch`` clause will catch any errors made calling
-``getPost``, and the ``error`` method will display the error message.
+In the code snippet below from ``controller.server.js``, the ``index``
+method uses the query string parameter ``company`` to fetch company information
+stored in a configuration file. The ``if-else`` clause either sends
+the company information to the ``index`` template or reports
+an error that information for the specified company could not be found.
.. code-block:: javascript
...
index: function(ac) {
- try {
- var post = ac.models.get('BlogModel').getPost();
- ac.done({ "post": post });
- } catch(e) {
- console.log(e);
- ac.error(e);
+ var company = ac.params.url('company'),
+ company_info = ac.config.get(company);
+ if (company_info) {
+ ac.done({ "company_info": company_info });
+ } else {
+ ac.error("Could not find info for " + company);
}
}
...
+ }, '0.0.1', {requires: ['mojito-params-addon', 'mojito-config-addon']});
.. _mvc-controllers-save_state:
@@ -590,15 +590,19 @@ have substituted values for the template tags.
Naming Convention
-----------------
-The naming convention of the templates is based on the controller function (action)
-that supplies data, the engine that renders the templates, and the device
-requesting the page. If the calling device is determined not to be a portable
-device such as a cell phone, the ``{device}`` element of the syntax below
-is omitted.
+Template files have the following naming convention:
+
+``{controller_function}.[{selector}].{rendering_engine}.html``
+
+The following list describes the elements of the template file name:
-**File Naming Convention for Templates:**
+- ``{controller_function}`` - the controller function (action)
+ that supplies data.
+- ``{selector}`` - an arbitrary string used to select
+ a specific template. For example, you could use the selector
+ ``iphone`` for the iPhone template.
+- ``{rendering_engine}`` - the engine that renders the templates.
-``{controller_function}.[{device}].{rendering_engine}.html``
For example, if the template is receiving data from the ``index`` function
of the controller and has Handlebars expressions that need to be rendered,
View
7 docs/dev_guide/reference/glossary.rst
@@ -51,13 +51,6 @@ assets
application. See `Mojito Developer Topics: Assets <../topics/mojito_assets.html>`_ to
learn how to use assets in Mojito applications.
-autoload
---------
-
- A directory of a Mojito application containing JavaScript files that use YUI modules
- added with ``YUI.add``. These files aren't actually *auto-loaded*, but are merely
- automatically included if required by a YUI module.
-
binder
------
View
8 docs/dev_guide/reference/mojito_troubleshooting.rst
@@ -18,8 +18,8 @@ Issues
called? <moj_binder_init>`
* :ref:`I am getting Handlebars rendering errors. Is this a client-side or server-side
issue with Handlebars and can it be fixed? <handlebars_rendering_error>`
-* :ref:`Why can't my controller access the YUI modules in the "autoload" directory?
- <controller_access_autoload>`
+* :ref:`Why can't my controller access the YUI modules in the "yui_modules" directory?
+ <controller_access_yui_modules>`
* :ref:`Why am I getting the error message "EADDRINUSE, Address already in use" when I try
to start Mojito? <eaddriuse_err>`
* :ref:`When I execute child mojits with "composite.execute", the views are being rendered,
@@ -148,9 +148,9 @@ prototype so that your templates can be rendered. Try doing the following:
------------
-.. _controller_access_autoload:
+.. _controller_access_yui_modules:
-**Q:** *Why can't my controller access the YUI modules in the "autoload" directory?*
+**Q:** *Why can't my controller access the YUI modules in the "yui_modules" directory?*
**A:**
A common problem is that the YUI module is missing the
View
8 docs/dev_guide/topics/mojito_assets.rst
@@ -248,14 +248,14 @@ the ``<meta>`` tag and the ``addCss`` method adds the device-specific CSS.
YUI Assets
==========
-YUI modules should be placed in the ``autoload`` directory and **not**
+YUI modules should be placed in the ``yui_modules`` directory and **not**
the ``assets`` directory. When your mojit code wants to use one of the YUI
-modules in the ``autoload`` directory, you add the module name in the
+modules in the ``yui_modules`` directory, you add the module name in the
``requires`` array, and Mojito will automatically load the module.
For example, to use a YUI module called ``substitute`` in your mojit
controller, you would place the ``substitute.js`` file in the
-``autoload`` directory and then add the module name in the ``requires``
+``yui_modules`` directory and then add the module name in the ``requires``
array as seen in the example mojit controller below.
.. code-block:: javascript
@@ -296,7 +296,7 @@ be a child of the `HTMLFrameMojit <../topics/mojito_frame_mojits.html#htmlframem
When you run ``mojito compile inlinecss``, the CSS files in
``/mojits/{mojit_name}/assets/`` are compiled into the YUI module
-``/mojits/{mojit_name}/autoload/compiled/inlinecss.common.js``.
+``/mojits/{mojit_name}/yui_modules/compiled/inlinecss.common.js``.
Mojito will use the compiled CSS and insert inline CSS into the ``<head>``
element of the rendered view. See also
`Compiling Inline CSS <../reference/mojito_cmdline.html#compiling-inline-css>`_.
View
116 docs/dev_guide/topics/mojito_extensions.rst
@@ -33,7 +33,7 @@ Addons allows you to do the following:
Creating New Addons
-------------------
-An addon is simply a JavaScript files that contains a YUI module. You can create
+An addon is simply a JavaScript file that contains a YUI module. You can create
addons at the application and mojit level. Application-level addons are
available to all mojits in the application, whereas, mojit-level addons are
only available to its mojit.
@@ -43,11 +43,11 @@ only available to its mojit.
Naming Convention
#################
-The name of an addon should have the following syntax where ``{addon_name}``
-is a unique YUI module name defined by the user and ``{affinity}`` is
-``server``, ``common``, or ``client``.
+The name of an addon should have the following syntax where ``{addon_namespace}``
+is the namespace of the addon and ``{affinity}`` is
+``server``, ``common``, or ``client``.
-``{addon_name}.{affinity}.js``
+``{addon_namespace}.{affinity}.js``
.. _extending_addons-loc:
@@ -70,11 +70,9 @@ Namespace of Addon
##################
To access addon methods and properties, you use the Action Context object
-(i.e., ``ac``) and the addon namespace. The namespace of an addon must be
-the same as ``{addon_name}`` in the addon file name ``{addon_name}.{affinity}.js``.
-For example, the namespace of the addon ``addons/ac/foo.common.js`` would be
-``foo``. Thus, to call the method ``save`` of the ``foo`` addon, you would
-use ``ac.foo.save``.
+(i.e., ``ac``) and the addon namespace. For example, the namespace of the
+addon ``addons/ac/foo.common.js`` would be ``foo``. Thus, to call the method
+``save`` of the ``foo`` addon, you would use ``ac.foo.save``.
See :ref:`Using Your Addon <extending_addons-using>` for an example
of how to call methods from the addon namespace.
@@ -85,22 +83,24 @@ of how to call methods from the addon namespace.
Writing the Addon
#################
-The ActionContext is a `YUI Base <http://developer.yahoo.com/yui/3/base/>`_
-object, and ActionContext addons are
-`YUI Plugins <http://developer.yahoo.com/yui/3/plugin/>`_. To create a new addon, you
-write a new YUI Plugin and register it with Mojito.
+The ActionContext object and ActionContext addons simulate the
+`YUI Base <http://developer.yahoo.com/yui/3/base/>`_ and
+`YUI Plugin <http://developer.yahoo.com/yui/3/plugin/>`_ infrastructure, so
+creating a new addon is similar to creating a new YUI Plugin.
-The addon must have the following:
+The addon must do the following:
-- registered plugin name, which is the string passed to ``YUI.add``
+- register a plugin name, which is the string passed to ``YUI.add``
- constructor with a ``prototype`` property
-- statement assigning the constructor to a namespace of ``Y.mojito.addons.ac``,
+- assign the constructor to a namespace of ``Y.mojito.addons.ac``,
so Mojito can access your addon
+- require the 'mojito' module, otherwise the namespace ``Y.mojito.addons.ac`` might
+ not be available (unless you use ``Y.namespace()``).
**Optional:** ``requires`` array to include other modules.
The code snippet below shows the skeleton of an addon with the registered
-plugin name (``'addon-ac-cheese'``) and the constructor (``CheeseAcAddon``) with its
-``prototype`` property:
+plugin name (``'addon-ac-cheese'``), the constructor (``CheeseAcAddon``) with its
+``prototype`` property, and requires the ``mojito`` module.
.. code-block:: javascript
@@ -125,7 +125,7 @@ plugin name (``'addon-ac-cheese'``) and the constructor (``CheeseAcAddon``) with
Y.mojito.addons.ac.cheddar = CheeseAcAddon;
// Optional: 'requires' array could include other
// YUI modules if needed.
- }, '0.0.1', {requires: ['']});
+ }, '0.0.1', {requires: ['mojito']});
.. _extending_addons-writing_ex:
@@ -174,7 +174,7 @@ added through the ``prototype`` property.
// so please be careful.
CheeseAcAddon.dependsOn = ['http'];
Y.mojito.addons.ac.cheddar = CheeseAcAddon;
- }, '0.0.1', {});
+ }, '0.0.1', {requires: ['mojito']});
.. _extending_addons-using:
@@ -287,7 +287,7 @@ Libraries
Mojito allows you to use YUI libraries, external libraries, or customized
libraries. To use any library in Mojito, you need to specify the module in
-either the ``requires`` array in the controller for YUI libraries or using
+either the ``requires`` array in the controller for YUI libraries or by using
the ``require`` method for Node.js modules.
.. _extending_libraries-yui:
@@ -318,63 +318,33 @@ Location of YUI Modules
Application-level YUI modules should be placed in the following directory:
-``{app_dir}/autoload/``
+``{app_dir}/yui_modules/``
Mojit-level YUI modules should be placed in the following directory:
-``{mojit_dir}/autoload/``
+``{mojit_dir}/yui_modules/``
-.. _libraries_yui-create:
-Creating a YUI Module
-#####################
-
-To create a YUI module, your code needs to have the following:
-
-- ``YUI.add`` statement to add the module to YUI
-- constructor for the module
-- methods created through the ``prototype`` object
-
-
-.. _yui_create-add:
-
-Adding the Module to YUI
-************************
-
-Your YUI module must have a ``YUI.add`` statement that adds the module to YUI.
-Below is the basic syntax of the ``YUI.add`` statement:
-
-``YUI.add('{module-name', function(Y){ ... }``
-
-For example, the ``send-photos`` YUI module would use the following:
-
-``YUI.add('send-photos', function(Y){ ... }``
-
-.. _yui_create-constructor:
-
-Constructor
-***********
-
-The constructor of a YUI module is basically a new namespace that is assigned a
-function. The new namespace is created with the following syntax:
-
-``Y.namespace('mojito').{constructor_name} = function() { ... }``
+.. _libraries_yui-using:
-For example, to create the constructor ``HELLO`` for a YUI module, you would
-could use the following:
+Using the YUI Module
+####################
-``Y.namespace('mojito').HELLO = function() { this.greeting="hello"; }``
+In the sections below, we provide an example YUI module and then show how
+to require and use that YUI module from a controller.
-.. _yui_create-ex:
+.. _yui_using-hello-uid:
-Example
-*******
+hello-uid Module
+****************
In the code example below, the ``create_id`` function becomes the constructor
for the ``UID`` namespace. This will let you create an instance, and the
``prototype`` object then allows you to access the method ``log`` from that
instance.
+``{mojit_dir}/yui_modules/hello-uid.server.js``
+
.. code-block:: javascript
YUI.add('hello-uid', function(Y){
@@ -386,19 +356,19 @@ instance.
log: function(user_name){
Y.log(user_name + "'s UID is " + '['+this.uid+']');
}
- }
+ };
Y.namespace('mojito').UID = create_id;
});
-.. _libraries_yui-using:
-Using the YUI Module
-####################
+Using the hello-uid Module
+**************************
In the example mojit controller below, the YUI module ``hello-uid`` is loaded
-because the module is in the ``requires`` array. An instance of the module
-is created and saved in the ``init`` function. With the saved instance, the
-``log`` method from the ``hello-uid`` module can be called:
+because the module is in the ``requires`` array. The ``log`` method can then be
+called from an instance (i.e., ``uid``) of the module.
+
+``{mojit_dir}/controller.server.js``
.. code-block:: javascript
@@ -421,7 +391,7 @@ Other Libraries
Non-YUI libraries can also be used at either the application or mojit level.
Because Node.js and **not** Mojito will read the contents of the library files,
-you need to use ``require()`` to include the library. Mojito will only confirm
+you need to use the function ``require`` to include the library. Mojito will only confirm
that the files exist.
.. _libraries_other-loc:
@@ -521,7 +491,7 @@ The name of the template should have the following syntax where
``{view_engine_name}`` should be the same as the ``{view_engine_name}`` in
the file name of the view engine addon.
-``{action}.[{device}].{view_engine_name}.html``
+``{action}.{view_engine_name}.html``
.. _extending_ve-loc:
View
5 docs/dev_guide/topics/mojito_frame_mojits.rst
@@ -227,11 +227,6 @@ dispatching the ``LazyLoadMoit`` as a proxy to the client. From the client,
your Mojito application to load the page quickly and then lazily load parts of
the page.
-.. _mojito_fw_mojits-lazyload:
-
-LazyLoadMojit
-=============
-
.. _fw_mojits_lazyload-how:
View
10 docs/dev_guide/topics/mojito_hosting_container_reqs.rst
@@ -39,7 +39,7 @@ server.js
.. code-block:: javascript
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
@@ -96,7 +96,7 @@ server.js
.. code-block:: javascript
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
@@ -166,7 +166,7 @@ and created an issue with at least one hosting container.
.. code-block:: javascript
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
@@ -215,7 +215,7 @@ index.js
.. code-block:: javascript
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
@@ -245,7 +245,7 @@ server.js
.. code-block:: javascript
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
72 docs/dev_guide/topics/mojito_logging.rst
@@ -2,11 +2,10 @@
Logging
=======
-Mojito has its own logging system. When you call ``Y.log`` from within your mojits, your
-log messages are intercepted and processed by Mojito. You can set logging levels
-to control the degree of detail in your log reports. You can also configure Mojito to
-enable log buffering, so performance during crucial runtime periods is not adversely
-affected.
+Mojito relies on YUI for logging. When you call ``Y.log`` from within your mojits, your
+log messages are handled by a YUI instance that Mojito creates based on YUI configurations
+defined in ``application.json`` or ``application.yaml``. You can set logging levels to
+control the degree of detail in your log reports.
.. _mojito_logging-levels:
@@ -22,9 +21,9 @@ Mojito has the following six log levels:
- ``error``
- ``none``
-All of them should be familiar except the last, which are framework-level messages that
-indicate that an important framework event is occurring (one that users might want to
-track).
+All of them should be familiar except ``mojito``, which is the logging level for
+capturing framework-level messages that indicate that an important framework event is
+occurring (one that users might want to track).
Setting a log level of ``warn`` will filter out all ``debug`` and ``info`` messages, while
``warn``, ``error``, and ``mojito`` log messages will be processed. To see all
@@ -39,34 +38,10 @@ The server and client log settings have the following default values:
- ``debug: true`` - turns logging on so that messages are displayed in the console.
- ``logLevel: "debug"`` - log level filter.
-- ``logLevelOrder: ['debug', 'mojito', 'info', 'warn', 'error', 'none']`` - the order of
- that log levels are evaluated.
+- ``logLevelOrder: ['debug', 'mojito', 'info', 'warn', 'error', 'none']`` - the order in
+ which the log levels are evaluated.
-.. logging_levels-define:
-
-Customizing the Log Level Order
--------------------------------
-
-You can reorder and create log levels with ``logLevelOrder`` property of the
-``yui.config`` object. In the example ``yui.config`` object below,
-the order of the log levels are switched for ``warn`` and ``info`` and
-the new log level ``danger`` is created.
-
-.. code-block:: javascript
-
- [
- {
- "settings": [ "master" ],
- "yui": {
- "config": {
- "debug": true,
- "logLevelOrder": [ "debug", "warn", "info", "error", "danger", "none" ]
- }
- },
- ...
- }
- ]
.. _mojito_logging-config:
@@ -194,7 +169,7 @@ We recommend that you pass the first three parameters to
- ``msg`` - the message to log
- ``cat`` - the log level or category, such as 'info', 'error', 'warn'
-- ``src`` - the module reporting the error
+- ``src`` - the name of the module reporting the error
In the example binder below, ``Y.log`` logs
a message at the ``info`` level and specifies the module
@@ -215,8 +190,31 @@ through ``NAME``, which in this case contains the value ``DemoBinderIndex``.
}, '0.0.1', {requires: ['mojito-client']});
+.. logging_levels-define:
+
+Customizing the Log Level Order
+-------------------------------
+
+You can reorder and create log levels with the ``logLevelOrder`` property of the
+``yui.config`` object. In the example ``yui.config`` object below,
+the order of the log levels is switched for ``warn`` and ``info`` and
+the new log level ``danger`` is created.
+
+.. code-block:: javascript
+
+ [
+ {
+ "settings": [ "master" ],
+ "yui": {
+ "config": {
+ "debug": true,
+ "logLevelOrder": [ "debug", "warn", "info", "error", "danger", "none" ]
+ }
+ },
+ ...
+ }
+ ]
-
.. _logging_custom-include_exclude_src:
@@ -228,7 +226,7 @@ of the ``yui.config`` object to include or exclude logging
from YUI modules of your application.
The configuration below excludes logging from the YUI module
-``FinanceModel``:
+``FinanceModelStocks``:
.. code-block:: javascript
View
2  docs/dev_guide/topics/mojito_resource_store.rst
@@ -1048,7 +1048,7 @@ The |RS| comes with the following four built-in addons:
- calculates the asset URL base for each mojit
- ``yui``
- registers new resource type ``yui-module`` found in the directories
- ``autoload`` or ``yui_modules``
+ ``yui_modules`` or ``autoload``
- registers new resource type ``yui-lang`` found in the ``lang`` directory
- calculates the ``yui`` metadata for resource versions that are YUI modules
- pre-calculates corresponding YUI module dependencies when resources are
View
4 docs/dev_guide/topics/mojito_testing.rst
@@ -18,9 +18,9 @@ Conventions
- ``{app_name}/tests`` - application tests
- ``{app_name}/mojits/{mojit_name}/tests`` - mojit tests
- - ``{app_name}/autoload/{yui_module}/tests`` - tests for
+ - ``{app_name}/yui_modules/{yui_module}/tests`` - tests for
application-level YUI modules
- - ``{app_name}/mojits/{mojit_name}/autoload/{yui_module}/tests`` - tests for
+ - ``{app_name}/mojits/{mojit_name}/yui_modules/{yui_module}/tests`` - tests for
mojit-level YUI modules
- Syntax for the name of the test file: ``{yui_module}.{affinity}-tests.js``
View
2  examples/developer-guide/adding_view_engines/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/adding_view_engines/server.js
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+* Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/binding_events/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/binding_events/mojits/PagerMojit/binders/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/binding_events/mojits/PagerMojit/controller.server.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/binding_events/mojits/PagerMojit/models/model.server.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/binding_events/server.js
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+* Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/configure_routing/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/configure_routing/mojits/RoutingMojit/controller.server.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/configure_routing/mojits/RoutingMojit/models/model.server.js
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/configure_routing/server.js
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
+* Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
View
2  examples/developer-guide/device_assets/index.js