thoughtbot / bourbon

A Lightweight Sass Tool Set
https://www.bourbon.io/
MIT License
9.09k stars 878 forks source link

Trying to use Bourbon with JRuby #797

Closed bduff9 closed 8 years ago

bduff9 commented 8 years ago

I have a project I have been working on to get SCSS compilation working in a Java servlet. I have successfully implemented Sass and Compass with JRuby, however this is crazy slow and takes nearly 30sec for one file (my requirement is less than 10, or ideally less than 5).

I have seen people mention how Bourbon is faster so I tried to implement this but have been struggling most of the day. What I have gotten to work is I:

1) Created a Jar with JRuby, Sass, Bourbon, Neat, and Bitters. (I also had Refills but saw later that this is primarily for components so is not what I need for this project). 2) I have a Ruby script, executed from Java, that accepts the SCSS string and compiles it to CSS 3) I have to require Bourbon and Neat in the script or my imports don't work 4) My imports are all "@import 'bourbon';" as bourbon/bourbon didn't work 5) Bitters does not work and is not found (Also, maybe I can just load in the scss files for this since its just a bunch of styles? Unsure).

It is still pretty slow (~22sec) just with Bourbon, so at this point I'm not sure if I'm doing something wrong or what. Would love any help at all as documentation for what I'm trying to do is slim to none. Thanks in advance!

bduff9 commented 8 years ago

Oops, meant to include that when I run the exact same file with no Compass or Bourbon (and just put empty mixins as placeholders so it compiles successfully), it only takes 1.2sec

tysongach commented 8 years ago

@bduff9 Hi Brian! Are you still having issues?

Honestly, I’ve never worked with JRuby, so my knowledge here is lacking, to say the least.

May I ask how much Sass overall you are compiling (like number of partials, or a rough overall line count)? Is using LibSass an option? It boasts faster compiling times, in most scenarios.

Also, regarding your part about Bitters: Yes, we recommend installed Bitters as flat Sass files right into your project. It’s more of a jumping off point to get some base styles in, rather than a library to pick and pull from.