Project

polyfillrb

0.0
No commit activity in last 3 years
No release in over 3 years
Provides user agent specific polyfills to the browser easily in ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
 Project Readme

Polyfillrb Code Climate

A simple ruby wrapper for the phenominal Polyfill.io Service by FTLabs for Rails applications.

How to use

The library provides a simple view helper to load in the polyfills. Simply in any view file add the polyfills call. Make sure to load it prior to running any other javascript. Here's an example app/views/layouts/welcome.erb:

<html>
  <head>
    <title>Welcome</title>
    <%= stylesheet_link_tag 'application', media: 'all' %>
    <%= csrf_meta_tokens %>
  </head>
  <body>
  
    <%= yield %>
    
    <%= polyfills %>
    <%= javascript_include_tag 'application' %>
  
  </body>
</html>

Installing

Add the gem to your Gemfile: gem "polyfillrb", "~>1.1.0"

Future Plans

  • Cache polyfills to avoid node IO calls (especially in production)
  • Ensure we are doing the most performant javascript executions.