Hugoware

The product of a web developer with a little too much caffeine

jLinq Update (2.2.1)

with 10 comments

I’m off from work this week so the first thing I did was get some work done on jLinq. I’ve had a few bugs I’ve needed to sort out along with a new feature I wanted to implement. I’m also going to be working on documentation this week. Previously, I had created a Wiki and was hoping that people might add to the documentation… but instead spam bots pretty much ruined it so I’ll be starting over from scratch… oh well..

New Features

jLinq itself doesn’t really have a new feature but instead a new way to get the jLinq library. Instead of simply downloading a standard jLinq library you can use the new online jLinq Framework Generator to select only the functionality that you want to include. You can still download the basic pack but this option gives you a little more control what goes into your version of jLinq.

Changes

The most notable change for jLinq is that all of the operator commands have been included as standard functions for the framework. Before, these functions were actually methods extended onto the framework. Since these functions are required for jLinq to work I’ve moved them so that they are in every jLinq framework by default.

Bug Fixes

orderBy with joined records would return incorrect results
jLinq uses eval to figure out the values of field names since you can provide methods, array indexes or whatever. The code used to sort the values wasn’t getting the values correctly so the sorted result was always wrong.

using 0 in certain comparisons would return incorrect results
Ah, this one was fun. So check out the code below…

var values = [ 0 ];
var index = 0;
var a = !values[index];
var b = values[index] == null;

So what is a and what is b? If you said true and false then give yourself a cookie.

jLinq uses the number of arguments passed to help determine if anything is being memorized (like the field name). jLinq makes a quick pass to select all values until it finds a null value… or at least that is what I meant for it to do. Unfortunately, I wasn’t thinking when I wrote that method and didn’t check explicitly for null.

Feedback

If you find any problems with jLinq or have any suggestions, please leave a comment or contact me directly.

Advertisements

Written by hugoware

November 23, 2009 at 9:03 pm

10 Responses

Subscribe to comments with RSS.

  1. really nice to see these enhancements, keep up the great work!

    Dave

    November 24, 2009 at 2:37 am

  2. Thank you for bug fixing.

    Eugen

    December 9, 2009 at 10:54 am

  3. Just FYI – StackOverflow is offering it’s ad space for OpenSource projects http://blog.stackoverflow.com/2009/12/free-vote-based-advertising-for-open-source-projects/

    You definitely should take advantage of this – you’ve got my up vote for a great framework. Let me know if you post anything and I’ll vote you up!

    ActiveEngine Sensei

    December 22, 2009 at 8:31 pm

  4. Thanks for your very useful library!

    I looked at the code and it seems you are supporting variable length parameter lists with a certain technique – and javascript provides for a way that would be much cleaner. For example you define a method on line 744 with a long parameter list that can probably be more concisely done as shown here:

    Now you could be doing it the way you are doing it for another reason such as performance and if you are I would like to know what the reason is.

    Once again thanks for this super useful library.

    David

    January 1, 2010 at 10:13 am

    • Thanks David,

      I’ll read that code and see if it can help – Thank you!

      You are correct that I needed to have a way for methods to accept an unknown number of arguments. In jLinq, the field name (and command name) are optional (some times) and jLinq lets you extend the framework and create custom methods. I stuck the 25 argument limit because I was hoping that no one would ever use that many arguments in a function 🙂

      Anyways, I hope this helps to minimize all that repeated code, I never liked that solution 🙂

      webdev_hb

      January 1, 2010 at 10:58 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: