2017 © Pedro Peláez
 

library turbolinks

Helthe Turbolinks Component

image

helthe/turbolinks

Helthe Turbolinks Component

  • Thursday, January 4, 2018
  • by carlalexander
  • Repository
  • 11 Watchers
  • 102 Stars
  • 67,440 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 20 Versions
  • 4 % Grown

The README.md

Helthe Turbolinks Build Status Scrutinizer Quality Score

Helthe Turbolinks is a direct port of the rails turbolinks gem for projects using the Symfony HttpFoundation Component., (*1)

Versions

Current versions of the following gems are used:, (*2)

  • turbolinks: v5.0.0

Performance

Turbolinks makes following links in your web application faster. Instead of letting the browser recompile the JavaScript and CSS between each page change, it keeps the current page instance alive and replaces only the body and the title in the head., (*3)

Performance improvements will vary depending on the amount of CSS and Javascript you are using. You can get up to a 2X increase when using a lot of Javascript and CSS. You can find the rails benchmarks here., (*4)

Installation

Using Composer

Manually

Add the following in your composer.json:, (*5)

{
    "require": {
        // ...
        "helthe/turbolinks": "~4.0"
    }
}

Using the command line

$ composer require 'helthe/turbolinks=~4.0'

Usage

Using turbolinks requires both the usage of the javascript library and modifying the PHP response so that it can be properly processed by turbolinks., (*6)

PHP

There are multiple ways to decorate the PHP response for turbolinks., (*7)

Manually

You can manually decorate the response with the Turbolinksobject., (*8)

<?php
use Helthe\Component\Turbolinks\Turbolinks;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

// ...

$turbolinks = new Turbolinks();
$turbolinks->decorateResponse($request, $response);

Event Listeners

You can add an event listener to the dispatcher that is passed to the HttpKernel., (*9)

<?php
use Helthe\Component\Turbolinks\EventListener\TurbolinksListener;
use Helthe\Component\Turbolinks\Turbolinks;

// ...

// Symfony\Component\EventDispatcher\EventDispatcherInterface
$dispatcher->addSubscriber(new TurbolinksListener(new Turbolinks()));

Stack Middleware

You can decorate the response using the supplied Stack middleware., (*10)

<?php
use Helthe\Component\Turbolinks\StackTurbolinks;
use Helthe\Component\Turbolinks\Turbolinks;

// ...

$app = new StackTurbolinks($app, new Turbolinks());

Javascripts

Both the original coffeescript version and compiled version of each script are available for use., (*11)

Using turbolinks.js

To enable turbolinks, all you need to do is add the compiled turbolinks javascript to your layout in the <head>section., (*12)

The goal of the component is to offer a base package for integration with other PHP projects using the Symfony HttpFoundation or HttpKernel components., (*13)

You can do so by either using the supplied middleware that follows the Stack convention or by adding the supplied event listenter to the HttpKernel event dispatcher., (*14)

Instead of copying over the compiled javascripts to your projects, try to use your project tools to copy them over. You should always be able to fallback on the composer script hooks like post-install-cmd and post-update-cmd., (*15)

List of integrations

Compatibility

The turbolinks javascript is designed to work with any browser that fully supports pushState and all the related APIs. This includes Safari 6.0+ (but not Safari 5.1.x!), IE10, and latest Chromes and Firefoxes., (*16)

Do note that existing JavaScript libraries may not all be compatible with Turbolinks out of the box due to the change in instantiation cycle. You might very well have to modify them to work with Turbolinks' new set of events. For help with this, check out the Turbolinks Compatibility project., (*17)

Additional Resources

Please refer to the turbolinks project if you require additional information on the javascript libraries and their usage., (*18)

Bugs

For bugs or feature requests, please create an issue., (*19)

The Versions

04/01 2018

dev-master

9999999-dev https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks

04/01 2018

2.1.0

2.1.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks

20/01 2017

2.0.0

2.0.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks

28/07 2016

1.5.0

1.5.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

10/12 2014

1.4.3

1.4.3.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

14/11 2014

1.4.2

1.4.2.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

29/10 2014

1.4.1

1.4.1.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

07/10 2014

1.4.0

1.4.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

02/09 2014

1.3.4

1.3.4.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

23/08 2014

1.3.3

1.3.3.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

20/08 2014

1.3.2

1.3.2.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

07/08 2014

1.3.1

1.3.1.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

08/07 2014

1.3.0

1.3.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

09/04 2014

1.2.4

1.2.4.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

13/02 2014

1.2.3

1.2.3.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

02/02 2014

1.2.2

1.2.2.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

30/01 2014

1.2.1

1.2.1.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

30/01 2014

1.2.0

1.2.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carl Alexander

turbolinks jquery.turbolinks

11/01 2014

1.1.0

1.1.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

by Carl Alexander

turbolinks jquery.turbolinks

24/12 2013

1.0.0

1.0.0.0 https://helthe.co

Helthe Turbolinks Component

  Sources   Download

MIT

The Requires

 

by Carl Alexander

turbolinks jquery.turbolinks