-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(Form): update to v1 API #400
Conversation
@levithomason any idea when this might be merged? |
I'm actively working on this, though I suspect it will be a few days of work. I'm considering shipping the API without Form validation first. Then, shipping the validation later. This could save a substantial amount of time. This is because validation is something we're still tossing ideas around on. Input highly encouraged! |
I think shipping without validation and adding that later is good idea. When validations are added, it would be progressive and (I hope) will not have any api impact. |
The basic API should not change when validation is added. |
07f234e
to
a5a8ff6
Compare
Confirmed, validation will be done separately. See #407 for that discussion. |
3aed1bb
to
e112c74
Compare
08a3a7b
to
7695541
Compare
7695541
to
4b079be
Compare
Current coverage is 98.30% (diff: 98.80%)@@ master #400 diff @@
==========================================
Files 91 98 +7
Lines 1312 1413 +101
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1269 1389 +120
+ Misses 43 24 -19
Partials 0 0
|
06380b2
to
98d029c
Compare
/> | ||
> | ||
<Message warning> | ||
Radios in a group must be |
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 probably be after the be
? Otherwise it doesn't achieve anything different than a {' ' }
.
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 aware of the differences between those, though the spaced string did give issues elsewhere.
Since space is removed between components that are separated by a new line, and the component's content should always be one space away from adjacent text, I've opted to include
inside of components. This way, no matter where the components are moved the spacing is correct without having to add/remove spacing elements every time you move the component.
Looks awesome, that was a ton of work, so massive props on getting it so solid. My only real hold up is the conflating of the |
799d209
to
240e701
Compare
240e701
to
2503a44
Compare
Released in /cc @brsanthu |
thanks for the great release @levithomason. This is the major piece. Is this end of Jquery in stardust? |
This is indeed the end of jQuery in Stardust. There are no traces of jQuery in this library any longer. See #247. |
Fixes #247 Remove jQuery Dependency
Fixes #432 Hoist propTypes for all wrapper components
This PR addresses the final item in removing jQuery. Since the last component is the Form, this PR also updates the Form to the v1 API and handles validation.
Reviewing
Try out the Form docs first and look at the code snippets to get a good feel for the API. Then, focus on src/collections/Form/*.js. Most of the code here is just docs, tests, and updating old Form usages.
Also, have a look at the line comments I left below.
Breaking Changes
Form
Checkbox
Confusion between radio, checkbox, slider, toggle, and various combinations thereof have been addressed. See the docs for updated usage.
inputType & type
The
inputType
prop has been removed, settype
instead.The
type
prop is no longer used to set visual SUI type ("slider", "toggle", "checkbox", "radio"). It now controls the type of the html input.Radio
inputType & type
See Checkbox
Exclusive Groups
Radio groups (multiple radios with the same name) must be controlled components. Previously we relied on the browser to manage radio group state and used refs to read the
checked
state. Reading from the DOM is an antipattern.