Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching from underscore to lodash #15

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Switching from underscore to lodash #15

wants to merge 6 commits into from

Conversation

ccheever
Copy link
Contributor

Lodash is a drop-in replacement for underscore that is faster and
more actively maintained. Since it is drop-in compatible, switching to it
is trivial. The require statements are just changed from lines like
_ = require 'underscore' to _ = require 'lodash-node'

Tested plan: Ran cake test and manually tested a few things

See:
http://joefleming.net/posts/use-lodash-instead-of-underscore/
http://stackoverflow.com/questions/13789618/differences-between-lodash-and-u

ccheever and others added 6 commits March 24, 2014 16:04
Shows some documentation for an expression; invoke it by typing Ctrl-Q
inline after an expression

Ex.
```
    nesh> process.on<Ctrl-Q>
    [Function] (type, listener)
```

Hit Ctrl-Q twice to see more information, ex. the entire source code in the
case of a function.

Ex.
```
    nesh> process.on
    [Function] (type, listener)
    function (type, listener) {
          if (isSignal(type) &&
              !signalWraps.hasOwnProperty(type)) {
            var Signal = process.binding('signal_wrap').Signal;
            var wrap = new Signal();
    ...
```

You can also invoke it with the `.doc` keyword.

Ex.
```
    nesh> .doc process.on
    [Function] (type, listener)
```

This works for all objects, but is most useful for functions and sometimes
classes. I'm planning to write up a document about how to annotate your
code in a way that the doc module can understand if you want to make your
source more readable that way, but doing that isn't required for this
plugin to be useful. The most useful thing is usually just quick access to
what parameters a function expects.
Lodash is a drop-in replacement for underscore that is faster and
more actively maintained. Since it is drop-in compatible, switching to it
is trivial. The `require` statements are just changed from lines like
`_ = require 'underscore'` to `_ = require 'lodash-node'`

Tested plan: Ran `cake test` and manually tested a few things

See:
http://joefleming.net/posts/use-lodash-instead-of-underscore/
http://stackoverflow.com/questions/13789618/differences-between-lodash-and-underscore
@danielgtaylor
Copy link
Owner

@ccheever looks like older NPM versions don't support the new ^version default syntax. It causes the build to fail:

https://travis-ci.org/danielgtaylor/nesh/jobs/21470912#L38

Can you change the dependency on lodash to use ~version instead, which is the old default? Also please rebase on master if possible so we don't get the merge commit above. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants