krasimir / absurd

A JavaScript library with superpowers
http://absurdjs.krasimirtsonev.com/
MIT License
1.38k stars 90 forks source link

api.import([string, string]) Not working #98

Closed zachariahtimothy closed 10 years ago

zachariahtimothy commented 10 years ago

Hello again, I have a new project using Absurd 0.3.27 and Grunt Absurd 0.1.0. I have a simple single JS file using api.add() which compiles fine using the following code: `var Absurd = require("absurd"); var api = Absurd(); api.import(__dirname + '/public/styles/index.css.js');

api.compile(function(err,A,B) { console.log(err, A, B); });` If import is a string array, the output is blank. If I change api.import(dirname + '/public/styles/index.css.js'); to be an array api.import([dirname + '/public/styles/index.css.js']); the compiled output is blank. This is why grunt-absurd is not working for me. If I change grunt-absurd to do api.import() per file it works perfectly.

Note this compiles fine in my own script, as well as on the command line.

zachariahtimothy commented 10 years ago

Also note when I comment out line 90 of absurd/lib/api/import.js: if(typeof p === 'object') {} (the if statement only) it works as well.

krasimir commented 10 years ago

So, the problem occurs when you use grunt-absurd with a code like this:

api.import([__dirname + '/public/styles/index.css.js']); 
zachariahtimothy commented 10 years ago

Exactly. I tried that same code in a separate script to skip grunt-absurd and it did not work. If I simply remove the brackets and keep it a string it works fine.


Zach Curtis P: 970.590.6383 E: zachariahtimothy@gmail.com T: @zachariahCurtis https://twitter.com/#!/@zachariahCurtis B: http://zachariahtimothy.wordpress.com/

On Fri, Jul 11, 2014 at 1:45 PM, Krasimir Tsonev notifications@github.com wrote:

So, the problem occurs when you use grunt-absurd with a code like this:

api.import([__dirname + '/public/styles/index.css.js']);

— Reply to this email directly or view it on GitHub https://github.com/krasimir/absurd/issues/98#issuecomment-48774490.

krasimir commented 10 years ago

Yep, it's a bug probably. I'll check it in the next few days.

Best regards

On 11.07.2014, at 23:46, Zach Curtis notifications@github.com wrote:

Exactly. I tried that same code in a separate script to skip grunt-absurd and it did not work. If I simply remove the brackets and keep it a string it works fine.


Zach Curtis P: 970.590.6383 E: zachariahtimothy@gmail.com T: @zachariahCurtis https://twitter.com/#!/@zachariahCurtis B: http://zachariahtimothy.wordpress.com/

On Fri, Jul 11, 2014 at 1:45 PM, Krasimir Tsonev notifications@github.com wrote:

So, the problem occurs when you use grunt-absurd with a code like this:

api.import([__dirname + '/public/styles/index.css.js']);

— Reply to this email directly or view it on GitHub https://github.com/krasimir/absurd/issues/98#issuecomment-48774490.

— Reply to this email directly or view it on GitHub.

krasimir commented 10 years ago

Sorry for the delay. A new version 0.3.28 is released. I fixed the bug thankfully to your hint. You should delete the node_modules directory of the your project so npm downloads the latest AbsurdJS version.

zachariahtimothy commented 10 years ago

Awesome, thank you as always! After using AbsurdJS successfully on several production apps, I get angry writing CSS (or even SASS/LESS) now. Lol. Cheers to you for making a truly helpful tool!


Zach Curtis P: 970.590.6383 E: zachariahtimothy@gmail.com T: @zachariahCurtis https://twitter.com/#!/@zachariahCurtis B: http://zachariahtimothy.wordpress.com/

On Mon, Jul 14, 2014 at 3:26 PM, Krasimir Tsonev notifications@github.com wrote:

Sorry for the delay. A new version 0.3.28 is released. I fixed the bug thankfully to your hint. You should delete the node_modules directory of the your project so npm downloads the latest AbsurdJS version.

— Reply to this email directly or view it on GitHub https://github.com/krasimir/absurd/issues/98#issuecomment-48962122.

krasimir commented 10 years ago

I'm glad that someone uses it :)

zachariahtimothy commented 10 years ago

Just tested and it works. Thanks again!


Zach Curtis P: 970.590.6383 E: zachariahtimothy@gmail.com T: @zachariahCurtis https://twitter.com/#!/@zachariahCurtis B: http://zachariahtimothy.wordpress.com/

On Mon, Jul 14, 2014 at 3:32 PM, Krasimir Tsonev notifications@github.com wrote:

I'm glad that someone uses it :)

— Reply to this email directly or view it on GitHub https://github.com/krasimir/absurd/issues/98#issuecomment-48962778.

krasimir commented 10 years ago

Great.