README.md in pagelet_rails-0.1.0 vs README.md in pagelet_rails-0.1.1

- old
+ new

@@ -1,18 +1,20 @@ # PageletRails -[Demo](https://polar-river-18908.herokuapp.com) +[![Gem Version](https://badge.fury.io/rb/pagelet_rails.svg)](https://badge.fury.io/rb/pagelet_rails) ## Why? * Do you have pages with a lot of information? * The pages where you need to get data from 5 or 10 different sources? * What if one of them is slow? * Does this mean your users have to wait? Don't make your users wait for page to load. +[View Demo Project](https://polar-river-18908.herokuapp.com) + ## Example ![](https://camo.githubusercontent.com/50f4078cc4015e3df89afc753a5ff79828ac0e8e/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f662e636c2e6c792f6974656d732f303031323133314d324b3147335831483276314f2f313433303033383036373738372e6a7067) For example let's take facebook user home page. It has A LOT of data, but it loads very quickly. How? The answer is [perceived performance](https://en.wikipedia.org/wiki/Perceived_performance). It's not about in how many milliseconds you can serve request, but how fast it **feels** to the user. @@ -49,10 +51,24 @@ Or install it yourself as: ```bash $ gem install pagelet_rails ``` +## Setup + +Include small javascript extension `pagelet_rails`: + +```js +// file app/assets/javascripts/application.js + +//= require jquery +//= require jquery_ujs +// ... +//= require pagelet_rails + +```` + ## Structure ``` app ├── pagelets @@ -60,11 +76,11 @@ │ │ ├── current_time_controller.rb │ │ ├── views │ │ │ ├── show.erb ``` -## Example +## Example Usage ```ruby # app/pagelets/current_time/current_time_controller.rb class CurrentTime::CurrentTimeController < ApplicationController include PageletRails::Concerns::Controller @@ -76,11 +92,10 @@ def show end end ``` - ```erb <!-- Please note view path --> <!-- app/pagelets/current_time/views/show.erb --> <div class="panel-heading">Current time</div> @@ -96,11 +111,23 @@ ```erb <!-- app/views/dashboard/show.erb --> <%= pagelet :pagelets_current_time %> ``` - + +## Documentation + +- [Pagelet view helper](#pagelet-view-helper) +- [Pagelet options](#pagelet-options) +- [Inline routes](#inline-routes) +- [Pagelet cache](#pagelet-cache) +- [Advanced functionality](#advanced-functionality) + - [Partial update](#partial-update) + - [Streaming](#streaming) + - [Super smart caching](#super-smart-caching) + - [Ajax Batching](#ajax-batching) + ## Pagelet view helper `pagelet` helper allows you to render pagelets in views. Name of pagelet is its path. For example pagelet with route `pagelets_current_time_path` will have `pagelets_current_time` name. @@ -379,24 +406,16 @@ There will be one request per group. Missing value is considered a separate group as well. ## Todo -* package as gem -* assets support -* ~~batch request~~ - * ~~each pagelet makes a separate http call, it's very inefficient for pages with many pagelets. Goal is to group multiple pagelets into single http request.~~ -* ~~streaming of components at the end of body~~ - * ~~goal is to serve the page with placeholders but hold connection and render pagelets in the same request before `</body>` tag~~ -* ~~partial updates~~ -* ~~turbolinks support~~ -* ~~smart caching~~ * delay load of not visible pagelets (aka. below the fold) * do not load pagelets which are not visible to the user until user scrolls down. For example like Youtube comments. * fix streaming with nested layouts (rails bug?) +* add rails 4 support +* high test coverage +* update actionpack-action_caching gem to support rails 5 -## Contributing -Contribution directions go here. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).