Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-26 Thread piotrz
Greg, Ohhh! I know what you mean - bloody deadlines! :) Thank you! Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Issue-with-JSON-stringify-and-Bindable-VO-objects-tp61195p61368.html Sent from

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-25 Thread Greg Dove
I will try to look at it this coming weekend. I have some looming deadlines with work at the moment that could cause me to end up not having much spare time :) On Wed, Apr 26, 2017 at 5:13 PM, piotrz wrote: > Hi Greg, > > Any chance that you look into that before 0.8

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-25 Thread piotrz
Hi Greg, Any chance that you look into that before 0.8 release? Thanks, Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Issue-with-JSON-stringify-and-Bindable-VO-objects-tp61195p61364.html Sent

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-22 Thread piotrz
Greg, Thanks for explanation now I understand that it will be transparent for me. Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context:

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-22 Thread Greg Dove
Hi Piotr, you should not be concerned about that. For example, your bindable VO is also IEventDispatcher but you did not code that. The compiler did it for you after you marked it [Bindable]. So it could also, for example, add an interface that indicates the class has compiler generated toJson

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-22 Thread piotrz
Hi Greg, Reading your code we landed again to giving our VO some kind of interface ? If yes, that's resolve issue, but it won't be to handy. I don't want to implement by my VO any interface - I just wanted to have function toJSON - which is recognizable by deserializer default. var book:Book =

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-21 Thread Alex Harui
Hi Greg, The point wasn't to encourage the use of XML instead of JSON. It was just to see if there was any useful mechanisms of retaining type information and dealing with circularities. Seems like if we can define how to record the types, that a single Reviver parameter should be able to

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-21 Thread Greg Dove
Thanks for that info. Most often for client work, I don't choose the data transfer format, and tbh I would probably choose json vs. xml if I could choose between the two. The simplest json based 'typed' data I have seen sends "__type":"typename_here" in the generic objects, which can be used

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-20 Thread piotrz
Greg, I created jira [1] with as much description as a I can. [1] https://issues.apache.org/jira/browse/FLEX-35297 Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context:

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-20 Thread Alex Harui
On 4/19/17, 1:29 AM, "Greg Dove" wrote: >Yes I was thinking more in terms of the times I did this type of thing to >support nested typed objects from raw json, more than simple VOs. Not so >much in terms of using reviver, but going through from json -> generic >object ->

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Greg Dove
Yes Piotr, although I think we are all guessing what you want, it will be helpful to be certain. On Wed, Apr 19, 2017 at 9:03 PM, piotrz wrote: > Greg, > > In order to touch this subject on compiler sight, would it be helpful if I > prepare what Alex asked me ? > >

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread piotrz
Greg, In order to touch this subject on compiler sight, would it be helpful if I prepare what Alex asked me ? Scenario and generated code in JS sight ? Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context:

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Greg Dove
Yes I was thinking more in terms of the times I did this type of thing to support nested typed objects from raw json, more than simple VOs. Not so much in terms of using reviver, but going through from json -> generic object -> typed object with most of the support for the last part being in the

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread piotrz
Ohh! I got you :) I will prepare something and post here. Thank you! - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Issue-with-JSON-stringify-and-Bindable-VO-objects-tp61195p61228.html Sent from the

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Alex Harui
On 4/18/17, 11:40 PM, "piotrz" wrote: >Greg, > >The deal is that I don't want to any interface. In pure Flex we don't need >interface and stringify is working. It would be awesome if you could take >a >look into that. > >Alex, > >So I don't understand what do you

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread piotrz
Greg, The deal is that I don't want to any interface. In pure Flex we don't need interface and stringify is working. It would be awesome if you could take a look into that. Alex, So I don't understand what do you want from me. Do you want me to manually create toJSON inside object and implement

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Alex Harui
On 4/18/17, 11:45 PM, "Greg Dove" wrote: >maybe fromJson is not the best example :) I'm not sure I understand what you want to do. Are you trying to support types in the JSON reviver? -Alex > > >On Wed, Apr 19, 2017 at 6:42 PM, Greg Dove wrote: >

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Greg Dove
maybe fromJson is not the best example :) On Wed, Apr 19, 2017 at 6:42 PM, Greg Dove wrote: > I'd be happy to look at compiler side support for this at some point > during the next month, it is something I have hand-coded many times and I > think to/from JSON style support

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Greg Dove
I'd be happy to look at compiler side support for this at some point during the next month, it is something I have hand-coded many times and I think to/from JSON style support would be helpful for VO, especially bindables. It would need to add an interface I think so you could cast the VO in

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Alex Harui
Hi Piotr, I am asking you to manually prototype and test that using toJSON will work before I spend time trying to get the compiler to generate such code. I believe it shouldn't take you that long to manually test it. It will take quite a while to change the compiler. Thanks -Alex On

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread piotrz
Alex, Harbs, I understand, but I thought that you will handle those method on the compiler sight - Am I miss something ? Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context:

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Alex Harui
On 4/18/17, 11:20 PM, "Harbs" wrote: >That seems to make sense to me. > >toJSON is something which needs to be defined. If it’s not defined, it’s >not going to work... That's my understanding as well. The ValueObject class will need to define a toJSON method. I don't

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread Harbs
That seems to make sense to me. toJSON is something which needs to be defined. If it’s not defined, it’s not going to work... Am I missing something? > On Apr 19, 2017, at 1:57 AM, piotrz wrote: > > Alex, > > Just tested on SWF sight and got this one: >

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-19 Thread piotrz
Alex, Just tested on SWF sight and got this one: In JS stack trace is: If we can still to do something with this I will raise

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-18 Thread Alex Harui
On 4/18/17, 10:34 PM, "piotrz" wrote: >Hi Alex, > >I just tried toJSON method on object in JS and it failed with error that >those method do not exist. Did you mean something like this ? > > var book:Book = new Book(); >book.title = "Trump"; > >var toJSON:Object =

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-18 Thread piotrz
Hi Alex, I just tried toJSON method on object in JS and it failed with error that those method do not exist. Did you mean something like this ? var book:Book = new Book(); book.title = "Trump"; var toJSON:Object = book["toJSON"](); var jsonString:String = JSON.stringify(toJSON); If such

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-18 Thread Alex Harui
Hi Pan, What do you mean by "Flex JSON"? AFAICT, the JSON class in Flash/AIR and the JSON class in JavaScript intend to have equivalent functionality. Both seem to support a toJSON method which might be the right answer. Piotr, have you tested out toJSON methods? If you manually add those to

Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-18 Thread Pan Li
Piotr I am afraid the javascript can only act as a tool to implementation the JSON class, it can't replace Flex JSON in whole, Since they are different. If you use different thing as replacement it isn't hard to find cases didn't cover and the FlexJS's JSON in js has more issues than Bindable,

[FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-18 Thread piotrz
Hi All, It look like we have issue in FlexJS with quite common scenario where JSON.stringify cannot create json from simple VO object which has been marked by [Bindable] property. Description: I have following class [1], which after compilation has additional properties: