igrigorik / closure-sprockets Goto Github PK
View Code? Open in Web Editor NEWSprockets processor for Google's Closure tools
Home Page: http://www.igvita.com/2011/08/16/rails-3-asset-pipeline-google-closure/
Sprockets processor for Google's Closure tools
Home Page: http://www.igvita.com/2011/08/16/rails-3-asset-pipeline-google-closure/
If a path or filename has an uppercase letter, it will not be found due to the downcasing that happens in directive_processor.rb. Is there a reason for the downcasing?
I'm seeing Closure's base.js doing an import of deps.js. This, in turn, seems to trigger a loop, whereby deps.js is being imported infinitely. I can get around it by setting CLOSURE_NO_DEPS to true.
Wondering if you had encountered this? I used your readme example on a bare Rails project.
I'm trying to use closure-sprockets outside of Rails and noticed that all classes are defined at the top-level.
Just trying to set this up on a fairly new project to play with closure.
I'm getting the following routing error...
ActionController::RoutingError (No route matches [GET] "/deps.js")
Looking at the source, the following line is being put into the head after my first call to goog.require()...
<script type="text/javascript" src="deps.js"></script>I assume this should be routed to something like src="assets/deps.js"; however, I'm not sure what the "right" approach is for this with the asset pipeline and vendor dir.
Using Rails 4.1.7, Sprockets 2.11.3 gives this error when running rake assets:precompile
. Note: this only happens when using the latest source from github. e.g.
gem "closure-sprockets", :github => "igrigorik/closure-sprockets"
Instead of having the user to explicitly initialize the variables in the head section.
How do I test my changes?
I'm seeing this error only on an OSX install:
"Sprockets::CircularDependencyError
vendor/assets/javascripts/closure-library/closure/goog/base.js has already been required"
Merely including application.js in my layout triggers it. Even if application.js doesn't provide or require anything. As far as I can tell, the OSX installation is exactly the same as my Linux installation, but it's working fine on Linux.
Using latest closure-sprockets in my Gemfile via "gem 'closure-sprockets', :git=>'git://github.com/igrigorik/closure-sprockets.git'". Getting "Unexpected token '<'" error on soyutils.js. Appears to be an HTML file instead of JS.
Since closure compiler supports Source Maps, it would be great to have these automatically linked/generated when using the rails asset pipeline.
Current approach is simplistic and works for small / trivial apps, but will break on circular require's, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.