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
🏗 Switch from third_party/rrule
to the rrule
module
#22946
Conversation
I see one new type error: https://travis-ci.org/ampproject/amphtml/jobs/548421199#L1035 I fear this is due to our custom version of closure compiler, and how it does pure imports. If so, this PR might have to wait until google/closure-compiler#3041 is fixed. Edit: Got things to work by suppressing the closure error for pure imports. @jridgewell Meanwhile, I think you can re-enable the rule for amphtml/build-system/conformance-config.textproto Lines 342 to 350 in 6093a86
amphtml/build-system/conformance-config.textproto Lines 352 to 359 in 6093a86
|
Got type checks and tests to work by rolling back to This PR is ready for another review. |
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.
LGTM
@rsimha Is it possible to drop the conformance config exceptions with this change? |
I just tried, and am seeing these two conformance violations: extensions/amp-date-picker/0.1/dates-list.js:83: ERROR - Possible violation: ChildNode.p.after() is unusual. Please use Node.p.insertBefore()
The type information available for this expression is too loose to ensure conformance.
.map(rrule => rrule.after(date))
^^^^^^^^^^^
extensions/amp-date-picker/0.1/dates-list.js:113: ERROR - Possible violation: ChildNode.p.before() is unusual. Please use Node.p.insertBefore()
The type information available for this expression is too loose to ensure conformance.
const rruleDay = this.moment_(rrule.before(nextDate));
^^^^^^^^^^^^ I think this can be fixed by providing type info for |
They should be |
In that case, we're likely going to have to wait until google/closure-compiler#3041 is fixed, which will allow us to use the extensions/amp-date-picker/0.1/dates-list.js:43: ERROR - Bad type annotation. Unknown type RRule
/** @private @const {Array<RRule>} */
^ Importing extensions/amp-date-picker/0.1/dates-list.js:43: ERROR - Bad type annotation. Unknown type RRule$$module$rrule
/** @private @const {Array<RRule>} */
^ |
I tried a different thing: casting the extensions/amp-date-picker/0.1/dates-list.js:83: ERROR - Property after never defined on rrule
.map((/** {RRule} */ rrule) => rrule.after(date))
^^^^^
extensions/amp-date-picker/0.1/dates-list.js:113: ERROR - Property before never defined on rrule
const rruleDay = this.moment_(rrule.before(nextDate));
^^^^^^ |
The missing ingredient was an entry in the externs file. Done in #23001. |
This PR switches
extensions/amp-date-picker/0.1/dates-list.js
fromthird_party/rrule
to therrule
module. The aim is to address the TODO in 09eddaaFollow up to #22914