hugoware / jlinq-beta Goto Github PK
View Code? Open in Web Editor NEWTotal rewrite of jLinq - Public beta code
Home Page: http://hugoware.net/projects/jlinq
Total rewrite of jLinq - Public beta code
Home Page: http://hugoware.net/projects/jlinq
There is an issue with the sort method when multiple keys are specified and one of them has a desc flag ('-column').
Here is an example: http://jsfiddle.net/tFrGu/
I found changing line 715 from:
sorted = sorted.concat(records);
to:
sorted = (desc) ? records.concat(sorted) : sorted.concat(records);
fixes the issue.
SEVERE: jlinq.unminified.js:217: ERROR - Shadowing "arguments" is not allowed
repeat:function(arguments) {
An argument named "arguments" seems to be problematic. Reference: https://code.google.com/p/google-web-toolkit/issues/detail?id=8014
Looks like a simple rename is a sufficient workaround. Thoughts?
create npm package to use with nodejs.
avoid generating globals if not needed and help to easily share code between environments.
here is a sample of a wrapper that would run "everywhere":
(function(def){
def('jlink', function(){
//jlinq code should go here
return jlinq;
});
}(
// wrapper to run code everywhere
// based on http://bit.ly/c7U4h5
typeof require === 'undefined'?
//Browser (regular script tag)
function(name, factory){
this[name] = factory();
} :
((typeof exports === 'undefined')?
//AMD
function(name, factory){
define(name, [], factory);
} :
//CommonJS
function(name, factory){
module.exports = factory();
}
)
));
wrapping the code like this would make it work on node.js, and to be loaded properly by AMD loaders like RequireJS, Dojo (v1.6+), curl.js, etc..
I think the library shouldn't generate multiple alias (jl
, jlinq
, jLinq
), If the user wants to use an abbreviation it's better that he creates an alias inside his scope:
//closure to avoid polluting global scope and also generates alias to jlinq object
//since I'm going to call it a lot of times
(function(jl){
var result = jl.from(myData).contains('awesome', true).select();
var result2 = jl.from...
}(jlinq));
or:
function doManyQueries(){
var jl = jlinq; //local alias
var result = jl.from(myData).contains('awesome', true).select();
var result2 = jl.from...
}
if you have some legacy code that uses the alias is very easy to fix it, just by adding the property to the global scope, if documented it should be hard to follow:
//create global alias for backward compatibility
window.jl = jlinq;
I was really stupid to do what I did, i just realized how simple it was to change my data-getter library to work with it.
This project was last updated 2 years ago, is this out of beta yet? ... and if so, can the other repo be removed or have this merged into it?
Maybe include a README.md
with this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.