zgrossbart / jslim

It's your favorite JavaScript library, only faster
Apache License 2.0
309 stars 11 forks source link

TypeError: c.css is not a function after jslimming jquery.min #5

Closed DanielRuf closed 8 years ago

DanielRuf commented 12 years ago

I get TypeError: c.css is not a function after running jslim.

Tried to add css to externs.txt but nothing changed.

When I use jquery-1.7.2 I get Error: Syntax error, unrecognized expression: hidden

zgrossbart commented 12 years ago

Thanks for trying JSlim. Could you please give me some more information about what you're trying to do. Where do you see this error? What command are you trying to run? Any ideas how I can reproduce this problem?

Thanks, Zack

DanielRuf commented 12 years ago

I use the commands described in the main README.md file of the repo.

When I take a look at the generated js files, the css function is completely missing, but not in the original jquery file.

Some code I use:

    var test = $(".span6").width();
    var test2 = $(".span12").width();
    var test_h = $("#mmm").height();
function calcSizes() {
    test = $(".span6").width();
    test2 = $(".span12").width();
    var value = test / 5.10909091;
    var value2 = test / 7.20513;
    var value3 = test2 / 38.3;
    var value4 = test / 56.267;
    var value5 = test2 / 57.45;
    var hspace = value2 / 2;
    $("#fff").css({'font-size':''+value+'px'});
    $("#mmm").css({'font-size':''+value2+'px'});
    $("#hspace").height(hspace);
    $(".line_long").height(''+value5+'px');
    $(".fontface4").css({'font-size':''+value3+'px'});
    $(".line_short").height(''+value4+'px');

}
zgrossbart commented 12 years ago

The short answer is that there's a soft dependency that isn't getting followed. My guess is that the css function has a dependency on something else. Do you have a fll project that I could check out? Otherwise you just need to try to track down the dependency.

DanielRuf commented 12 years ago

Sure, I am working on a custom jquery version

So there is the javascript code I use at the end which causes the problems.

It is not so easy to find out which functions have to be added to the externs file

Also there is some difference: jquery.min: removed 110 out of 324 ... jquery-1.7.2: removed 106 out of 324 ...

So when I use the 1.7.2 version, I see the other error.

Any updates? Want to test it soon again with jQuery 1.8