edgecase / dieter

Asset pipeline ring middleware
134 stars 22 forks source link

Sass / SCSS support #46

Closed anaisbetts closed 10 years ago

anaisbetts commented 11 years ago

There are almost certainly a million things wrong with this, and this PR comes with a ton of caveats, but I've added Sass/SCSS support to Dieter via loading the official compiler in JRuby.

Thoughts? Comments? Damn that's a lot of ones and zeros just to support SCSS?

pbiggar commented 11 years ago

We had a giant clusterfuck running JRuby and Clojure together at CircleCI, but it seems to make sense here, and I wouldn't expect you to have the same problems we did (which came from multiple Ruby run-times in the same JVM). So while using JRuby for this sets of my spidey-sense, I think its fine. Also, there are probably other languages that need Ruby to compile them.

However, the submodule is a problem I think. Is it? I guess I'm not sure. Why is it necessary?

anaisbetts commented 11 years ago

@pbiggar I could certainly just copy-paste the current version of Sass in the resources directory (I wanted to use a Gem file but I don't think JRuby can directly load .gem files like that), but I figured it'd be easier to keep up-to-date on Sass when it's got real version information instead of just "Bindropped Sass vX.Y.Z".

If you guys want to just copy Sass in (and maybe prune some unnecessary things like docs), I can do that too

jxa commented 11 years ago

JRuby is a pretty serious dependency to introduce into dieter core. (though Rhino and v8 are no lightweights either) I think I'd rather see this as a plugin. See https://github.com/edgecase/dieter-ember as an example of how you can write one.

anaisbetts commented 11 years ago

@jxa Disk space is cheap :) If we made it so that loading JRuby was deferred unless you actually used it (so that people who didn't use it don't take the startup time hit), would that be better?

jxa commented 11 years ago

@xpaulbettsx deferring jruby load would definitely make it more palatable.

Did you try loading the sass gem file? After a bit of googling I came across this somewhat dated article http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar/ but I haven't tried doing it myself.

I think bundling the gem would be the best way to distribute it.

anaisbetts commented 11 years ago

deferring jruby load would definitely make it more palatable.

Cool, lemme give that a go.

I think bundling the gem would be the best way to distribute it.

Yeah, that's way better than a lame Submodule!

monsanto commented 11 years ago

Is this feature still in development/considered for merging? SASS is the primary reason I would use this tool

anaisbetts commented 11 years ago

@monsanto It's on my list, I totally spaced on it though

kendagriff commented 11 years ago

+1

gpg0 commented 10 years ago

+1

devth commented 10 years ago

:+1:

anaisbetts commented 10 years ago

This is a bajillion years old and someone almost certainly should redo it. Alas alack, that person is probably not me

fasterthanlime commented 9 years ago

Made a plugin for it, based on the code here & the ember plugin:

It's my first Clojure project, so feedback is welcome :)

(For instance, it seems nobody actually has versions like 0.0.1 - do people start at 0.1.0 ? I would've started at 0.4.0 to stay in sync with dieter, or I could've started at 3.4.5, to stay in sync with the vendored sass version... but I can't do both.)