Git Product home page Git Product logo

asset_hat's People

Contributors

caseydreier avatar jsonperl avatar philnash avatar rondevera avatar saulius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asset_hat's Issues

AssetHat::CONFIG_FILEPATH inconsistencies

When running the asset_hat:config task, I'm getting "No such file or directory" errors. The path in the error is similar to:

/[ path to app root ]/[ path to app root AGAIN ]/config/assets.yml

Looking around, I found that AssetHat::CONFIG_FILEPATH is defined to be the absolute path to the config file in RAILS_ROOT:

CONFIG_FILEPATH = File.join(RAILS_ROOT, 'config', 'assets.yml')

But then, in asset_hat/tasks.rb (asset_hat:config), the target file path is defined as RAILS_ROOT joined with AssetHat::CONFIG_FILEPATH. Thus the RAILS_ROOT is being appended twice:

target_filepath = File.join(RAILS_ROOT, AssetHat::CONFIG_FILEPATH)

unitialized constant Rails::Plugin::AssetHatHelper (Rails 2.2.2)

Anyone got this working with Rails 2.2.2 ?

I get unitialized constant Rails::Plugin::AssetHatHelper

uninitialized constant Rails::Plugin::AssetHatHelper
/Users/barmstrong/NetBeansProjects/viper/vendor/rails/activesupport/lib/active_support/dependencies.rb:102:in `const_missing'
/Users/barmstrong/NetBeansProjects/viper/vendor/gems/asset_hat-0.3.0/rails/init.rb:1:in `evaluate_init_rb'

Requires at least one CSS package

I have an application that has some javascripts but no css files (at all). This causes rake asset_hat:minify to abort, since it requires at least one css package.

I'm aware that this use case is very unusual, however a nicer way to handle this situation other than create an empty css file would be appreciated :)

Deprecation warnings on tasks

Getting the following deprecation warnings, should be an easy fix. I can submit a pull request if you want. Let me know.

WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/css.rb:5:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/css.rb:21:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/css.rb:43:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/css.rb:68:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/css.rb:158:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/js.rb:5:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/js.rb:34:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks/js.rb:107:in `block (2 levels) in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
at /home/deploy/shared/bundle/ruby/1.9.1/gems/asset_hat-0.4.1/lib/asset_hat/tasks.rb:7:in `block in <top (required)>'

js files are returned with MIME-type of application/javascript, which by default is not one of the MIME-types generally set up for Apache mod_deflate

All the .js or .min.js (bundle) files returned by AH appear to come back with the MIME-type of application/javascript.

My Apache configuration is currently not set up to compress these types of files.

  1. Is application/javascript a preferred or more standards-compliant MIME-type for Javascript than text/javascript or application/x-javascript?

  2. If so, is there any harm in me adding application/javascript to the list of MIME types available for compression by Apache? I can't imagine there would be since all of the other JS MIME types are in there, but I thought I would ask.

Many thanks.

Switch to MD5-based cache buster in filename

Currently, cache busting is managed by adding a bundle's latest Git SHA to the query string. Two problems:

  • Some CDNs fail to recognize cache busters in query strings.
  • This assumes that Git is being used for version control.

Change from application.min.css?a1b2c3 to application-a1b2c3.min.css (like in Rails 3.1), and drop Git SHAs in favor of MD5 fingerprints.

"vendor" libs must be specified as symbols in include_js, while standalone files must be strings

There needs to be some standard symbolizing or stringifying in AssetHat. If you want to pull jquery or prototype from the Google CDN, you must use symbols (:jquery, :prototype) to specify them. In addition, it appears that you must use strings for non-vendor JS that you are pulling in.

Not sure if this applies to bundle names or not. But it's confusing that there are two different ways that you have to specify libraries in the include_js call.

Add support for more CSS/JS minifers

To keep the AssetHat gem lightweight, this should not just add gem dependencies for various other minifiers -- this would make installation very slow.

As we chatted about, the setup process in a host app should instead be:

  1. Update Gemfile to include your minifier of choice.
  2. Update assets.yml to use the AssetHat engine for that minifier.

In this way, an "AssetHat engine" is essentially an adapter -- it provides a universal interface for using any minifier. AssetHat would contain a bunch of engines out of the box, and to use one, just add the corresponding minifier to your Gemfile.

Out of the box, AssetHat should still support weak and cssmin for CSS, and weak and jsmin for JS. These are lightweight, pure Ruby, and have few/no other dependencies.

https support

Asset Hat should us https:// urls for hosted Javascript when we're serving the page over https.
Otherwise browser complains about non-secure elements. Not sure if all external resources that are means to be used by asset hat have https version, but I'm sure google stuff does

Heroku support

Hi,

Thanks for making it an opensource gem.

Just wanted to check if you guys had any experience in using this gem in heroku?

If not I might actually test it and check if its compatible with heroku infrastructure (no write access on the server).

Thanks,
Ajay

Documentation error in "Advanced Configuration" section?

Is this a mistake?

"By default, vendor JS will load from Google's CDN in production (or any environment where config.action_controller.consider_all_requests_local is set to true)"

Shouldn't that be "false" instead of "true"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.