-
Notifications
You must be signed in to change notification settings - Fork 454
Use yarn #241
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
Use yarn #241
Conversation
Why use yarn instead of npm? Can't we just check in npm's |
@alecgibson I find
Mainly I just made the check so I wouldn't have to |
Given that npm is the more "core" service (ie the one we publish to), I'd personally prefer to stick to just that (in the same way that there's a strong leaning towards using standard JavaScript rather than eg transpiling - it makes working on the repository a lot more universal and friendly to the uninitiated). |
Amounts to the preferences of the team. I'll close this PR and open one to add yarn's lockfile to function MemoryDB(options) {
if (!(this instanceof MemoryDB)) return new MemoryDB(options);
DB.call(this, options);
// Map from collection name -> doc id -> doc snapshot ({v:, type:, data:})
this.docs = {};
// Map from collection name -> doc id -> list of operations. Operations
// don't store their version - instead their version is simply the index in
// the list.
this.ops = {};
this.closed = false;
};
module.exports = MemoryDB;
MemoryDB.prototype = Object.create(DB.prototype);
MemoryDB.prototype.close = function(callback) {
this.closed = true;
if (callback) callback();
}; Is harder to parse than the es5 class equivalent: export class MemoryDB {
// Map from collection name -> doc id -> doc snapshot ({v:, type:, data:})
docs = {};
// Map from collection name -> doc id -> list of operations. Operations
// don't store their version - instead their version is simply the index in
// the list.
ops = {};
closed = false;
close(callback) {
this.closed = true;
if (callback) callback();
}
constructor(options) {
DB(options);
}
} |
ES5 doesn't support classes. Do you mean ES6? We don't use that, because of the joys of IE. Using ES6 would require either backend-only code (like the new |
@alecgibson yes, good catch, I meant ES6. Plus I used class-properties in the example, so I guess I'm just talking some language that doesn't truly exist outside of |
Tiny check in for a tiny improvement in package management.
TLDR; New packages should be installed with
yarn add
instead ofnpm install