Profile

Cover photo
Frederico Araujo
Works at SSH@home
Attends Assumption University
Lives in Bangkok, Thailand
100 followers|157,418 views
AboutPostsPhotosVideosReviews

Stream

Frederico Araujo

Shared publicly  - 
 
Has anybody tried setting up logging on Iron.io with Loggly?
Loggly only gives an https url, but it also allows to setup a UDP endpoint, but it needs the IP of the server to be added on authorized devices.
1
Add a comment...

Frederico Araujo

Shared publicly  - 
 
 
My Problem With Turbolinks

I made a few snarky comments about Turbolinks recently and figured I should write down my thoughts more clearly.

If you're not aware of Turbolinks, it captures all local links that look like HTML pages, makes an Ajax request for the content, and then replaces the body with the response's body. It does a few other clever things, like extracting and replacing the title, and executing scripts in the response.

Overall, it's a clever way to get some increased speed while still using a traditional server-rendered-HTML architecture.

Caveats

Like any other solution, it comes with some caveats.

Probably the most important one is that normal HTML-rendered pages have their own clean global scope every time a new page is rendered.

This is not a mere quibble: a lot of existing JavaScript operates under the assumption of a clean scope, and a single DOMContentLoaded event. In a perfect world, popular JavaScript plugins would be architected to work well with a solution like Turbolinks, but the assumption of a clean global scope per server-rendered HTML page is baked into a lot of the JavaScript and jQuery libraries that people tend to use.

It is possible to deal with problems like this on a case-by-case basis (see https://github.com/rails/turbolinks/issues/87, for example), but in my opinion, this is going to end up in a game of whack-a-mole as each new patch breaks other valid use-cases.

At the end of the day, unless Turbolinks can perfectly emulate the browser's behavior, attempts to use Turbolinks with third-party JavaScript will either fail often or require an ever-growing library that handles more and more targeted edge-cases.

jQuery Turbolinks (https://github.com/kossnocorp/jquery.turbolinks) is a good example of something that tries to make the solution more transparent,  but introduces problems as it now triggers ready callbacks multiple times, and idempotence is not typically a requirement of ready handlers. I encourage you to review the open and closed issues on these projects to get a sense of the specific kinds of problems that can occur.

The Good

That said, for applications that are willing to carefully think through the requirements of Turbolinks, this solution does provide a nice transitional way to keep building applications without a lot of architectural changes with improved speed.

If you are thinking about using Turbolinks, make sure:

• Your JavaScript is designed to be long-lived across many different
  HTML pages without a refresh
• Your refresh handlers are idempotent. Don't register event handlers
  or other bindings in a refresh handler unless you reliably tear them down.
• You audit all third-party code that you use to make sure that they do not
  rely on DOM Ready events, or if they do, that they DOM Ready events are
  idempotent. If you don't feel comfortable auditing and cleaning up
  third-party code, don't use any. (note that the "turbolinks community",
  such as it is, might vet existing libraries for compliance, and that would
  help).
1
Add a comment...
Have him in circles
100 people
songrit leemakdej's profile photo
Michelle Crofts's profile photo
Tony O'Connell's profile photo
Frederico Araujo's profile photo
Jumpot Sangchantrarin's profile photo

Frederico Araujo

Shared publicly  - 
 
Slim Bean 4.2.2 Build4 Release. Featuring Wi-Fi IBSS (Ad-Hoc) and SlimPIE
 
Guys... SlimBean 4.2.2 Build 4 Released! Enjoy!
1
Add a comment...
People
Have him in circles
100 people
songrit leemakdej's profile photo
Michelle Crofts's profile photo
Tony O'Connell's profile photo
Frederico Araujo's profile photo
Jumpot Sangchantrarin's profile photo
Work
Occupation
Sysadmin and Ruby programmer
Employment
  • SSH@home
    Sysadmin and Ruby programmer, present
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Bangkok, Thailand
Previously
Brasilia, Brazil - Santiago, Chile
Story
Tagline
Ruby on Rails developer, HTML5/CSS3 designer, Linux SysAdmin
Introduction
Im a Linux and Network Sysadmin. 
Ruby on Rails web developer, deploy rails stacks. 
I use Chef to manage and model servers.
Ruby, vim and ssh is all I need. 
Education
  • Assumption University
    Computer and Networking Engineer, 2002 - present
Basic Information
Gender
Male
Birthday
June 11
Other names
Fred
had a nice stay, it's a budget hotel, worth the bucks. the breakfast was great, the staff very friendly and helpful, well come back for sure.
Quality: ExcellentFacilities: ExcellentService: Excellent
Public - 2 years ago
reviewed 2 years ago
1 review
Map
Map
Map