Comments (15)
yes, if we ever get a build process going, maybe we can add shims to support ancient browsers. Up until recently we could be very cavalier about ignoring anything but modern browsers. That was great.
from ramda.
Specifically with the indexOf, if an (internal) implementation with startIndex
is added several functions can be significantly optimized... e.g.
ramda.isSet = function(a) {
return !any(a, function(item, idx) {
return contains(a, item, idx + 1);
});
};
from ramda.
That would make a lot of sense. And honestly, I would love to be able to say that this library is compatible with ES3 implementations. A pull request would be quite welcome.
From another discussion, we're quite likely to remove at least the current implementation of deepClone
, whch I believe is the only dependency on JSON, which leaves only a few things that wouldn't work, I believe in IE6+, including indexOf
. It would be nice to be rid of them.
from ramda.
i knew isSet
was sub-optimal; it oughta short-circuit as soon as it finds a dupe instead of just running uniq
. again, until the past couple of weeks, we have not focused on perf. now that we are stuff like this will come out.
@CrossEye, i thought i did remove deepClone
. did that come back??
from ramda.
@buzzdecafe Didn't even check. Looks like it's still gone.
So are foldl1
/foldr1
. But we'll see how long that lasts.
from ramda.
Regarding path*``With|By
here's how I wrote it in my implementation to avoid over currying pathBy
// internal path function
function path(paths, obj) {
var i = -1, length = paths.length, val;
while (obj != null && ++i < length) {
obj = val = obj[paths[i]];
}
return val;
}
ramda.pathWith = lodash.curry(function(fn, str, obj) {
var paths = fn(str) || [];
return path(paths, obj);
});
ramda.pathBy = lodash.curry(function(sep, str, obj) {
return path(str.split(sep), obj);
});
ramda.path = ramda.pathBy('.');
from ramda.
I suspect support for older browsers makes it more expensive to run on newer browsers since you have to take into account rare cases. I am ideologically opposed to this and in agreement with Douglas Crockford. For supporting old things and not forcing users to update we make the present worst. Someday, in the far but sure to come future, there won't be the need for that extra penalty, what would happen then? Do we have to change all our functions?
from ramda.
I have to disagree with you from a library perspective. A library should try not to limit its browser support for trivial things to implement (consistently). IE<9 still has a decent market share (mostly corporate and second world) and I think itd be foolhardy not to support them to save 20-30 lines of code.
Moreover, because we can make some assumptions and not obligated to follow ES spec verbatim we can get away with more efficient implementations
from ramda.
i would like nothing better than to ignore legacy browsers, but I agree with @megawac on this. The intent of ramda is to be a practical functional library, and IMHO practical means support for the majority of platforms out there, esp. if it is not expensive.
from ramda.
Can one of you set up Sauce Labs testing
from ramda.
and testling
from ramda.
On a similar note we should switch from chai
to expect
if we want to test older code
from ramda.
that's been on the wish list for a while, but it is a tedious job, so it hasn't gotten done
from ramda.
old ie has been slain.
from ramda.
Hip hip hooray!
from ramda.
Related Issues (20)
- r.all(r.F, {}) => true, the all function, why not add type check or return false when param not a list
- r.all(r.F, {}) => true, the all function, why not add type check or return false when param not a list HOT 2
- mergeAll bug? HOT 2
- Dead link on hompage under "Install specific functions"
- `equals` returns false if the ordering is different HOT 1
- `reduce` with partial application caches results? HOT 1
- Ramda `0.28.0` contains CWE-843 and CWE-915 HOT 1
- assocPath number path with undefined value expect array but got object HOT 1
- clone new Array(number); HOT 4
- v0.29.0 released HOT 19
- Documentation errors in R.swap examples HOT 2
- 0.29.0 Upgrade Guide HOT 14
- Example with R.find() does not work HOT 3
- `is` implementation can not pass leetcode testing HOT 7
- pathEq types are not consistent with the code in 0.29.0 HOT 5
- Cannot update a nested map via R.modifyPath HOT 2
- R.find and R.propEq HOT 2
- Version exported subfolders HOT 2
- Compose type definitions
- propEq documentation error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ramda.