Lurker News

Comments (188) 57 threads

Earlier comments
trishume#
I've been using TabNine for a couple months now and it's been really great. It "just works" and I don't ever have to worry about it even when opening large projects. It's always fast and high-quality. It really feels like it's just part of Sublime Text in a way that's very rare for a plugin.
danShumway5 replies#
> TabNine builds an index of your project, reading your .gitignore so that only source files are included.

Heads up, it's not necessarily uncommon for JS developers to include node_modules in their git repos. If you're developing something like an Electron project or a website instead of a library, it's even sometimes advised to do so -- there's a line of thought that your static dependencies should be tracked as part of your source control.
It might not be a terrible idea to have an alternate config for this that allows excluding other directories. Even if a developer doesn't include their dependencies, they might have old code that they don't want integrated into their suggestions if they're in the middle of a refactor or something.

nathancahill#
Dear god
setr2 replies#
Does npm not have version pinning? Why would you want to operate as if you didn't have a package manager, as your default behavior?
danShumway1 reply#
Depends on if you want to bother setting up Artifactory. The problem with having your dependencies outside of your project directory is you're now relying on a network request and a build step to get your stuff up and running.

It's obviously not right for every project, I wouldn't classify it as default behavior or even a standard behavior. But if you're already using Vagrant/Docker to standardize environments across your entire stack, there's an argument to be made that there's really no need to not to have your dependencies precompiled and local to the project.
If you can get rid of complexity, it's worth considering whether or not doing so might be a good idea. Across standardized environments, fetching dependencies is extra complexity.

setr4 replies#
Afaik, Most language communities with a package manager are fine with the network request, since it should really only occur on initial pull, and library updates; not sure what they do with vagrant, but i imagine just keeping the libs locally and copying it in on vagrant build.

Eg in pythonland, I’m pretty sure I’ve never seen a repo with packages stored in the repo.
So what happened in jsland that makes the difference?

Continue this thread — 4 replies

thrower123#
At one point, it did not, and the default behavior when one did npm install was to use quite permissive packages.json rules that allowed minor and patch updates. I remember being bitten by this a few times years ago, particularly when semver was more poorly understood.
folkrav#
Same thing for Composer's `vendor/` directory with PHP, or Python's virtualenv folder, depending on the way the project is setup.
pitaj2 replies#
> it's not necessarily uncommon for JS developers to include node_modules in their git repos

It's highly uncommon, and I've never seen an active, maintained, or popular project with it.

danShumway#
It's become less popular with the introduction first of ``shrinkwrap`` and then ``package-lock.js``. At one point in time, it was recommended behavior in the official NPM documentation for site deployments, because there wasn't a way to checksum dependencies.

They've since switched to recommending private repositories like Artifactory instead, which to be fair is usually better for very large organizations nowadays. But that wasn't always the case, and even as recent as 2013, it was the flat-out prevailing advice from package managers like Bower, and there are organizations who are still using and maintaining codebases that were set up in 2013.
You won't see a lot of projects on Github that rely on it, because:
A) Usually Open Source projects are designed to be built on multiple environments/OSes.
B) The majority of Open Source Javascript projects are designed to be installed via NPM anyway, and of course you wouldn't include dependencies for something like that.
However, you want to be careful not to make the mistake of assuming that every project has the same concerns as a standard Open Source project. Especially if an Org is going all in on standardizing dev environments through Vagrant or Docker, the question becomes, "why would you want an extra checkout/build step on top of that?"

nojvek1 reply#
to handle a static state of dependencies, usually a package-lock or a yarn.lock file is committed to the repo. That is the usual way to freeze the dependency tree.
danShumway#
Freezing a dependency tree isn't the point. The point is to avoid making a network request and to know that your dependencies will still be there 5 years from now.

Remember that one of the benefits of Git is that it's distributed. Even if you are hosting your own npm mirror, relying on it gets rid of that distributed advantage. It doesn't help you to be able to clone from the person next to you if you can't build without making a network request.
I'm not saying that this should be the norm for everyone. It obviously shouldn't be the norm for libraries. But it's not inherently a crazy or harmful idea.

danShumway#
Lot of surprise about something that I thought was not particularly controversial to say. Google has been using vendored dependencies in version control for years[0]. It's also going to be the default behavior in Jai[1].

Is there something I'm missing that makes those examples particularly abnormal? Has consensus radically shifted since the last time I looked into this?
[0]: https://groups.google.com/forum/#!msg/golang-dev/nMWoEAG55v8...
[1]: https://www.youtube.com/watch?v=3TwEaRZ4H3w

cjohansson#
Sounds like a great tool, I got two feature requests:

* make .gitignore logic optional, we always have the system we’re working with ignored and only include our extension but we really need autocompletion from the whole project
* Emacs plugin

wasd1 reply#
How does TabNine work for all languages? Curious about implementation details and use with dynamic languages. I would HAPPILY pay $29 if it works well for Ruby.
ajhofmann#
I've been using it for Python mainly but I find it's really helpful. It can often infer arguments for functions or functions to use based on the variable names. I've used Ruby lots in the past and I think it would work just as well based on my experience. I would give the free version a try and see what you think.

Load more comments