Skip to content

Rrule schedules - #540

Open
DinoEgo wants to merge 29 commits into
node-schedule:masterfrom
DinoEgo:rrule-schedules
Open

DinoEgo wants to merge 29 commits into
node-schedule:masterfrom
DinoEgo:rrule-schedules

Conversation

@DinoEgo

@DinoEgo DinoEgo commented Jul 31, 2020

Copy link
Copy Markdown

I have been using this library for a project and found that RRule support would be an easy and incredibly useful addition to have.

@naz

naz commented Nov 9, 2020

Copy link
Copy Markdown

If this might effect prioritization of reviewing this PR: having it merged would allow for support of use-case mentioned in #176 (comment)

Comment thread src/schedule.js Outdated
Comment thread test/convenience-method-test.js Outdated
Comment thread test/job-test.js Outdated
@kibertoad

Copy link
Copy Markdown
Contributor

@DinoEgo Thank you for your contribution! Could you please pull latest changes from master in?

@kibertoad

Copy link
Copy Markdown
Contributor

@DinoEgo I'm planning to start breaking down the monolith of schedule.js in 2.0.0. If you could start by extracting everything related to RRule scheduling into a separate file (or a set of files) already, that would be very helpful.

@DinoEgo
DinoEgo force-pushed the rrule-schedules branch 3 times, most recently from f1155b0 to 8f26adf Compare January 29, 2021 15:17
@DinoEgo

DinoEgo commented Jan 29, 2021 •

Copy link
Copy Markdown
Author

Not sure if I have rebased this correctly, please advise me if that is the case :) @kibertoad

@DinoEgo
DinoEgo changed the base branch from dev to master January 29, 2021 15:21
Comment thread .eslintrc Outdated
Comment thread .gitignore Outdated
Comment thread lib/schedule.js Outdated
@DinoEgo

DinoEgo commented Jan 31, 2021

Copy link
Copy Markdown
Author

Im going to have to rework this due to the huge difference between master and dev, I will make a new PR and link it here

@DinoEgo
DinoEgo marked this pull request as draft January 31, 2021 22:34
@DinoEgo

DinoEgo commented Jan 31, 2021 •

Copy link
Copy Markdown
Author

@DinoEgo Important note: since node-schedule is intended to be used on browsers as well, and rrule is 3 Mb large, it is important that it is an optional dependency and that all current functionality still works when it is not available. Hence the ask to move all the rrule-related code in an external file. rrule should be lazy-required when it is used, and user should be very explicit in creating a RRule for that to happen.

Yes, I was intending to do this as you asked earlier, but wanted to get the code in a state where is was working with master, then work from there to extract the rrule specific code. I have marked this PR as draft for now as there seems to be a lot more work that I need to do before this is ready for a re-review.

Please feel free to add more comments to the existing code as you see fit

@DinoEgo
DinoEgo marked this pull request as ready for review February 1, 2021 01:03
@DinoEgo

DinoEgo commented Feb 1, 2021

Copy link
Copy Markdown
Author

@kibertoad Could you have a check over this, any comments you make I will review in the morning :)

@DinoEgo
DinoEgo requested a review from kibertoad February 1, 2021 16:58
Comment thread test/convenience-method-test.js Outdated
Comment thread package.json Outdated
Comment thread lib/utils/rruleUtil.js Outdated
Comment thread lib/utils/rruleUtil.js Outdated
Comment thread lib/utils/rruleUtil.js Outdated
Comment thread lib/utils/rruleUtil.js Outdated
Comment thread lib/Job.js Outdated
Comment thread lib/Job.js
const cronParser = require('cron-parser')
const CronDate = require('cron-parser/lib/date')
const sorted = require('sorted-array-functions')
const rruleUtil = require('./utils/rruleUtil');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be dynamically required on the first attempt to add an rrule.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it is a utility, I disagree. Since we handle the missing dependency then we can include the util to sit and wait. Your call, let me know if I should change it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather see it not as merely a set of utility functions, but more like a module, almost a plugin, that should encapsulate as much of RRule functionality as possible, and should be as absent as possible if user does not opt in to use it.

Comment thread lib/Invocation.js Outdated
@DinoEgo
DinoEgo requested a review from kibertoad February 6, 2021 00:13
@DinoEgo

DinoEgo commented Aug 8, 2022

Copy link
Copy Markdown
Author

Bump? its been 2 years :D

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.

3 participants