You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Andrew Grieve <ag...@chromium.org> on 2012/07/27 23:06:28 UTC

Changing iOS's exec bridge

Shaz,

I mentioned doing such a change during PGD, but was hoping you could give
it a sanity check over:

https://issues.apache.org/jira/browse/CB-1150
https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
https://github.com/agrieve/incubator-cordova-js/tree/better_exec

I ensured mobile-spec and unit tests pass, so should be good to go I think.

Andrew

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
I meant, different types of objects.

It would be much easier on WP7 if the method did this:

exec(successCallback, fail, 'FileTransfer', 'upload', [filePath,
server, fileKey, fileName, mimeType,
JSON.stringify(params), trustAllHosts, chunkedMode, JSON.stringify
(headers)]);

I will look at handling this inside exec. Generally though, I don't like to
see us moving towards huge lists of params (nothing to do with your contrib
Andrew).

Cheers,
Jesse

On Fri, Jul 27, 2012 at 7:30 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Hmm, shoot. This change is harmless I think, but I just committed a change
> to FileTransfer to allow passing in a headers map, which does the exact
> thing you warn against - it now has up to two JS objects being passed
> within the arguments array. (https://issues.apache.org/jira/browse/CB-765)
>
> Could elaborate on this restriction? Is it that the JSON parser on WP7
> supports extracting only a single JS object within the top-level array?
> Does it support nested objects?
>
> I'm not sure what you mean by object types.
>
>
>
>
> On Fri, Jul 27, 2012 at 9:11 PM, Jesse <pu...@gmail.com> wrote:
>
> > Windows 8, WP8 at least
> > .net only supports basic JSON serialization without the inclusion of
> > the 300KB JSON.net lib.
> >
> >
> >
> > On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <sh...@gmail.com>
> > wrote:
> > > Thanks Jesse - seems like a doc issue we need to write for cross
> > > platform plugins. Would you know if this is a concern for other
> > > platforms as well besides WP7?
> > >
> > > On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
> > >
> > >> Okay, that all looks/sounds fine.
> > >> However, we have to be careful not to encourage passing multiple
> > >> objects in the array, in addition to multiple different object types.
> > >> We should continue to strive to make sure that everything outside of
> > >> exec is portable, so even though in iOS, exec can receive args of
> > >> [{name:value}, {name:value}] the JS calling code will NOT be portable.
> > >>
> > >> I worry (just a little) we are opening a door we may have to close
> > later.
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
> > >>> These changes transfer the decision that was done in JS to the
> > Objective-C side.
> > >>> The arguments are passed in as-is, if an object is passed in as an
> > >>> array element, it is converted to a NSDictionary in objective-C. So
> if
> > >>> you use the new plugin signature, you can pass in as many objects as
> > >>> you want to the plugin method, they will be in order in the arguments
> > >>> array as NSDictionary-s.
> > >>>
> > >>> The "extraction" occurs when we compare the plugin method signature -
> > >>> if its a legacy signature, we extract the first NSDictionary from the
> > >>> arguments, like we did in JS. If its not a legacy signature, we pass
> > >>> the arguments unchanged.
> > >>>
> > >>> re:
> >
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
> > >>>
> > >>>
> > >>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com>
> > wrote:
> > >>>> Wait!
> > >>>>
> > >>>> Can we discuss the EXACT nature of the command array?
> > >>>> I have had to work through a similar issue on WP7, it would be
> > >>>> extremely valuable if we could agree on what the args to exec looks
> > >>>> like.
> > >>>>
> > >>>> It looks like your changes are all inside and beyond exec, but I
> want
> > >>>> to make sure.
> > >>>>
> > >>>> In the past we discussed removing the array altogether and passing
> > >>>> named objects as args.
> > >>>> On WP7 it is extremely difficult to interpret arrays that do not
> > >>>> contain the same types of object.
> > >>>> For example, if the command has args of
> > ['what',23,{obj:literal},[1,2,3]]
> > >>>>
> > >>>> Do we still have a limitation of only passing 1 object literal?
> > >>>>
> > >>>>
> > >>>>
> > >>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <
> agrieve@chromium.org>
> > wrote:
> > >>>>> Committed.
> > >>>>> Sounds good! You update the dev guide, and I'll work to update the
> > existing
> > >>>>> core plugins.
> > >>>>>
> > >>>>>
> > >>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com>
> wrote:
> > >>>>>
> > >>>>>> Thanks Andrew, this looks good!
> > >>>>>>
> > >>>>>> Once you merge it in, I'll add the doc issues, especially the
> Plugin
> > >>>>>> Dev Guide, we don't want people to start using the old way. I was
> > >>>>>> thinking, a deprecation NSLog would be great if they are using the
> > old
> > >>>>>> way, but that will just be too much noise at this point...
> > >>>>>>
> > >>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <
> > agrieve@chromium.org>
> > >>>>>> wrote:
> > >>>>>>> Shaz,
> > >>>>>>>
> > >>>>>>> I mentioned doing such a change during PGD, but was hoping you
> > could
> > >>>>>> give it
> > >>>>>>> a sanity check over:
> > >>>>>>>
> > >>>>>>> https://issues.apache.org/jira/browse/CB-1150
> > >>>>>>>
> > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> > >>>>>>> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
> > >>>>>>>
> > >>>>>>> I ensured mobile-spec and unit tests pass, so should be good to
> go
> > I
> > >>>>>> think.
> > >>>>>>>
> > >>>>>>> Andrew
> > >>>>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>> --
> > >>>> @purplecabbage
> > >>>> risingj.com
> > >>
> > >>
> > >>
> > >> --
> > >> @purplecabbage
> > >> risingj.com
> >
> >
> >
> > --
> > @purplecabbage
> > risingj.com
> >
>



-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
https://issues.apache.org/jira/browse/CB-1183

On Thu, Aug 2, 2012 at 1:14 PM, Jesse <pu...@gmail.com> wrote:

> I will fix this in WP7 exec.
> I will NOT be including the 300kb dll for JSON.net
>
>
> On Thu, Aug 2, 2012 at 12:16 PM, Andrew Grieve <ag...@chromium.org>wrote:
>
>> Yeah, agree that putting the work-around in WP7's exec would be the best
>> thing here and that long param lists are annoying. :P
>>
>>
>> On Mon, Jul 30, 2012 at 3:12 PM, Jesse <pu...@gmail.com> wrote:
>>
>> > Size becomes the issue.  The JSON lib is bigger than the Cordova
>> framework
>> > itself. In my mind the workaround is relatively simple, just other
>> platform
>> > APIs definers must be aware of it.
>> >
>> > Discussion of adding the lib [1]
>> > Discussion of the issue on WP7 [2]
>> > JSON.net lib [3]
>> >
>> > [1] https://issues.apache.org/jira/browse/CB-938
>> > [2] https://issues.apache.org/jira/browse/CB-668
>> > [3] http://json.codeplex.com/
>> >
>> >
>> > On Mon, Jul 30, 2012 at 11:45 AM, Shazron <sh...@gmail.com> wrote:
>> >
>> > > What about including a better JSON lib than the included one? Will
>> > > that be a problem?
>> > >
>> > > On Fri, Jul 27, 2012 at 6:11 PM, Jesse <pu...@gmail.com>
>> wrote:
>> > > > Windows 8, WP8 at least
>> > > > .net only supports basic JSON serialization without the inclusion of
>> > > > the 300KB JSON.net lib.
>> > > >
>> > > >
>> > > >
>> > > > On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <
>> shazron@gmail.com>
>> > > wrote:
>> > > >> Thanks Jesse - seems like a doc issue we need to write for cross
>> > > >> platform plugins. Would you know if this is a concern for other
>> > > >> platforms as well besides WP7?
>> > > >>
>> > > >> On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
>> > > >>
>> > > >>> Okay, that all looks/sounds fine.
>> > > >>> However, we have to be careful not to encourage passing multiple
>> > > >>> objects in the array, in addition to multiple different object
>> types.
>> > > >>> We should continue to strive to make sure that everything outside
>> of
>> > > >>> exec is portable, so even though in iOS, exec can receive args of
>> > > >>> [{name:value}, {name:value}] the JS calling code will NOT be
>> > portable.
>> > > >>>
>> > > >>> I worry (just a little) we are opening a door we may have to close
>> > > later.
>> > > >>>
>> > > >>>
>> > > >>>
>> > > >>>
>> > > >>>
>> > > >>> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com>
>> wrote:
>> > > >>>> These changes transfer the decision that was done in JS to the
>> > > Objective-C side.
>> > > >>>> The arguments are passed in as-is, if an object is passed in as
>> an
>> > > >>>> array element, it is converted to a NSDictionary in objective-C.
>> So
>> > if
>> > > >>>> you use the new plugin signature, you can pass in as many
>> objects as
>> > > >>>> you want to the plugin method, they will be in order in the
>> > arguments
>> > > >>>> array as NSDictionary-s.
>> > > >>>>
>> > > >>>> The "extraction" occurs when we compare the plugin method
>> signature
>> > -
>> > > >>>> if its a legacy signature, we extract the first NSDictionary from
>> > the
>> > > >>>> arguments, like we did in JS. If its not a legacy signature, we
>> pass
>> > > >>>> the arguments unchanged.
>> > > >>>>
>> > > >>>> re:
>> > >
>> >
>> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
>> > > >>>>
>> > > >>>>
>> > > >>>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com>
>> > > wrote:
>> > > >>>>> Wait!
>> > > >>>>>
>> > > >>>>> Can we discuss the EXACT nature of the command array?
>> > > >>>>> I have had to work through a similar issue on WP7, it would be
>> > > >>>>> extremely valuable if we could agree on what the args to exec
>> looks
>> > > >>>>> like.
>> > > >>>>>
>> > > >>>>> It looks like your changes are all inside and beyond exec, but I
>> > want
>> > > >>>>> to make sure.
>> > > >>>>>
>> > > >>>>> In the past we discussed removing the array altogether and
>> passing
>> > > >>>>> named objects as args.
>> > > >>>>> On WP7 it is extremely difficult to interpret arrays that do not
>> > > >>>>> contain the same types of object.
>> > > >>>>> For example, if the command has args of
>> > > ['what',23,{obj:literal},[1,2,3]]
>> > > >>>>>
>> > > >>>>> Do we still have a limitation of only passing 1 object literal?
>> > > >>>>>
>> > > >>>>>
>> > > >>>>>
>> > > >>>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <
>> > agrieve@chromium.org>
>> > > wrote:
>> > > >>>>>> Committed.
>> > > >>>>>> Sounds good! You update the dev guide, and I'll work to update
>> the
>> > > existing
>> > > >>>>>> core plugins.
>> > > >>>>>>
>> > > >>>>>>
>> > > >>>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com>
>> > wrote:
>> > > >>>>>>
>> > > >>>>>>> Thanks Andrew, this looks good!
>> > > >>>>>>>
>> > > >>>>>>> Once you merge it in, I'll add the doc issues, especially the
>> > > Plugin
>> > > >>>>>>> Dev Guide, we don't want people to start using the old way. I
>> was
>> > > >>>>>>> thinking, a deprecation NSLog would be great if they are using
>> > the
>> > > old
>> > > >>>>>>> way, but that will just be too much noise at this point...
>> > > >>>>>>>
>> > > >>>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <
>> > > agrieve@chromium.org>
>> > > >>>>>>> wrote:
>> > > >>>>>>>> Shaz,
>> > > >>>>>>>>
>> > > >>>>>>>> I mentioned doing such a change during PGD, but was hoping
>> you
>> > > could
>> > > >>>>>>> give it
>> > > >>>>>>>> a sanity check over:
>> > > >>>>>>>>
>> > > >>>>>>>> https://issues.apache.org/jira/browse/CB-1150
>> > > >>>>>>>>
>> > > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>> > > >>>>>>>>
>> > https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>> > > >>>>>>>>
>> > > >>>>>>>> I ensured mobile-spec and unit tests pass, so should be good
>> to
>> > > go I
>> > > >>>>>>> think.
>> > > >>>>>>>>
>> > > >>>>>>>> Andrew
>> > > >>>>>>>
>> > > >>>>>
>> > > >>>>>
>> > > >>>>>
>> > > >>>>> --
>> > > >>>>> @purplecabbage
>> > > >>>>> risingj.com
>> > > >>>
>> > > >>>
>> > > >>>
>> > > >>> --
>> > > >>> @purplecabbage
>> > > >>> risingj.com
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > @purplecabbage
>> > > > risingj.com
>> > >
>> >
>> >
>> >
>> > --
>> > @purplecabbage
>> > risingj.com
>> >
>>
>
>
>
> --
> @purplecabbage
> risingj.com
>
>


-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
I will fix this in WP7 exec.
I will NOT be including the 300kb dll for JSON.net


On Thu, Aug 2, 2012 at 12:16 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Yeah, agree that putting the work-around in WP7's exec would be the best
> thing here and that long param lists are annoying. :P
>
>
> On Mon, Jul 30, 2012 at 3:12 PM, Jesse <pu...@gmail.com> wrote:
>
> > Size becomes the issue.  The JSON lib is bigger than the Cordova
> framework
> > itself. In my mind the workaround is relatively simple, just other
> platform
> > APIs definers must be aware of it.
> >
> > Discussion of adding the lib [1]
> > Discussion of the issue on WP7 [2]
> > JSON.net lib [3]
> >
> > [1] https://issues.apache.org/jira/browse/CB-938
> > [2] https://issues.apache.org/jira/browse/CB-668
> > [3] http://json.codeplex.com/
> >
> >
> > On Mon, Jul 30, 2012 at 11:45 AM, Shazron <sh...@gmail.com> wrote:
> >
> > > What about including a better JSON lib than the included one? Will
> > > that be a problem?
> > >
> > > On Fri, Jul 27, 2012 at 6:11 PM, Jesse <pu...@gmail.com>
> wrote:
> > > > Windows 8, WP8 at least
> > > > .net only supports basic JSON serialization without the inclusion of
> > > > the 300KB JSON.net lib.
> > > >
> > > >
> > > >
> > > > On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <shazron@gmail.com
> >
> > > wrote:
> > > >> Thanks Jesse - seems like a doc issue we need to write for cross
> > > >> platform plugins. Would you know if this is a concern for other
> > > >> platforms as well besides WP7?
> > > >>
> > > >> On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
> > > >>
> > > >>> Okay, that all looks/sounds fine.
> > > >>> However, we have to be careful not to encourage passing multiple
> > > >>> objects in the array, in addition to multiple different object
> types.
> > > >>> We should continue to strive to make sure that everything outside
> of
> > > >>> exec is portable, so even though in iOS, exec can receive args of
> > > >>> [{name:value}, {name:value}] the JS calling code will NOT be
> > portable.
> > > >>>
> > > >>> I worry (just a little) we are opening a door we may have to close
> > > later.
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com>
> wrote:
> > > >>>> These changes transfer the decision that was done in JS to the
> > > Objective-C side.
> > > >>>> The arguments are passed in as-is, if an object is passed in as an
> > > >>>> array element, it is converted to a NSDictionary in objective-C.
> So
> > if
> > > >>>> you use the new plugin signature, you can pass in as many objects
> as
> > > >>>> you want to the plugin method, they will be in order in the
> > arguments
> > > >>>> array as NSDictionary-s.
> > > >>>>
> > > >>>> The "extraction" occurs when we compare the plugin method
> signature
> > -
> > > >>>> if its a legacy signature, we extract the first NSDictionary from
> > the
> > > >>>> arguments, like we did in JS. If its not a legacy signature, we
> pass
> > > >>>> the arguments unchanged.
> > > >>>>
> > > >>>> re:
> > >
> >
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
> > > >>>>
> > > >>>>
> > > >>>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com>
> > > wrote:
> > > >>>>> Wait!
> > > >>>>>
> > > >>>>> Can we discuss the EXACT nature of the command array?
> > > >>>>> I have had to work through a similar issue on WP7, it would be
> > > >>>>> extremely valuable if we could agree on what the args to exec
> looks
> > > >>>>> like.
> > > >>>>>
> > > >>>>> It looks like your changes are all inside and beyond exec, but I
> > want
> > > >>>>> to make sure.
> > > >>>>>
> > > >>>>> In the past we discussed removing the array altogether and
> passing
> > > >>>>> named objects as args.
> > > >>>>> On WP7 it is extremely difficult to interpret arrays that do not
> > > >>>>> contain the same types of object.
> > > >>>>> For example, if the command has args of
> > > ['what',23,{obj:literal},[1,2,3]]
> > > >>>>>
> > > >>>>> Do we still have a limitation of only passing 1 object literal?
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <
> > agrieve@chromium.org>
> > > wrote:
> > > >>>>>> Committed.
> > > >>>>>> Sounds good! You update the dev guide, and I'll work to update
> the
> > > existing
> > > >>>>>> core plugins.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com>
> > wrote:
> > > >>>>>>
> > > >>>>>>> Thanks Andrew, this looks good!
> > > >>>>>>>
> > > >>>>>>> Once you merge it in, I'll add the doc issues, especially the
> > > Plugin
> > > >>>>>>> Dev Guide, we don't want people to start using the old way. I
> was
> > > >>>>>>> thinking, a deprecation NSLog would be great if they are using
> > the
> > > old
> > > >>>>>>> way, but that will just be too much noise at this point...
> > > >>>>>>>
> > > >>>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <
> > > agrieve@chromium.org>
> > > >>>>>>> wrote:
> > > >>>>>>>> Shaz,
> > > >>>>>>>>
> > > >>>>>>>> I mentioned doing such a change during PGD, but was hoping you
> > > could
> > > >>>>>>> give it
> > > >>>>>>>> a sanity check over:
> > > >>>>>>>>
> > > >>>>>>>> https://issues.apache.org/jira/browse/CB-1150
> > > >>>>>>>>
> > > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> > > >>>>>>>>
> > https://github.com/agrieve/incubator-cordova-js/tree/better_exec
> > > >>>>>>>>
> > > >>>>>>>> I ensured mobile-spec and unit tests pass, so should be good
> to
> > > go I
> > > >>>>>>> think.
> > > >>>>>>>>
> > > >>>>>>>> Andrew
> > > >>>>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>> --
> > > >>>>> @purplecabbage
> > > >>>>> risingj.com
> > > >>>
> > > >>>
> > > >>>
> > > >>> --
> > > >>> @purplecabbage
> > > >>> risingj.com
> > > >
> > > >
> > > >
> > > > --
> > > > @purplecabbage
> > > > risingj.com
> > >
> >
> >
> >
> > --
> > @purplecabbage
> > risingj.com
> >
>



-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Andrew Grieve <ag...@chromium.org>.
Yeah, agree that putting the work-around in WP7's exec would be the best
thing here and that long param lists are annoying. :P


On Mon, Jul 30, 2012 at 3:12 PM, Jesse <pu...@gmail.com> wrote:

> Size becomes the issue.  The JSON lib is bigger than the Cordova framework
> itself. In my mind the workaround is relatively simple, just other platform
> APIs definers must be aware of it.
>
> Discussion of adding the lib [1]
> Discussion of the issue on WP7 [2]
> JSON.net lib [3]
>
> [1] https://issues.apache.org/jira/browse/CB-938
> [2] https://issues.apache.org/jira/browse/CB-668
> [3] http://json.codeplex.com/
>
>
> On Mon, Jul 30, 2012 at 11:45 AM, Shazron <sh...@gmail.com> wrote:
>
> > What about including a better JSON lib than the included one? Will
> > that be a problem?
> >
> > On Fri, Jul 27, 2012 at 6:11 PM, Jesse <pu...@gmail.com> wrote:
> > > Windows 8, WP8 at least
> > > .net only supports basic JSON serialization without the inclusion of
> > > the 300KB JSON.net lib.
> > >
> > >
> > >
> > > On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <sh...@gmail.com>
> > wrote:
> > >> Thanks Jesse - seems like a doc issue we need to write for cross
> > >> platform plugins. Would you know if this is a concern for other
> > >> platforms as well besides WP7?
> > >>
> > >> On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
> > >>
> > >>> Okay, that all looks/sounds fine.
> > >>> However, we have to be careful not to encourage passing multiple
> > >>> objects in the array, in addition to multiple different object types.
> > >>> We should continue to strive to make sure that everything outside of
> > >>> exec is portable, so even though in iOS, exec can receive args of
> > >>> [{name:value}, {name:value}] the JS calling code will NOT be
> portable.
> > >>>
> > >>> I worry (just a little) we are opening a door we may have to close
> > later.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
> > >>>> These changes transfer the decision that was done in JS to the
> > Objective-C side.
> > >>>> The arguments are passed in as-is, if an object is passed in as an
> > >>>> array element, it is converted to a NSDictionary in objective-C. So
> if
> > >>>> you use the new plugin signature, you can pass in as many objects as
> > >>>> you want to the plugin method, they will be in order in the
> arguments
> > >>>> array as NSDictionary-s.
> > >>>>
> > >>>> The "extraction" occurs when we compare the plugin method signature
> -
> > >>>> if its a legacy signature, we extract the first NSDictionary from
> the
> > >>>> arguments, like we did in JS. If its not a legacy signature, we pass
> > >>>> the arguments unchanged.
> > >>>>
> > >>>> re:
> >
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
> > >>>>
> > >>>>
> > >>>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com>
> > wrote:
> > >>>>> Wait!
> > >>>>>
> > >>>>> Can we discuss the EXACT nature of the command array?
> > >>>>> I have had to work through a similar issue on WP7, it would be
> > >>>>> extremely valuable if we could agree on what the args to exec looks
> > >>>>> like.
> > >>>>>
> > >>>>> It looks like your changes are all inside and beyond exec, but I
> want
> > >>>>> to make sure.
> > >>>>>
> > >>>>> In the past we discussed removing the array altogether and passing
> > >>>>> named objects as args.
> > >>>>> On WP7 it is extremely difficult to interpret arrays that do not
> > >>>>> contain the same types of object.
> > >>>>> For example, if the command has args of
> > ['what',23,{obj:literal},[1,2,3]]
> > >>>>>
> > >>>>> Do we still have a limitation of only passing 1 object literal?
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <
> agrieve@chromium.org>
> > wrote:
> > >>>>>> Committed.
> > >>>>>> Sounds good! You update the dev guide, and I'll work to update the
> > existing
> > >>>>>> core plugins.
> > >>>>>>
> > >>>>>>
> > >>>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com>
> wrote:
> > >>>>>>
> > >>>>>>> Thanks Andrew, this looks good!
> > >>>>>>>
> > >>>>>>> Once you merge it in, I'll add the doc issues, especially the
> > Plugin
> > >>>>>>> Dev Guide, we don't want people to start using the old way. I was
> > >>>>>>> thinking, a deprecation NSLog would be great if they are using
> the
> > old
> > >>>>>>> way, but that will just be too much noise at this point...
> > >>>>>>>
> > >>>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <
> > agrieve@chromium.org>
> > >>>>>>> wrote:
> > >>>>>>>> Shaz,
> > >>>>>>>>
> > >>>>>>>> I mentioned doing such a change during PGD, but was hoping you
> > could
> > >>>>>>> give it
> > >>>>>>>> a sanity check over:
> > >>>>>>>>
> > >>>>>>>> https://issues.apache.org/jira/browse/CB-1150
> > >>>>>>>>
> > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> > >>>>>>>>
> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
> > >>>>>>>>
> > >>>>>>>> I ensured mobile-spec and unit tests pass, so should be good to
> > go I
> > >>>>>>> think.
> > >>>>>>>>
> > >>>>>>>> Andrew
> > >>>>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> --
> > >>>>> @purplecabbage
> > >>>>> risingj.com
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> @purplecabbage
> > >>> risingj.com
> > >
> > >
> > >
> > > --
> > > @purplecabbage
> > > risingj.com
> >
>
>
>
> --
> @purplecabbage
> risingj.com
>

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
Size becomes the issue.  The JSON lib is bigger than the Cordova framework
itself. In my mind the workaround is relatively simple, just other platform
APIs definers must be aware of it.

Discussion of adding the lib [1]
Discussion of the issue on WP7 [2]
JSON.net lib [3]

[1] https://issues.apache.org/jira/browse/CB-938
[2] https://issues.apache.org/jira/browse/CB-668
[3] http://json.codeplex.com/


On Mon, Jul 30, 2012 at 11:45 AM, Shazron <sh...@gmail.com> wrote:

> What about including a better JSON lib than the included one? Will
> that be a problem?
>
> On Fri, Jul 27, 2012 at 6:11 PM, Jesse <pu...@gmail.com> wrote:
> > Windows 8, WP8 at least
> > .net only supports basic JSON serialization without the inclusion of
> > the 300KB JSON.net lib.
> >
> >
> >
> > On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <sh...@gmail.com>
> wrote:
> >> Thanks Jesse - seems like a doc issue we need to write for cross
> >> platform plugins. Would you know if this is a concern for other
> >> platforms as well besides WP7?
> >>
> >> On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
> >>
> >>> Okay, that all looks/sounds fine.
> >>> However, we have to be careful not to encourage passing multiple
> >>> objects in the array, in addition to multiple different object types.
> >>> We should continue to strive to make sure that everything outside of
> >>> exec is portable, so even though in iOS, exec can receive args of
> >>> [{name:value}, {name:value}] the JS calling code will NOT be portable.
> >>>
> >>> I worry (just a little) we are opening a door we may have to close
> later.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
> >>>> These changes transfer the decision that was done in JS to the
> Objective-C side.
> >>>> The arguments are passed in as-is, if an object is passed in as an
> >>>> array element, it is converted to a NSDictionary in objective-C. So if
> >>>> you use the new plugin signature, you can pass in as many objects as
> >>>> you want to the plugin method, they will be in order in the arguments
> >>>> array as NSDictionary-s.
> >>>>
> >>>> The "extraction" occurs when we compare the plugin method signature -
> >>>> if its a legacy signature, we extract the first NSDictionary from the
> >>>> arguments, like we did in JS. If its not a legacy signature, we pass
> >>>> the arguments unchanged.
> >>>>
> >>>> re:
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
> >>>>
> >>>>
> >>>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com>
> wrote:
> >>>>> Wait!
> >>>>>
> >>>>> Can we discuss the EXACT nature of the command array?
> >>>>> I have had to work through a similar issue on WP7, it would be
> >>>>> extremely valuable if we could agree on what the args to exec looks
> >>>>> like.
> >>>>>
> >>>>> It looks like your changes are all inside and beyond exec, but I want
> >>>>> to make sure.
> >>>>>
> >>>>> In the past we discussed removing the array altogether and passing
> >>>>> named objects as args.
> >>>>> On WP7 it is extremely difficult to interpret arrays that do not
> >>>>> contain the same types of object.
> >>>>> For example, if the command has args of
> ['what',23,{obj:literal},[1,2,3]]
> >>>>>
> >>>>> Do we still have a limitation of only passing 1 object literal?
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
> >>>>>> Committed.
> >>>>>> Sounds good! You update the dev guide, and I'll work to update the
> existing
> >>>>>> core plugins.
> >>>>>>
> >>>>>>
> >>>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
> >>>>>>
> >>>>>>> Thanks Andrew, this looks good!
> >>>>>>>
> >>>>>>> Once you merge it in, I'll add the doc issues, especially the
> Plugin
> >>>>>>> Dev Guide, we don't want people to start using the old way. I was
> >>>>>>> thinking, a deprecation NSLog would be great if they are using the
> old
> >>>>>>> way, but that will just be too much noise at this point...
> >>>>>>>
> >>>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <
> agrieve@chromium.org>
> >>>>>>> wrote:
> >>>>>>>> Shaz,
> >>>>>>>>
> >>>>>>>> I mentioned doing such a change during PGD, but was hoping you
> could
> >>>>>>> give it
> >>>>>>>> a sanity check over:
> >>>>>>>>
> >>>>>>>> https://issues.apache.org/jira/browse/CB-1150
> >>>>>>>>
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> >>>>>>>> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
> >>>>>>>>
> >>>>>>>> I ensured mobile-spec and unit tests pass, so should be good to
> go I
> >>>>>>> think.
> >>>>>>>>
> >>>>>>>> Andrew
> >>>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> @purplecabbage
> >>>>> risingj.com
> >>>
> >>>
> >>>
> >>> --
> >>> @purplecabbage
> >>> risingj.com
> >
> >
> >
> > --
> > @purplecabbage
> > risingj.com
>



-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Shazron <sh...@gmail.com>.
What about including a better JSON lib than the included one? Will
that be a problem?

On Fri, Jul 27, 2012 at 6:11 PM, Jesse <pu...@gmail.com> wrote:
> Windows 8, WP8 at least
> .net only supports basic JSON serialization without the inclusion of
> the 300KB JSON.net lib.
>
>
>
> On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <sh...@gmail.com> wrote:
>> Thanks Jesse - seems like a doc issue we need to write for cross
>> platform plugins. Would you know if this is a concern for other
>> platforms as well besides WP7?
>>
>> On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
>>
>>> Okay, that all looks/sounds fine.
>>> However, we have to be careful not to encourage passing multiple
>>> objects in the array, in addition to multiple different object types.
>>> We should continue to strive to make sure that everything outside of
>>> exec is portable, so even though in iOS, exec can receive args of
>>> [{name:value}, {name:value}] the JS calling code will NOT be portable.
>>>
>>> I worry (just a little) we are opening a door we may have to close later.
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
>>>> These changes transfer the decision that was done in JS to the Objective-C side.
>>>> The arguments are passed in as-is, if an object is passed in as an
>>>> array element, it is converted to a NSDictionary in objective-C. So if
>>>> you use the new plugin signature, you can pass in as many objects as
>>>> you want to the plugin method, they will be in order in the arguments
>>>> array as NSDictionary-s.
>>>>
>>>> The "extraction" occurs when we compare the plugin method signature -
>>>> if its a legacy signature, we extract the first NSDictionary from the
>>>> arguments, like we did in JS. If its not a legacy signature, we pass
>>>> the arguments unchanged.
>>>>
>>>> re: https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
>>>>
>>>>
>>>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com> wrote:
>>>>> Wait!
>>>>>
>>>>> Can we discuss the EXACT nature of the command array?
>>>>> I have had to work through a similar issue on WP7, it would be
>>>>> extremely valuable if we could agree on what the args to exec looks
>>>>> like.
>>>>>
>>>>> It looks like your changes are all inside and beyond exec, but I want
>>>>> to make sure.
>>>>>
>>>>> In the past we discussed removing the array altogether and passing
>>>>> named objects as args.
>>>>> On WP7 it is extremely difficult to interpret arrays that do not
>>>>> contain the same types of object.
>>>>> For example, if the command has args of ['what',23,{obj:literal},[1,2,3]]
>>>>>
>>>>> Do we still have a limitation of only passing 1 object literal?
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org> wrote:
>>>>>> Committed.
>>>>>> Sounds good! You update the dev guide, and I'll work to update the existing
>>>>>> core plugins.
>>>>>>
>>>>>>
>>>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
>>>>>>
>>>>>>> Thanks Andrew, this looks good!
>>>>>>>
>>>>>>> Once you merge it in, I'll add the doc issues, especially the Plugin
>>>>>>> Dev Guide, we don't want people to start using the old way. I was
>>>>>>> thinking, a deprecation NSLog would be great if they are using the old
>>>>>>> way, but that will just be too much noise at this point...
>>>>>>>
>>>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
>>>>>>> wrote:
>>>>>>>> Shaz,
>>>>>>>>
>>>>>>>> I mentioned doing such a change during PGD, but was hoping you could
>>>>>>> give it
>>>>>>>> a sanity check over:
>>>>>>>>
>>>>>>>> https://issues.apache.org/jira/browse/CB-1150
>>>>>>>> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>>>>>>>> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>>>>>>>>
>>>>>>>> I ensured mobile-spec and unit tests pass, so should be good to go I
>>>>>>> think.
>>>>>>>>
>>>>>>>> Andrew
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> @purplecabbage
>>>>> risingj.com
>>>
>>>
>>>
>>> --
>>> @purplecabbage
>>> risingj.com
>
>
>
> --
> @purplecabbage
> risingj.com

Re: Changing iOS's exec bridge

Posted by Andrew Grieve <ag...@chromium.org>.
Hmm, shoot. This change is harmless I think, but I just committed a change
to FileTransfer to allow passing in a headers map, which does the exact
thing you warn against - it now has up to two JS objects being passed
within the arguments array. (https://issues.apache.org/jira/browse/CB-765)

Could elaborate on this restriction? Is it that the JSON parser on WP7
supports extracting only a single JS object within the top-level array?
Does it support nested objects?

I'm not sure what you mean by object types.




On Fri, Jul 27, 2012 at 9:11 PM, Jesse <pu...@gmail.com> wrote:

> Windows 8, WP8 at least
> .net only supports basic JSON serialization without the inclusion of
> the 300KB JSON.net lib.
>
>
>
> On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <sh...@gmail.com>
> wrote:
> > Thanks Jesse - seems like a doc issue we need to write for cross
> > platform plugins. Would you know if this is a concern for other
> > platforms as well besides WP7?
> >
> > On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
> >
> >> Okay, that all looks/sounds fine.
> >> However, we have to be careful not to encourage passing multiple
> >> objects in the array, in addition to multiple different object types.
> >> We should continue to strive to make sure that everything outside of
> >> exec is portable, so even though in iOS, exec can receive args of
> >> [{name:value}, {name:value}] the JS calling code will NOT be portable.
> >>
> >> I worry (just a little) we are opening a door we may have to close
> later.
> >>
> >>
> >>
> >>
> >>
> >> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
> >>> These changes transfer the decision that was done in JS to the
> Objective-C side.
> >>> The arguments are passed in as-is, if an object is passed in as an
> >>> array element, it is converted to a NSDictionary in objective-C. So if
> >>> you use the new plugin signature, you can pass in as many objects as
> >>> you want to the plugin method, they will be in order in the arguments
> >>> array as NSDictionary-s.
> >>>
> >>> The "extraction" occurs when we compare the plugin method signature -
> >>> if its a legacy signature, we extract the first NSDictionary from the
> >>> arguments, like we did in JS. If its not a legacy signature, we pass
> >>> the arguments unchanged.
> >>>
> >>> re:
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
> >>>
> >>>
> >>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com>
> wrote:
> >>>> Wait!
> >>>>
> >>>> Can we discuss the EXACT nature of the command array?
> >>>> I have had to work through a similar issue on WP7, it would be
> >>>> extremely valuable if we could agree on what the args to exec looks
> >>>> like.
> >>>>
> >>>> It looks like your changes are all inside and beyond exec, but I want
> >>>> to make sure.
> >>>>
> >>>> In the past we discussed removing the array altogether and passing
> >>>> named objects as args.
> >>>> On WP7 it is extremely difficult to interpret arrays that do not
> >>>> contain the same types of object.
> >>>> For example, if the command has args of
> ['what',23,{obj:literal},[1,2,3]]
> >>>>
> >>>> Do we still have a limitation of only passing 1 object literal?
> >>>>
> >>>>
> >>>>
> >>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
> >>>>> Committed.
> >>>>> Sounds good! You update the dev guide, and I'll work to update the
> existing
> >>>>> core plugins.
> >>>>>
> >>>>>
> >>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
> >>>>>
> >>>>>> Thanks Andrew, this looks good!
> >>>>>>
> >>>>>> Once you merge it in, I'll add the doc issues, especially the Plugin
> >>>>>> Dev Guide, we don't want people to start using the old way. I was
> >>>>>> thinking, a deprecation NSLog would be great if they are using the
> old
> >>>>>> way, but that will just be too much noise at this point...
> >>>>>>
> >>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <
> agrieve@chromium.org>
> >>>>>> wrote:
> >>>>>>> Shaz,
> >>>>>>>
> >>>>>>> I mentioned doing such a change during PGD, but was hoping you
> could
> >>>>>> give it
> >>>>>>> a sanity check over:
> >>>>>>>
> >>>>>>> https://issues.apache.org/jira/browse/CB-1150
> >>>>>>>
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> >>>>>>> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
> >>>>>>>
> >>>>>>> I ensured mobile-spec and unit tests pass, so should be good to go
> I
> >>>>>> think.
> >>>>>>>
> >>>>>>> Andrew
> >>>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> @purplecabbage
> >>>> risingj.com
> >>
> >>
> >>
> >> --
> >> @purplecabbage
> >> risingj.com
>
>
>
> --
> @purplecabbage
> risingj.com
>

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
Windows 8, WP8 at least
.net only supports basic JSON serialization without the inclusion of
the 300KB JSON.net lib.



On Fri, Jul 27, 2012 at 6:05 PM, Shazron Abdullah <sh...@gmail.com> wrote:
> Thanks Jesse - seems like a doc issue we need to write for cross
> platform plugins. Would you know if this is a concern for other
> platforms as well besides WP7?
>
> On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:
>
>> Okay, that all looks/sounds fine.
>> However, we have to be careful not to encourage passing multiple
>> objects in the array, in addition to multiple different object types.
>> We should continue to strive to make sure that everything outside of
>> exec is portable, so even though in iOS, exec can receive args of
>> [{name:value}, {name:value}] the JS calling code will NOT be portable.
>>
>> I worry (just a little) we are opening a door we may have to close later.
>>
>>
>>
>>
>>
>> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
>>> These changes transfer the decision that was done in JS to the Objective-C side.
>>> The arguments are passed in as-is, if an object is passed in as an
>>> array element, it is converted to a NSDictionary in objective-C. So if
>>> you use the new plugin signature, you can pass in as many objects as
>>> you want to the plugin method, they will be in order in the arguments
>>> array as NSDictionary-s.
>>>
>>> The "extraction" occurs when we compare the plugin method signature -
>>> if its a legacy signature, we extract the first NSDictionary from the
>>> arguments, like we did in JS. If its not a legacy signature, we pass
>>> the arguments unchanged.
>>>
>>> re: https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
>>>
>>>
>>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com> wrote:
>>>> Wait!
>>>>
>>>> Can we discuss the EXACT nature of the command array?
>>>> I have had to work through a similar issue on WP7, it would be
>>>> extremely valuable if we could agree on what the args to exec looks
>>>> like.
>>>>
>>>> It looks like your changes are all inside and beyond exec, but I want
>>>> to make sure.
>>>>
>>>> In the past we discussed removing the array altogether and passing
>>>> named objects as args.
>>>> On WP7 it is extremely difficult to interpret arrays that do not
>>>> contain the same types of object.
>>>> For example, if the command has args of ['what',23,{obj:literal},[1,2,3]]
>>>>
>>>> Do we still have a limitation of only passing 1 object literal?
>>>>
>>>>
>>>>
>>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org> wrote:
>>>>> Committed.
>>>>> Sounds good! You update the dev guide, and I'll work to update the existing
>>>>> core plugins.
>>>>>
>>>>>
>>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
>>>>>
>>>>>> Thanks Andrew, this looks good!
>>>>>>
>>>>>> Once you merge it in, I'll add the doc issues, especially the Plugin
>>>>>> Dev Guide, we don't want people to start using the old way. I was
>>>>>> thinking, a deprecation NSLog would be great if they are using the old
>>>>>> way, but that will just be too much noise at this point...
>>>>>>
>>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
>>>>>> wrote:
>>>>>>> Shaz,
>>>>>>>
>>>>>>> I mentioned doing such a change during PGD, but was hoping you could
>>>>>> give it
>>>>>>> a sanity check over:
>>>>>>>
>>>>>>> https://issues.apache.org/jira/browse/CB-1150
>>>>>>> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>>>>>>> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>>>>>>>
>>>>>>> I ensured mobile-spec and unit tests pass, so should be good to go I
>>>>>> think.
>>>>>>>
>>>>>>> Andrew
>>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> @purplecabbage
>>>> risingj.com
>>
>>
>>
>> --
>> @purplecabbage
>> risingj.com



-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Shazron Abdullah <sh...@gmail.com>.
Thanks Jesse - seems like a doc issue we need to write for cross
platform plugins. Would you know if this is a concern for other
platforms as well besides WP7?

On 2012-07-27, at 6:00 PM, Jesse <pu...@gmail.com> wrote:

> Okay, that all looks/sounds fine.
> However, we have to be careful not to encourage passing multiple
> objects in the array, in addition to multiple different object types.
> We should continue to strive to make sure that everything outside of
> exec is portable, so even though in iOS, exec can receive args of
> [{name:value}, {name:value}] the JS calling code will NOT be portable.
>
> I worry (just a little) we are opening a door we may have to close later.
>
>
>
>
>
> On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
>> These changes transfer the decision that was done in JS to the Objective-C side.
>> The arguments are passed in as-is, if an object is passed in as an
>> array element, it is converted to a NSDictionary in objective-C. So if
>> you use the new plugin signature, you can pass in as many objects as
>> you want to the plugin method, they will be in order in the arguments
>> array as NSDictionary-s.
>>
>> The "extraction" occurs when we compare the plugin method signature -
>> if its a legacy signature, we extract the first NSDictionary from the
>> arguments, like we did in JS. If its not a legacy signature, we pass
>> the arguments unchanged.
>>
>> re: https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
>>
>>
>> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com> wrote:
>>> Wait!
>>>
>>> Can we discuss the EXACT nature of the command array?
>>> I have had to work through a similar issue on WP7, it would be
>>> extremely valuable if we could agree on what the args to exec looks
>>> like.
>>>
>>> It looks like your changes are all inside and beyond exec, but I want
>>> to make sure.
>>>
>>> In the past we discussed removing the array altogether and passing
>>> named objects as args.
>>> On WP7 it is extremely difficult to interpret arrays that do not
>>> contain the same types of object.
>>> For example, if the command has args of ['what',23,{obj:literal},[1,2,3]]
>>>
>>> Do we still have a limitation of only passing 1 object literal?
>>>
>>>
>>>
>>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org> wrote:
>>>> Committed.
>>>> Sounds good! You update the dev guide, and I'll work to update the existing
>>>> core plugins.
>>>>
>>>>
>>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
>>>>
>>>>> Thanks Andrew, this looks good!
>>>>>
>>>>> Once you merge it in, I'll add the doc issues, especially the Plugin
>>>>> Dev Guide, we don't want people to start using the old way. I was
>>>>> thinking, a deprecation NSLog would be great if they are using the old
>>>>> way, but that will just be too much noise at this point...
>>>>>
>>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
>>>>> wrote:
>>>>>> Shaz,
>>>>>>
>>>>>> I mentioned doing such a change during PGD, but was hoping you could
>>>>> give it
>>>>>> a sanity check over:
>>>>>>
>>>>>> https://issues.apache.org/jira/browse/CB-1150
>>>>>> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>>>>>> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>>>>>>
>>>>>> I ensured mobile-spec and unit tests pass, so should be good to go I
>>>>> think.
>>>>>>
>>>>>> Andrew
>>>>>
>>>
>>>
>>>
>>> --
>>> @purplecabbage
>>> risingj.com
>
>
>
> --
> @purplecabbage
> risingj.com

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
Okay, that all looks/sounds fine.
However, we have to be careful not to encourage passing multiple
objects in the array, in addition to multiple different object types.
We should continue to strive to make sure that everything outside of
exec is portable, so even though in iOS, exec can receive args of
[{name:value}, {name:value}] the JS calling code will NOT be portable.

I worry (just a little) we are opening a door we may have to close later.





On Fri, Jul 27, 2012 at 5:37 PM, Shazron <sh...@gmail.com> wrote:
> These changes transfer the decision that was done in JS to the Objective-C side.
> The arguments are passed in as-is, if an object is passed in as an
> array element, it is converted to a NSDictionary in objective-C. So if
> you use the new plugin signature, you can pass in as many objects as
> you want to the plugin method, they will be in order in the arguments
> array as NSDictionary-s.
>
> The "extraction" occurs when we compare the plugin method signature -
> if its a legacy signature, we extract the first NSDictionary from the
> arguments, like we did in JS. If its not a legacy signature, we pass
> the arguments unchanged.
>
> re: https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63
>
>
> On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com> wrote:
>> Wait!
>>
>> Can we discuss the EXACT nature of the command array?
>> I have had to work through a similar issue on WP7, it would be
>> extremely valuable if we could agree on what the args to exec looks
>> like.
>>
>> It looks like your changes are all inside and beyond exec, but I want
>> to make sure.
>>
>> In the past we discussed removing the array altogether and passing
>> named objects as args.
>> On WP7 it is extremely difficult to interpret arrays that do not
>> contain the same types of object.
>> For example, if the command has args of ['what',23,{obj:literal},[1,2,3]]
>>
>> Do we still have a limitation of only passing 1 object literal?
>>
>>
>>
>> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org> wrote:
>>> Committed.
>>> Sounds good! You update the dev guide, and I'll work to update the existing
>>> core plugins.
>>>
>>>
>>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
>>>
>>>> Thanks Andrew, this looks good!
>>>>
>>>> Once you merge it in, I'll add the doc issues, especially the Plugin
>>>> Dev Guide, we don't want people to start using the old way. I was
>>>> thinking, a deprecation NSLog would be great if they are using the old
>>>> way, but that will just be too much noise at this point...
>>>>
>>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
>>>> wrote:
>>>> > Shaz,
>>>> >
>>>> > I mentioned doing such a change during PGD, but was hoping you could
>>>> give it
>>>> > a sanity check over:
>>>> >
>>>> > https://issues.apache.org/jira/browse/CB-1150
>>>> > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>>>> > https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>>>> >
>>>> > I ensured mobile-spec and unit tests pass, so should be good to go I
>>>> think.
>>>> >
>>>> > Andrew
>>>>
>>
>>
>>
>> --
>> @purplecabbage
>> risingj.com



-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Shazron <sh...@gmail.com>.
These changes transfer the decision that was done in JS to the Objective-C side.
The arguments are passed in as-is, if an object is passed in as an
array element, it is converted to a NSDictionary in objective-C. So if
you use the new plugin signature, you can pass in as many objects as
you want to the plugin method, they will be in order in the arguments
array as NSDictionary-s.

The "extraction" occurs when we compare the plugin method signature -
if its a legacy signature, we extract the first NSDictionary from the
arguments, like we did in JS. If its not a legacy signature, we pass
the arguments unchanged.

re: https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec#L3R63


On Fri, Jul 27, 2012 at 5:26 PM, Jesse <pu...@gmail.com> wrote:
> Wait!
>
> Can we discuss the EXACT nature of the command array?
> I have had to work through a similar issue on WP7, it would be
> extremely valuable if we could agree on what the args to exec looks
> like.
>
> It looks like your changes are all inside and beyond exec, but I want
> to make sure.
>
> In the past we discussed removing the array altogether and passing
> named objects as args.
> On WP7 it is extremely difficult to interpret arrays that do not
> contain the same types of object.
> For example, if the command has args of ['what',23,{obj:literal},[1,2,3]]
>
> Do we still have a limitation of only passing 1 object literal?
>
>
>
> On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org> wrote:
>> Committed.
>> Sounds good! You update the dev guide, and I'll work to update the existing
>> core plugins.
>>
>>
>> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
>>
>>> Thanks Andrew, this looks good!
>>>
>>> Once you merge it in, I'll add the doc issues, especially the Plugin
>>> Dev Guide, we don't want people to start using the old way. I was
>>> thinking, a deprecation NSLog would be great if they are using the old
>>> way, but that will just be too much noise at this point...
>>>
>>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
>>> wrote:
>>> > Shaz,
>>> >
>>> > I mentioned doing such a change during PGD, but was hoping you could
>>> give it
>>> > a sanity check over:
>>> >
>>> > https://issues.apache.org/jira/browse/CB-1150
>>> > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>>> > https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>>> >
>>> > I ensured mobile-spec and unit tests pass, so should be good to go I
>>> think.
>>> >
>>> > Andrew
>>>
>
>
>
> --
> @purplecabbage
> risingj.com

Re: Changing iOS's exec bridge

Posted by Jesse <pu...@gmail.com>.
Wait!

Can we discuss the EXACT nature of the command array?
I have had to work through a similar issue on WP7, it would be
extremely valuable if we could agree on what the args to exec looks
like.

It looks like your changes are all inside and beyond exec, but I want
to make sure.

In the past we discussed removing the array altogether and passing
named objects as args.
On WP7 it is extremely difficult to interpret arrays that do not
contain the same types of object.
For example, if the command has args of ['what',23,{obj:literal},[1,2,3]]

Do we still have a limitation of only passing 1 object literal?



On Fri, Jul 27, 2012 at 5:08 PM, Andrew Grieve <ag...@chromium.org> wrote:
> Committed.
> Sounds good! You update the dev guide, and I'll work to update the existing
> core plugins.
>
>
> On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:
>
>> Thanks Andrew, this looks good!
>>
>> Once you merge it in, I'll add the doc issues, especially the Plugin
>> Dev Guide, we don't want people to start using the old way. I was
>> thinking, a deprecation NSLog would be great if they are using the old
>> way, but that will just be too much noise at this point...
>>
>> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
>> wrote:
>> > Shaz,
>> >
>> > I mentioned doing such a change during PGD, but was hoping you could
>> give it
>> > a sanity check over:
>> >
>> > https://issues.apache.org/jira/browse/CB-1150
>> > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
>> > https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>> >
>> > I ensured mobile-spec and unit tests pass, so should be good to go I
>> think.
>> >
>> > Andrew
>>



-- 
@purplecabbage
risingj.com

Re: Changing iOS's exec bridge

Posted by Andrew Grieve <ag...@chromium.org>.
Committed.
Sounds good! You update the dev guide, and I'll work to update the existing
core plugins.


On Fri, Jul 27, 2012 at 6:22 PM, Shazron <sh...@gmail.com> wrote:

> Thanks Andrew, this looks good!
>
> Once you merge it in, I'll add the doc issues, especially the Plugin
> Dev Guide, we don't want people to start using the old way. I was
> thinking, a deprecation NSLog would be great if they are using the old
> way, but that will just be too much noise at this point...
>
> On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
> > Shaz,
> >
> > I mentioned doing such a change during PGD, but was hoping you could
> give it
> > a sanity check over:
> >
> > https://issues.apache.org/jira/browse/CB-1150
> > https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> > https://github.com/agrieve/incubator-cordova-js/tree/better_exec
> >
> > I ensured mobile-spec and unit tests pass, so should be good to go I
> think.
> >
> > Andrew
>

Re: Changing iOS's exec bridge

Posted by Shazron <sh...@gmail.com>.
Thanks Andrew, this looks good!

Once you merge it in, I'll add the doc issues, especially the Plugin
Dev Guide, we don't want people to start using the old way. I was
thinking, a deprecation NSLog would be great if they are using the old
way, but that will just be too much noise at this point...

On Fri, Jul 27, 2012 at 2:06 PM, Andrew Grieve <ag...@chromium.org> wrote:
> Shaz,
>
> I mentioned doing such a change during PGD, but was hoping you could give it
> a sanity check over:
>
> https://issues.apache.org/jira/browse/CB-1150
> https://github.com/agrieve/incubator-cordova-ios/compare/legacy_exec
> https://github.com/agrieve/incubator-cordova-js/tree/better_exec
>
> I ensured mobile-spec and unit tests pass, so should be good to go I think.
>
> Andrew