These are chat archives for bvaughn/forms-js

29th
Mar 2015
Brian Vaughn
@bvaughn
Mar 29 2015 00:29
Thanks for the update David! Mohsen and I had a nice meeting here in SF. Talked through how the web components adapter might make use of Forms JS lib. Things look good now, though it became apparent that I need to focus on the use-case of better supporting collections and we all (eventually) need to think more about the view/layout schema. Expect PRs from Mohsen and myself this week regarding those as well. :)
Brian Vaughn
@bvaughn
Mar 29 2015 17:05
I'm getting ready to open a really long and rambly issue on Forms JS based on my thinking about collections the last day or two.
Unless I do a rockstar job of explaining my thoughts, this is the kind of issue that may warrant a hangout at some point this week to discuss our options. :)
Mohsen Azimi
@mohsen1
Mar 29 2015 17:06
I'm pretty flexible this week since I'm not working
Brian Vaughn
@bvaughn
Mar 29 2015 17:26
Cool. Opened issues forms-js/forms-js#21 and forms-js/forms-js#22
Mohsen Azimi
@mohsen1
Mar 29 2015 17:58
Take a look at JSON Schema validation properties. https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.9 It’s a good place to see all possible validation constraints
David Jensen
@davidlgj
Mar 29 2015 18:13
@mohsen1 @bvaughn thats version 3 of json schema, v4+ is available here http://json-schema.org/latest/json-schema-validation.html
I was looking at #21, #22 and #20. So are we looking at a nested structure for the validation schema?
Because if we are, I'm starting to worry that we're going to re-invent the basic validations of JSON Schema, but in a just slightly different way.
David Jensen
@davidlgj
Mar 29 2015 18:21
Hmmm maybe I worry too much :)
David Jensen
@davidlgj
Mar 29 2015 18:28
Anyways I'll write a comment on #20 to sum up my thoughts.
David Jensen
@davidlgj
Mar 29 2015 18:52
@mohsen1 @bvaughn I'm seeing that you're commenting on issues... sadly I can't :( I guess it's attack against github that for some reason stops me from commenting
David Jensen
@davidlgj
Mar 29 2015 19:08
Anyways I'd think custom function validators should be used for anything that starts being complicated, arrays feels like one of those things :) By using custom validators we keep the core schema nice and clean.
Brian Vaughn
@bvaughn
Mar 29 2015 19:13
I agree with David re: custom validators. Fwiw I think the fears about things being too complicated are maybe unfounded. Forms JS already impliments all of the validation rules we've discussed- and they're all unit tested too
I'm just opening a question or two for discussion as we take the last thing- which is collection validation.
Mohsen Azimi
@mohsen1
Mar 29 2015 19:13
I keep forgetting about function validators
You’re totally right. We don’t have to make eveything declarative
Brian Vaughn
@bvaughn
Mar 29 2015 19:14
I think what we have now is very flexible :)
If we add something similar to form-for collection label then we cover everything
I was just tossing out a few alternate possibilities but maybe I just muddied the water.
David Jensen
@davidlgj
Mar 29 2015 19:15
Hi guys! So one hopefully quick question:
The validation schema is not flat anymore, maybe it never was and I just misunderstood. But how do we write a validation schema for and object like { foo: { bar:1 } }?
Brian Vaughn
@bvaughn
Mar 29 2015 19:17
There are examples of this in the validation tests that may be helpful, but..
David Jensen
@davidlgj
Mar 29 2015 19:17
OK checking them out
Brian Vaughn
@bvaughn
Mar 29 2015 19:18
{ foo: { bar: { type: 'integer' } }
Field name registered would be "foo.bar"
David Jensen
@davidlgj
Mar 29 2015 19:19
And the validation schema? { "foo.bar": { .... } }
or
Brian Vaughn
@bvaughn
Mar 29 2015 19:20
Huh? The example above was validation rules
Nested object
Not flat strings
David Jensen
@davidlgj
Mar 29 2015 19:20
Oh sorry, read it too quick
Ok, thats what I got mixed up.
Brian Vaughn
@bvaughn
Mar 29 2015 19:21
Sorry for terseness. I'm out at lunch with my mobile so it's hard to type code :)
David Jensen
@davidlgj
Mar 29 2015 19:21
:D No prob
Brian Vaughn
@bvaughn
Mar 29 2015 19:22
We could do a hang out when I get back home if that would be useful
David Jensen
@davidlgj
Mar 29 2015 19:24
sure, but I think I get it. I'll have to think about it a bit though, gears grinding in my head right now :)
Brian Vaughn
@bvaughn
Mar 29 2015 19:24
Ok. Unit tests may be helpful to peek at too
The idea is that the rules structure/object mimics the form data structure
The only place is flat " is the field names used for registration
David Jensen
@davidlgj
Mar 29 2015 19:31
Mmm ok, I see that.
Brian Vaughn
@bvaughn
Mar 29 2015 20:03
Back home.
David Jensen
@davidlgj
Mar 29 2015 20:04
Ok, I've been trying to do a mental list of plusses and minuses. So what are the benefits of using a "structure" (for lack of a better word), i.e. what we have today?
Sorry for being such a critic today :)
Brian Vaughn
@bvaughn
Mar 29 2015 20:10
Want to hop on Hangout for a minute or two?
I'm happy to discuss it here, but...it might be easier to discuss verbally.
David Jensen
@davidlgj
Mar 29 2015 20:10
Oh definitely! Let me just get setup, got to move to another room
Brian Vaughn
@bvaughn
Mar 29 2015 20:10
Ok :)
Brian Vaughn
@bvaughn
Mar 29 2015 21:08
Btw I created issue #23 based on our chat David. I'll try to do a little work on that at some point this weekend or early this week as well so you won't have to worry about parsing in the adapter.
Brian Vaughn
@bvaughn
Mar 29 2015 22:53
FYI @davidlgj 3dbaff6 adds a new ViewSchemaParser that supports both of the view-schema formats we chatted about earlier. The unit tests show how it works. :)
Brian Vaughn
@bvaughn
Mar 29 2015 23:36
I wonder if I should work next on...helping out in the Angular 1.x repo, or writing documentation and usage examples for the Forms JS (base) library, or something else.