-
Notifications
You must be signed in to change notification settings - Fork 800
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
split lib/*.js into single files #503
Conversation
@OmgImAlexis Let's get quick a review for this. While I really like the sentiment, I'm not sure if every method should have it's own file. I don't really have anything else to suggest tho so I'm giving this 👍, but would love to hear quick opinion from others. If nobody else replies within ~24h I think we can merge. Love to see this kind of big refactoring done! |
lib/agenda/index.js
Outdated
super(); | ||
|
||
if (!(this instanceof Agenda)) { | ||
return new Agenda(config); | ||
} | ||
|
||
config = config ? config : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node v4 and v5 are a pain. Only 6+ supports default params.
lib/agenda/index.js
Outdated
super(); | ||
|
||
if (!(this instanceof Agenda)) { | ||
return new Agenda(config); | ||
} | ||
|
||
config = config ? config : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config = config || {}
I'm with you on that, the reason I went with all methods is that we might as well and it'll be cleaner seeing unit tests separated for each method. For example you'd have |
This was my thinking as well for +1, but maybe there's something I can't think of now to make working on this nice as well. :-) |
Once we merge this I'm going to switch all tests to avajs and split them up. That should help us get to the bottom of these flaky tests. Off to bed(4:30am here). |
@simison would you mind reviewing the last commit. |
LGTM! Now that I think of this again, having everything split into small files will help to write atomic code. Will be exciting to see ava tests in action! Ready for merge? |
* split agenda.js into single files * fix node v4/v5 incompatibility * swtich from ternary to or * split job.js into single files
I know this is another massive change but this was inevitable. The main file was getting way too large which meant every single time we have more than one person working on a section there's conflicts over the whole file. This fixes that as well as allowing us to setup debug more cleanly by each file having it's own debug field instead of every single function inside of
agenda.js
usingagenda:worker
.@simison shall I just merge once the PR goes green? I'm more than happy to rebase any/all PRs that I've broken.