-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
57f97cb
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.
Hey @aesopwolf
What changed in
0.19.1
? Any breaking changes? The behavior of all my forms using Formsy has changed..57f97cb
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.
Shoot, I might have to roll back. I was worried this might happen. Validation logic has changed.
See the code here ac301f8
And the issue it solved here #276
57f97cb
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.
@aesopwolf, this work-around, modified from the last time I posted it, illustrates what I think is the behavior desired by many. It only displays errors for empty required fields on the onInvalidSubmit event. (using formsy-material-ui 0.5.3 and formsy-react 0.18.1)
57f97cb
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.
@charleskoehl admittedly it would be great to have it built in to formsy itself though right? Having to write code that detailed/complex to enable standard behavior (or what most would consider should be standard) sounds like a bad developer experience.
57f97cb
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 find it weird to show errors for empty inputs on load, feels like bad UX.
Since the dev can write custom validations and/or control the error class in the custom input
(if required && !value)
, it should change the behavior if needed instead of the library triggering errors for everything..57f97cb
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.
@gilbarbara you're right, that's weird behavior for errors with empty inputs to show on load. Would you mind sharing what your custom form element looks like?
57f97cb
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.
@aesopwolf It's a huge beast: https://gist.github.com/gilbarbara/89f8af872d812688074a3076118c668b
But the relevant bits are these:
57f97cb
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.
@gilbarbara thanks for sharing that. You should be able to fix your issue by using
isFormSubmitted()
before showing your errors.However, this was my fault. I introduced a breaking change without bumping the major version. I guess the nature of being pre 1.0 is that it's common for breaking changes to happen. But really, since people are using this in production we should already be at 1.0.
I could use some feedback here. I'm not sure if I should:
1.0
label?)isFormSubmitted()
57f97cb
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.
Or another halfway option would be to bump the minor version to
0.20.0
to indicate the breaking change. I feel like that's kind of common with pre 1.0 libraries.57f97cb
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 the minor version bump likely makes more sense. If you're in production, you should probably be version locking anyway.
But it is also probably time to consider a 1.0 rc.
57f97cb
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.
@brianfegan Good point about version locking in production.
How about we:
0.19.2
release (and publish asap)0.20.0
(or just wait until 1.0?)Does that sound like a good course of action?
57f97cb
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.
That looks good to me. I think a breaking change in a 0.x update is ok. But I'm locked at 0.18.1 so I'm sort of biased.
57f97cb
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.
hey,
yeah, I think is time for a 1.0 release since this library is over 2 years old and it hasn't changed much in the past year. The 0.x releases was an attempt to keep up with the old React versioning but it doesn't make sense anymore.
57f97cb
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.
Should we make
1.0
a "big grand" release? Meaning we update all of the docs and examples with 'es6 class' examples (currently we're advertising mixins throughout the docs) and also attempt to close all of the open issues and add open feature requests?Or just make it easy and only introduce this one breaking change as the new
1.0
feature? (Still have to update the docs to advertise the need forisFormSubmitted()
though, but not a big deal).Some of the breaking changes I see in the future are:
So I'm just unsure if I want to hammer those into a 1.0 release or wait for 2.0.
57f97cb
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'm not a fan of "big grand" releases and I feel that 1.0 should be a "reborn" release, simple and achievable. The docs definitely need to be rewritten with ES6 examples but that's not hard to do and I could help with that.
[s]
57f97cb
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.
About
isFormSubmitted
.. My forms are disabled until all the fields are validated so how would that work?57f97cb
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.
Hmm, good point. Maybe the initial pull request needed more thought before I merged it in.
I'll release 0.19.2 right now that rolls back the change. Then we can do some more exploring. Especially for forms that are disabled until all fields are valid.
57f97cb
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.
Just published 0.19.2 to npm. Sorry for all of the trouble.
I've setup a 1.0.0 milestone.