-
Notifications
You must be signed in to change notification settings - Fork 121
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
Rely purely on moment to determine input validity #93
base: master
Are you sure you want to change the base?
Conversation
The code changes make sense, the only thing is that this contradicts the changes we made for #29 |
That is a pretty big contradiction, isn't it... How do you feel about it? I think I've come full circle: respect how Moment handles inputs, and either proceed or abort depending on Moment's thumbs up. |
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.
I have no strong feelings either way to be honest, though a lot of feedback we had in the issues was around not firing the console warning rather than displaying nothing if the input is falsey.
@brockpetrie - I've been testing this branch with our system and it works well. I agree with your assessment that For instance, this snippet of markup:
Helps to produce the following: Everywhere there are dashes in the UI is where there was It also means that it's important to have no output if the input is There are situations where we end up rendering a lot of data that has had few or no events yet - ex: That brings me to the only suggestion I have for this PR. In #81 at the top of the function I had a null guard (it also guarded Either way, we'd very much like to have this be the default behavior, so you get my 👍 for merging 😄 |
Though I was just re-reading your comments from 3 days ago about my PR #81 going too far by guarding the invalid inputs... so yeah - either way, letting moment do the processing means you'll get whatever it does at a small performance penalty for "invalid" inputs (null, empty string). Guarding those values at the top will give you a performance bump, but I'm not clear on how much and it's possible our status pages that contain a lot of as-yet pending events are unusual. I'm also happy to close #81, but it looks like when you merge this it will automatically close, so leaving it for now. Thanks! |
Have you thought about merging this at all? We are still using our modified fork. Someday I'd like to switch back to your npm package instead. Thanks! |
Leaving this PR hanging like this is torture. So close, yet so far.. |
Any updates about this PR? |
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.
I think we should just bite the bullet and go with this.
@brockpetrie Are you happy for me to merge this in and release? |
Yes! One of the Brocks please merge this 😁 (coming up on one year since I did the first pull request for this). |
Removes our falsey check on
input
on line 38. This allows forundefined
inputs, which are considered valid by moment and treated the same as callingnew Date()
.This also removes the console warning in that same if block.
Fixes #75, closes #81 and closes #91. Breaking change! Any thoughts on this, @BrockReece?
Thanks to @bitencode for doing the initial legwork.