You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+26-36Lines changed: 26 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,3 @@
1
-
**The [Thorax Yeoman generator](https://github.com/walmartlabs/generator-thorax) is presently under active development and is the best way to get started with Thorax. The docs here will be updated shortly to reflect this.**
2
-
3
1
# Thorax
4
2
5
3
[](https://saucelabs.com/u/thorax)
-Clone the [Seed Project](http://github.com/walmartlabs/thorax-seed) and start building your own application.
9
+
-Generate your application using the [Thorax Yeoman Generator](https://github.com/walmartlabs/generator-thorax)
12
10
- Read about how Thorax works in the new [Backbone Fundamentals Book](http://addyosmani.github.com/backbone-fundamentals/#thorax).
13
11
- Install the [Thorax Inspector](https://chrome.google.com/webstore/detail/thorax-inspector/poioalbefcopgeaeaadelomciijaondk) Chrome extension.
14
12
- Building something smaller? Just link the [core library](http://github.com/walmartlabs/thorax) as a [single file from cdnjs](http://cdnjs.cloudflare.com/ajax/libs/thorax/2.0.0rc6/thorax.js) compiled with all of its dependencies and use it anywhere or play with our [Hello World fiddle](http://jsfiddle.net/KRuPZ/) or [Todos fiddle](http://jsfiddle.net/mZzhy/).
@@ -157,20 +155,20 @@ Then in your template:
157
155
})
158
156
layout.setView(view);
159
157
160
-
## Server Side Render
158
+
## Server Side Rendering
161
159
162
160
Thorax allows for rendering outside of the normal browser context using environments such as [Fruit Loops][fruit-loops] or [PhantomJS][phantomjs] to render content in the initial server response and then restore the view hierarchy on the client render. Rendering in such a manner allows for Thorax applications to expose their content for SEO purposes as well as speed up the perceived initial page load.
163
161
164
-
The restore process is well suited for handling distinctions between user and public data, allowing for the server response to include only public, long cacheable, content. The client can then augment this data with any user specific data on restoration.
162
+
The restore process is well suited for handling distinctions between user and public data, allowing for the server response to include only public, long cache-able, content. The client can then augment this data with any user specific data on restoration.
165
163
166
164
167
165
# Getting Started
168
166
169
167
## Tutorials
170
168
171
-
### [From zero to todos](https://github.com/walmartlabs/thorax-seed/blob/master/README.md)
Did you enjoy the [screencast](http://vimeo.com/60230630)? Learn how to build your own simple todos app from scratch, with [step by step explanations](https://github.com/walmartlabs/thorax-seed/blob/master/README.md) of how the app was built.
171
+
Using the Thorax Generator, you can generate a Todos example application. You can also generate a blank application and build it out to match the Todos example app. This is a great way to learn by doing.
174
172
175
173
### [Thorax in Backbone Fundamentals](http://addyosmani.github.com/backbone-fundamentals/#thorax)
176
174
@@ -185,15 +183,11 @@ See the [TodoMVC Thorax implementation](http://addyosmani.github.com/todomvc/lab
185
183
186
184
## Resources
187
185
188
-
### Seeds
186
+
### Thorax Yeoman Generator
189
187
190
-
Cloning a seed is the easiest way to get started building your own project.
188
+
The [Thorax Generator](https://github.com/walmartlabs/generator-thorax) will ask you questions before generating a new blank or predefined base project. This is the recommended way to get started.
-[Standalone / HTML only Seed (zip)](https://github.com/walmartlabs/thorax-boilerplate/blob/master/standalone.zip?raw=true)
190
+
The [Thorax Generator](https://github.com/walmartlabs/generator-thorax) also provides it's own extensive documentation and aims to help you understand how to setup a full stack Thorax application, including a minimal node express server and deployment instructions.
197
191
198
192
### Bower component
199
193
@@ -220,10 +214,6 @@ Thorax is available on [cdnjs](http://cdnjs.com/), each build includes jQuery 1.
-[Thorax Mobile (compressed)](http://cdnjs.cloudflare.com/ajax/libs/thorax/2.0.0rc6/thorax-mobile.min.js)
222
216
223
-
### Chrome Inspector Extension
224
-
225
-
Chrome users can install the [Thorax Inspector](https://chrome.google.com/webstore/detail/thorax-inspector/poioalbefcopgeaeaadelomciijaondk) Chrome extension which will allow you to inspect any element and see the associated Thorax views, models and collections that may be bound. The [Thorax Seed](https://github.com/walmartlabs/thorax-seed) also integrates the [thorax-inspector](https://npmjs.org/package/thorax-inspector) npm package which allows you to open files in your project that relate to a given element, directly from Chrome.
226
-
227
217
### Playground
228
218
229
219
When combined with CoffeeScript small Thorax apps can be written in a single file. This is ideal for creating small test apps within [JSFiddle](http://jsfiddle.net/). Thorax can be selected as a framework (near the bottom of the list) in any fiddle, or you can try out any of the fiddles below:
@@ -270,7 +260,7 @@ If a `name` property is passed to any Thorax classes' `extend` method the result
270
260
271
261
### templates *Handlebars.templates*
272
262
273
-
A hash of templates, used by various Thorax helpers. If using the Lumbar or Rails boilerplate projects or the [Thorax Seed](http://github.com/walmartlabs/thorax-seed) this hash will be automatically generated from the files in your `templates` directories. To manually add a template to the hash:
263
+
A hash of templates, used by various Thorax helpers. If using the Lumbar or Rails boilerplate projects or the [Thorax Generator](https://github.com/walmartlabs/generator-thorax) this hash will be automatically generated from the files in your `templates` directories. To manually add a template to the hash:
@@ -1378,7 +1368,7 @@ By default this calls `Thorax.onException` when an exception is thrown but imple
1378
1368
1379
1369
Immediately executed version of `bindSection`. The default implementation delegates to `bindSection`.
1380
1370
1381
-
# Server Rendering
1371
+
##Server Rendering
1382
1372
1383
1373
Server side rendering relies can be performed in any environment that supports the `$` API as well as a few core APIs used to control the page life cycle.
1384
1374
@@ -1388,7 +1378,7 @@ Server side rendering relies can be performed in any environment that supports t
1388
1378
1389
1379
[Fruit Loops][fruit-loops] provides this functionality out of the box but this can be added to other environments with relative ease.
1390
1380
1391
-
## Restore Process
1381
+
###Restore Process
1392
1382
1393
1383
The restore process involves walking the DOM hierarchy looking for nodes that are annotated with the `data-view-restore` attribute. When such a node is found Thorax will attempt to restore based on a variety of steps discussed in the [Restore Methods](#restore-methods) section below.
1394
1384
@@ -1407,7 +1397,7 @@ The application restore process might look something like:
1407
1397
1408
1398
Followed by normal controller execution, ultimately culminating in `setView` call, which will restore the rendered child.
1409
1399
1410
-
## Restore Methods
1400
+
###Restore Methods
1411
1401
1412
1402
There is no definitive algorithm for restoring views, instead the following heuristics are used. In the event of a mismatch the `restore:fail` event will be emitted on the candidate view with additional debugging information regarding what portion of the heuristic failed.
1413
1403
@@ -1484,57 +1474,57 @@ Since pending fetch operations might rerender the content of a just restored vie
1484
1474
1485
1475
Note that there are issues that might arise if a different model data source is used on the client vs. the server, a personalized vs public data source for example. When such data is loaded prior to the restore operation, it might be necessary to provide a custom restore step that checks if this data has changed and rerender as there is no clean way for Thorax to determine if a model's data has changed between the two states.
1486
1476
1487
-
# Error Codes
1477
+
##Error Codes
1488
1478
1489
-
## button-trigger
1479
+
###button-trigger
1490
1480
1491
1481
`button` helper must have a method name as the first argument or a 'trigger', or a 'method' attribute specified.
1492
1482
1493
-
## link-href
1483
+
###link-href
1494
1484
1495
1485
`link` helper requires an href as the first argument or an `href` attribute.
1496
1486
1497
-
## collection-element-helper
1487
+
###collection-element-helper
1498
1488
1499
1489
`collection-element` helper must be declared inside of a `CollectionView`
1500
1490
1501
-
## super-parent
1491
+
###super-parent
1502
1492
1503
1493
Cannot use `super` helper when parent has no name or template.
1504
1494
1505
-
## view-helper-hash-args
1495
+
###view-helper-hash-args
1506
1496
1507
1497
Hash arguments are not allowed in the `view` helper as templates should not introduce side effects to view instances.
1508
1498
1509
-
## layout-element-helper
1499
+
###layout-element-helper
1510
1500
1511
1501
`layout-element` helper must be used within a `LayoutView`.
1512
1502
1513
-
## mixed-fetch
1503
+
###mixed-fetch
1514
1504
1515
1505
Both `set` and `reset` were passed to `fetch`, must use one or the other.
1516
1506
1517
-
## nested-render
1507
+
###nested-render
1518
1508
1519
1509
`render` was called which triggered an event handler which in turn called `render`. Infinite recursion was halted.
1520
1510
1521
-
## handlebars-no-data
1511
+
###handlebars-no-data
1522
1512
1523
1513
Handlebars template compiled without data, use: `Handlebars.compile(template, {data: true})`
1524
1514
1525
-
## insert-destroyed
1515
+
###insert-destroyed
1526
1516
1527
1517
A helper view that has been destroyed was inserted into the view.
1528
1518
1529
-
## void-tag-content
1519
+
###void-tag-content
1530
1520
1531
1521
A void tag such as `img` was rendered with `content` in `Thorax.Util.tag`.
1532
1522
1533
-
## server-marshal-object
1523
+
###server-marshal-object
1534
1524
1535
1525
A complex object was serialized without a proper context path to lookup the object on the client side. See [Thorax.ServerMarshal](#thoraxservermarshal) for more discussion on context paths.
1536
1526
1537
-
## fn-view-unregistered
1527
+
###fn-view-unregistered
1538
1528
1539
1529
`$.view` found a view element that was inserted manually into the DOM and was not registered with `_addChild` or `retain`. Call `parent._addChild(view)` or `view.retain()` on view insertion or instantiation.
0 commit comments